@Override public boolean add(final T t) { _node.addChild(t, _role); return true; }
@Override public boolean add(final T t) { _node.addChild(t, _role); return true; }
@Override public boolean add(final T t) { _node.addChild(t, _role); return true; }
static void addModifier(final AstNode node, final Modifier modifier) { final List<Modifier> modifiers = getModifiers(node); if (modifiers.contains(modifier)) { return; } node.addChild(new JavaModifierToken(TextLocation.EMPTY, modifier), MODIFIER_ROLE); }
static void addModifier(final AstNode node, final Modifier modifier) { final List<Modifier> modifiers = getModifiers(node); if (modifiers.contains(modifier)) { return; } node.addChild(new JavaModifierToken(TextLocation.EMPTY, modifier), MODIFIER_ROLE); }
static void addModifier(final AstNode node, final Modifier modifier) { final List<Modifier> modifiers = getModifiers(node); if (modifiers.contains(modifier)) { return; } node.addChild(new JavaModifierToken(TextLocation.EMPTY, modifier), MODIFIER_ROLE); }
protected final <T extends AstNode> void setChildByRole(final Role<T> role, final T newChild) { final T oldChild = getChildByRole(role); if (oldChild.isNull()) { addChild(newChild, role); } else { oldChild.replaceWith(newChild); } }
protected final <T extends AstNode> void setChildByRole(final Role<T> role, final T newChild) { final T oldChild = getChildByRole(role); if (oldChild.isNull()) { addChild(newChild, role); } else { oldChild.replaceWith(newChild); } }
protected final <T extends AstNode> void setChildByRole(final Role<T> role, final T newChild) { final T oldChild = getChildByRole(role); if (oldChild.isNull()) { addChild(newChild, role); } else { oldChild.replaceWith(newChild); } }
public final <T extends AstNode> void insertChildBefore(final AstNode nextSibling, final T child, final Role<T> role) { VerifyArgument.notNull(role, "role"); if (nextSibling == null || nextSibling.isNull()) { addChild(child, role); return; } if (child == null || child.isNull()) { return; } verifyNotFrozen(); if (((AstNode)child)._parent != null) { throw new IllegalArgumentException("Node belongs to another tree."); } if (child.isFrozen()) { throw new IllegalArgumentException("Cannot add a frozen node."); } if (nextSibling._parent != this) { throw new IllegalArgumentException("Next sibling is not a child of this node."); } insertChildBeforeUnsafe(nextSibling, child, role); }
public final <T extends AstNode> void insertChildBefore(final AstNode nextSibling, final T child, final Role<T> role) { VerifyArgument.notNull(role, "role"); if (nextSibling == null || nextSibling.isNull()) { addChild(child, role); return; } if (child == null || child.isNull()) { return; } verifyNotFrozen(); if (((AstNode)child)._parent != null) { throw new IllegalArgumentException("Node belongs to another tree."); } if (child.isFrozen()) { throw new IllegalArgumentException("Cannot add a frozen node."); } if (nextSibling._parent != this) { throw new IllegalArgumentException("Next sibling is not a child of this node."); } insertChildBeforeUnsafe(nextSibling, child, role); }
public final <T extends AstNode> void insertChildBefore(final AstNode nextSibling, final T child, final Role<T> role) { VerifyArgument.notNull(role, "role"); if (nextSibling == null || nextSibling.isNull()) { addChild(child, role); return; } if (child == null || child.isNull()) { return; } verifyNotFrozen(); if (((AstNode)child)._parent != null) { throw new IllegalArgumentException("Node belongs to another tree."); } if (child.isFrozen()) { throw new IllegalArgumentException("Cannot add a frozen node."); } if (nextSibling._parent != this) { throw new IllegalArgumentException("Next sibling is not a child of this node."); } insertChildBeforeUnsafe(nextSibling, child, role); }
insertionPoint.addChild(insertedStatement, BlockStatement.STATEMENT_ROLE);
insertionPoint.addChild(insertedStatement, BlockStatement.STATEMENT_ROLE);
insertionPoint.addChild(insertedStatement, BlockStatement.STATEMENT_ROLE);