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; }
public boolean visit(PackageDeclaration node) { if (found(node, node) && this.resolveBinding) this.foundBinding = node.resolveBinding(); return true; }
@Override void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { acceptChild(visitor, getJavadoc()); acceptChildren(visitor, this.annotations); } acceptChild(visitor, getName()); } visitor.endVisit(this); }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == JAVADOC_PROPERTY) { if (get) { return getJavadoc(); } else { setJavadoc((Javadoc) child); return null; } } if (property == NAME_PROPERTY) { if (get) { return getName(); } else { setName((Name) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
@Override public boolean visit( PackageDeclaration node ) { classPkg.set( node.getName().toString() ); return true; }
@Override int treeSize() { return memSize() + (this.optionalDocComment == null ? 0 : getJavadoc().treeSize()) + (this.annotations == null ? 0 : this.annotations.listSize()) + (this.packageName == null ? 0 : getName().treeSize()); } }
if (pkg != null) { int pkgStart; Javadoc javadoc = pkg.getJavadoc(); if (javadoc != null) { pkgStart = javadoc.getStartPosition() + javadoc.getLength() + 1; } else { pkgStart = pkg.getStartPosition(); pkg.setName(ast.newName(pkgName)); rewriter.set(astCU, CompilationUnit.PACKAGE_PROPERTY, pkg, null);
@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; }
@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; }
public boolean visit(PackageDeclaration node) { _compilationUnit.setPackagePosition(node.getStartPosition()); String namespace = node.getName().toString(); _compilationUnit.namespace(mappedNamespace(namespace)); processDisableTags(node, _compilationUnit); return false; }
p1.setName(ast.newSimpleName("foo")); cu.setPackage(p1);
@Override public boolean visit(PackageDeclaration node) { new JavaNode(getCurrentContainer(), JavaNode.PACKAGE, null, node.getStartPosition(), node.getLength()); return false; }
@Override public boolean visit(PackageDeclaration node) { doVisitNode(node.getJavadoc()); doVisitChildren(node.annotations()); return false; }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == ANNOTATIONS_PROPERTY) { return annotations(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
@Override protected Javadoc getJDTJavaDoc() { return pkg.getJavadoc(); }
public boolean visit(PackageDeclaration node) { if (node.getAST().apiLevel() >= AST.JLS3) { doVisitChildren(node.annotations()); } return false; }
public boolean visit(CompilationUnit node) { if (node.getPackage() != null) { node.getPackage().accept(this); } for (Iterator it = node.imports().iterator(); it.hasNext(); ) { ImportDeclaration d = (ImportDeclaration) it.next(); d.accept(this); } for (Iterator it = node.types().iterator(); it.hasNext(); ) { AbstractTypeDeclaration d = (AbstractTypeDeclaration) it.next(); d.accept(this); } return false; }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { if (this.ast.apiLevel >= AST.JLS3) { acceptChild(visitor, getJavadoc()); acceptChildren(visitor, this.annotations); } acceptChild(visitor, getName()); } visitor.endVisit(this); }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == JAVADOC_PROPERTY) { if (get) { return getJavadoc(); } else { setJavadoc((Javadoc) child); return null; } } if (property == NAME_PROPERTY) { if (get) { return getName(); } else { setName((Name) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
@Override public boolean visit(final PackageDeclaration node) { currentPackage = node.getName().getFullyQualifiedName(); return false; }