ASTNode clone0(AST target) { SuperMethodReference result = new SuperMethodReference(target); result.setSourceRange(getStartPosition(), getLength()); result.setName((SimpleName) getName().clone(target)); result.setQualifier((Name) ASTNode.copySubtree(target, getQualifier())); result.typeArguments().addAll(ASTNode.copySubtrees(target, typeArguments())); return result; }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order acceptChild(visitor, getQualifier()); acceptChildren(visitor, this.typeArguments); acceptChild(visitor, getName()); } visitor.endVisit(this); }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == QUALIFIER_PROPERTY) { if (get) { return getQualifier(); } else { setQualifier((Name) child); return null; } } if (property == NAME_PROPERTY) { if (get) { return getName(); } else { setName((SimpleName) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
@Override public boolean visit(SuperMethodReference node) { if (node.getQualifier() != null) { node.getQualifier().accept(this); this.buffer.append('.'); } this.buffer.append("super");//$NON-NLS-1$ visitReferenceTypeArguments(node.typeArguments()); node.getName().accept(this); return false; }
result = typeMethodReference; } else if (lhs instanceof SuperReference) { SuperMethodReference superMethodReference = new SuperMethodReference(this.ast); superMethodReference.setName(name); typeArguments = superMethodReference.typeArguments(); result = superMethodReference; } else if (lhs instanceof QualifiedSuperReference) { SuperMethodReference superMethodReference = new SuperMethodReference(this.ast); superMethodReference.setQualifier(convert((QualifiedSuperReference)lhs)); superMethodReference.setName(name); typeArguments = superMethodReference.typeArguments(); result = superMethodReference; } else {
int treeSize() { return memSize() + (this.optionalQualifier == null ? 0 : getQualifier().treeSize()) + (this.typeArguments == null ? 0 : this.typeArguments.listSize()) + (this.methodName == null ? 0 : getName().treeSize()); } }
superMethodReference.setQualifier((Name) rewrite.createCopyTarget(superQualifier)); superMethodReference.setName((SimpleName) rewrite.createCopyTarget(superMethodInvocation.getName())); superMethodReference.typeArguments().addAll(getCopiedTypeArguments(rewrite, superMethodInvocation.typeArguments()));
@Override public boolean visit(SuperMethodReference node) { handleTypeArguments(node.typeArguments()); return true; }
@Override public boolean visit(SuperMethodReference node) { doVisitNode(node.getQualifier()); doVisitChildren(node.typeArguments()); return false; }
public boolean visit(SuperMethodReference node) { ASTNode qualifier = getChildNode(node, SuperMethodReference.QUALIFIER_PROPERTY); if (qualifier != null) { qualifier.accept(this); this.result.append('.'); } this.result.append("super ::"); //$NON-NLS-1$ visitList(node, SuperMethodReference.TYPE_ARGUMENTS_PROPERTY, Util.EMPTY_STRING, String.valueOf('<'), String.valueOf('>')); node.getName().accept(this); return false; }
Name superQualifier= ((SuperMethodReference) methodReference).getQualifier(); if (superQualifier != null) { superMethodInvocation.setQualifier((Name) rewrite.createCopyTarget(superQualifier));
private void replaceBySuperMethodReference(final LambdaExpression node, final SuperMethodInvocation ci) { final ASTBuilder b = ctx.getASTBuilder(); final SuperMethodReference creationRef = b.superMethodRef(); creationRef.setName(b.copy(ci.getName())); ctx.getRefactorings().replace(node, creationRef); }
public boolean visit(SuperMethodReference node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } int pos = rewriteOptionalQualifier(node, SuperMethodReference.QUALIFIER_PROPERTY, node.getStartPosition()); visitReferenceTypeArguments(node, SuperMethodReference.TYPE_ARGUMENTS_PROPERTY, pos); rewriteRequiredNode(node, SuperMethodReference.NAME_PROPERTY); return false; }
/** * Creates and returns a new unparented super method reference node owned by * this AST. By default, the name of the method is unspecified (but legal), * and there is no qualifier and no type arguments. * * @return a new unparented super method reference node * @since 3.10 */ public SuperMethodReference newSuperMethodReference() { SuperMethodReference result = new SuperMethodReference(this); return result; }
public boolean visit(SuperMethodReference node) { if (node.getQualifier() != null) { node.getQualifier().accept(this); this.buffer.append('.'); } this.buffer.append("super");//$NON-NLS-1$ visitReferenceTypeArguments(node.typeArguments()); node.getName().accept(this); return false; }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == QUALIFIER_PROPERTY) { if (get) { return getQualifier(); } else { setQualifier((Name) child); return null; } } if (property == NAME_PROPERTY) { if (get) { return getName(); } else { setName((SimpleName) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
result = typeMethodReference; } else if (lhs instanceof SuperReference) { SuperMethodReference superMethodReference = new SuperMethodReference(this.ast); superMethodReference.setName(name); typeArguments = superMethodReference.typeArguments(); result = superMethodReference; } else if (lhs instanceof QualifiedSuperReference) { SuperMethodReference superMethodReference = new SuperMethodReference(this.ast); superMethodReference.setQualifier(convert((QualifiedSuperReference)lhs)); superMethodReference.setName(name); typeArguments = superMethodReference.typeArguments(); result = superMethodReference; } else {
@Override int treeSize() { return memSize() + (this.optionalQualifier == null ? 0 : getQualifier().treeSize()) + (this.typeArguments == null ? 0 : this.typeArguments.listSize()) + (this.methodName == null ? 0 : getName().treeSize()); } }
superMethodReference.setQualifier((Name) rewrite.createCopyTarget(superQualifier)); superMethodReference.setName((SimpleName) rewrite.createCopyTarget(superMethodInvocation.getName())); superMethodReference.typeArguments().addAll(getCopiedTypeArguments(rewrite, superMethodInvocation.typeArguments()));
@Override public boolean visit(SuperMethodReference node) { handleTypeArguments(node.typeArguments()); return true; }