final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == ANNOTATIONS_PROPERTY) { return annotations(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
@Override final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == ANNOTATIONS_PROPERTY) { return annotations(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
private static List<?> getModifiers(final ASTNode body) { if (body instanceof BodyDeclaration) { return ((BodyDeclaration) body).modifiers(); } else if (body instanceof PackageDeclaration) { return ((PackageDeclaration) body).annotations(); } return Collections.emptyList(); } }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == ANNOTATIONS_PROPERTY) { return annotations(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == ANNOTATIONS_PROPERTY) { return annotations(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == ANNOTATIONS_PROPERTY) { return annotations(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == ANNOTATIONS_PROPERTY) { return annotations(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
private List<?> getModifiers(final ASTNode body) { if (body instanceof BodyDeclaration) { return ((BodyDeclaration) body).modifiers(); } else if (body instanceof PackageDeclaration) { return ((PackageDeclaration) body).annotations(); } return Collections.emptyList(); } }
public boolean visit(PackageDeclaration node) { if (node.getAST().apiLevel() >= AST.JLS3) { doVisitChildren(node.annotations()); } return false; }
@Override public boolean visit(PackageDeclaration node) { doVisitNode(node.getJavadoc()); doVisitChildren(node.annotations()); return false; }
@Override public boolean visit(PackageDeclaration node) { doVisitNode(node.getJavadoc()); doVisitChildren(node.annotations()); return false; }
@Override public boolean visit(PackageDeclaration node) { int blanks = this.options.blank_lines_before_package; if (blanks > 0) { List<Annotation> annotations = node.annotations(); int firstTokenIndex = annotations.isEmpty() ? this.tm.firstIndexBefore(node.getName(), TokenNamepackage) : this.tm.firstIndexIn(annotations.get(0), -1); this.tm.get(firstTokenIndex).putLineBreaksBefore(blanks + 1); } this.tm.lastTokenIn(node, TokenNameSEMICOLON).putLineBreaksAfter(this.options.blank_lines_after_package + 1); this.declarationModifierVisited = false; return true; }
@Override public boolean visit(PackageDeclaration node) { int blanks = this.options.blank_lines_before_package; if (blanks > 0) { List<Annotation> annotations = node.annotations(); int firstTokenIndex = annotations.isEmpty() ? this.tm.firstIndexBefore(node.getName(), TokenNamepackage) : this.tm.firstIndexIn(annotations.get(0), -1); this.tm.get(firstTokenIndex).putLineBreaksBefore(blanks + 1); } this.tm.lastTokenIn(node, TokenNameSEMICOLON).putLineBreaksAfter(this.options.blank_lines_after_package + 1); this.declarationModifierVisited = false; return true; }
ASTNode clone0(AST target) { PackageDeclaration result = new PackageDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc())); result.annotations().addAll(ASTNode.copySubtrees(target, annotations())); } result.setName((Name) getName().clone(target)); return result; }
ASTNode clone0(AST target) { PackageDeclaration result = new PackageDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc())); result.annotations().addAll(ASTNode.copySubtrees(target, annotations())); } result.setName((Name) getName().clone(target)); return result; }
@Override ASTNode clone0(AST target) { PackageDeclaration result = new PackageDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc())); result.annotations().addAll(ASTNode.copySubtrees(target, annotations())); } result.setName((Name) getName().clone(target)); return result; }
ASTNode clone0(AST target) { PackageDeclaration result = new PackageDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc())); result.annotations().addAll(ASTNode.copySubtrees(target, annotations())); } result.setName((Name) getName().clone(target)); return result; }
ASTNode clone0(AST target) { PackageDeclaration result = new PackageDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel >= AST.JLS3) { result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc())); result.annotations().addAll(ASTNode.copySubtrees(target, annotations())); } result.setName((Name) getName().clone(target)); return result; }
ASTNode clone0(AST target) { PackageDeclaration result = new PackageDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc())); result.annotations().addAll(ASTNode.copySubtrees(target, annotations())); } result.setName((Name) getName().clone(target)); return result; }
@Override public boolean visit(final PackageDeclaration it) { Javadoc _javadoc = it.getJavadoc(); boolean _tripleNotEquals = (_javadoc != null); if (_tripleNotEquals) { it.getJavadoc().accept(this); } this.visitAll(it.annotations(), " "); this.appendToBuffer("package "); it.getName().accept(this); this.appendLineWrapToBuffer(); return false; }