ASTNode clone0(AST target) { AnnotationTypeMemberDeclaration result = new AnnotationTypeMemberDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.setType((Type) ASTNode.copySubtree(target, getType())); result.setName((SimpleName) getName().clone(target)); result.setDefault((Expression) ASTNode.copySubtree(target, getDefault())); return result; }
public boolean visit(AnnotationTypeMemberDeclaration node) { if (found(node, node.getName()) && this.resolveBinding) this.foundBinding = node.resolveBinding(); return true; }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order acceptChild(visitor, getJavadoc()); acceptChildren(visitor, this.modifiers); acceptChild(visitor, getType()); acceptChild(visitor, getName()); acceptChild(visitor, getDefault()); } visitor.endVisit(this); }
public boolean visit(AnnotationTypeMemberDeclaration node) { if (node.getJavadoc() != null) { node.getJavadoc().accept(this); } printModifiers(node.modifiers()); node.getType().accept(this); this.fBuffer.append(" ");//$NON-NLS-1$ node.getName().accept(this); this.fBuffer.append("()");//$NON-NLS-1$ if (node.getDefault() != null) { this.fBuffer.append(" default ");//$NON-NLS-1$ node.getDefault().accept(this); } this.fBuffer.append(";");//$NON-NLS-1$ return false; }
if (property == JAVADOC_PROPERTY) { if (get) { return getJavadoc(); } else { setJavadoc((Javadoc) child); return null; return getType(); } else { setType((Type) child); return null; return getName(); } else { setName((SimpleName) child); return null; return getDefault(); } else { setDefault((Expression) child); return null;
@Override int treeSize() { return memSize() + (this.optionalDocComment == null ? 0 : getJavadoc().treeSize()) + this.modifiers.listSize() + (this.memberName == null ? 0 : getName().treeSize()) + (this.memberType == null ? 0 : getType().treeSize()) + (this.optionalDefaultValue == null ? 0 : getDefault().treeSize()); } }
return null; AnnotationTypeMemberDeclaration annotationTypeMemberDeclaration2 = new AnnotationTypeMemberDeclaration(this.ast); setModifiers(annotationTypeMemberDeclaration2, annotationTypeMemberDeclaration); final SimpleName methodName = new SimpleName(this.ast); int end = retrieveIdentifierEndPosition(start, annotationTypeMemberDeclaration.sourceEnd); methodName.setSourceRange(start, end - start + 1); annotationTypeMemberDeclaration2.setName(methodName); org.eclipse.jdt.internal.compiler.ast.TypeReference typeReference = annotationTypeMemberDeclaration.returnType; if (typeReference != null) { annotationTypeMemberDeclaration2.setSourceRange(declarationSourceStart, declarationSourceEnd - declarationSourceStart + 1); annotationTypeMemberDeclaration2.setDefault(convert(memberValue)); annotationTypeMemberDeclaration2.resolveBinding();
@Override public boolean visit(AnnotationTypeMemberDeclaration node) { handleToken(node.getName(), TokenNameIdentifier, true, false); handleToken(node.getName(), TokenNameLPAREN, this.options.insert_space_before_opening_paren_in_annotation_type_member_declaration, false); handleEmptyParens(node.getName(), this.options.insert_space_between_empty_parens_in_annotation_type_member_declaration); if (node.getDefault() != null) handleTokenBefore(node.getDefault(), TokenNamedefault, true, true); return true; }
private AnnotationTypeMemberDeclaration getStub(ASTRewrite rewrite, AnnotationTypeDeclaration targetTypeDecl) { AST ast= targetTypeDecl.getAST(); AnnotationTypeMemberDeclaration decl= ast.newAnnotationTypeMemberDeclaration(); SimpleName newNameNode= getNewName(rewrite); decl.modifiers().addAll(ASTNodeFactory.newModifiers(ast, evaluateModifiers(targetTypeDecl))); decl.setName(newNameNode); Type returnType= getNewType(rewrite); decl.setType(returnType); return decl; }
public void endVisit(AnnotationTypeMemberDeclaration node) { if (skipNode(node)) return; GenericSequentialFlowInfo info= processSequential(node, node.getType(), node.getDefault()); info.setNoReturn(); }
@Override public AnnotationSource<JavaAnnotationSource> getAnnotation() { Expression expr = member.getDefault(); if (expr instanceof org.eclipse.jdt.core.dom.Annotation) { return new AnnotationValue(parent, expr); } return null; }
@Override public String getName() { return member.getName().toString(); }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == MODIFIERS2_PROPERTY) { return modifiers(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
protected void setTypeForMethodDeclaration(AnnotationTypeMemberDeclaration annotationTypeMemberDeclaration, Type type, int extraDimension) { annotationTypeMemberDeclaration.setType(type); }
@Override public boolean visit(AnnotationTypeMemberDeclaration node) { push(JavaNode.METHOD, getSignature(node), node.getStartPosition(), node.getLength()); return true; }
public void endVisit(AnnotationTypeMemberDeclaration node) { ownValue = scopeManager.pop(); IConstructor type = bindingsResolver.resolveType(node.getType().resolveBinding(), true); insert(types, ownValue, type); }
private AnnotationTypeMemberDeclaration findOriginalMemberDeclaration(AnnotationTypeMemberDeclaration node) { return (AnnotationTypeMemberDeclaration)findOriginalMethodDeclaration(node.resolveBinding()); }
@Override public AnnotationElementSource setName(final String name) { member.setName(ast.newSimpleName(name)); return this; }
/** * Returns whether the given node and the other object match. * <p> * The default implementation provided by this class tests whether the * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> * * @param node the node * @param other the other object, or <code>null</code> * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 */ public boolean match(AnnotationTypeMemberDeclaration node, Object other) { if (!(other instanceof AnnotationTypeMemberDeclaration)) { return false; } AnnotationTypeMemberDeclaration o = (AnnotationTypeMemberDeclaration) other; // node type added in JLS3 - ignore old JLS2-style modifiers return (safeSubtreeMatch(node.getJavadoc(), o.getJavadoc()) && safeSubtreeListMatch(node.modifiers(), o.modifiers()) && safeSubtreeMatch(node.getType(), o.getType()) && safeSubtreeMatch(node.getName(), o.getName()) && safeSubtreeMatch(node.getDefault(), o.getDefault())); }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == JAVADOC_PROPERTY) { if (get) { return getJavadoc(); } else { setJavadoc((Javadoc) child); return null; return getType(); } else { setType((Type) child); return null; return getName(); } else { setName((SimpleName) child); return null; return getDefault(); } else { setDefault((Expression) child); return null;