@Override public boolean visit(ModuleDeclaration node) { if (node.getJavadoc() != null) { node.getJavadoc().accept(this); } printModifiers(node.annotations()); if (node.isOpen()) this.buffer.append("open "); //$NON-NLS-1$ this.buffer.append("module"); //$NON-NLS-1$ this.buffer.append(" "); //$NON-NLS-1$ node.getName().accept(this); this.buffer.append(" {\n"); //$NON-NLS-1$ this.indent++; for (ModuleDirective stmt : (List<ModuleDirective>)node.moduleStatements()) { stmt.accept(this); } this.indent--; this.buffer.append("}"); //$NON-NLS-1$ return false; }
@Override public boolean visit(ModuleDeclaration node) { if (node.getJavadoc() != null) { node.getJavadoc().accept(this); } printModifiers(node.annotations()); if (node.isOpen()) this.fBuffer.append("open "); //$NON-NLS-1$ this.fBuffer.append("module"); //$NON-NLS-1$ this.fBuffer.append(" "); //$NON-NLS-1$ node.getName().accept(this); this.fBuffer.append(" {\n"); //$NON-NLS-1$ for (ModuleDirective stmt : (List<ModuleDirective>)node.moduleStatements()) { stmt.accept(this); } this.fBuffer.append("}"); //$NON-NLS-1$ return false; }
@Override public boolean visit(ModuleDeclaration node) { if (node.getJavadoc() != null) { node.getJavadoc().accept(this); } printModifiers(node.annotations()); if (node.isOpen()) this.buffer.append("open "); //$NON-NLS-1$ this.buffer.append("module"); //$NON-NLS-1$ this.buffer.append(" "); //$NON-NLS-1$ node.getName().accept(this); this.buffer.append(" {\n"); //$NON-NLS-1$ this.indent++; for (ModuleDirective stmt : (List<ModuleDirective>)node.moduleStatements()) { stmt.accept(this); } this.indent--; this.buffer.append("}"); //$NON-NLS-1$ return false; }
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 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 int treeSize() { return memSize() + (this.optionalDocComment == null ? 0 : getJavadoc().treeSize()) + this.annotations.listSize() + (this.name == null ? 0 : getName().treeSize()) + this.moduleStatements.listSize(); } }
@Override int treeSize() { return memSize() + (this.optionalDocComment == null ? 0 : getJavadoc().treeSize()) + this.annotations.listSize() + (this.name == null ? 0 : getName().treeSize()) + this.moduleStatements.listSize(); } }
@Override 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.annotations); acceptChild(visitor, getName()); acceptChildren(visitor, this.moduleStatements); } visitor.endVisit(this); } /**
@Override 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.annotations); acceptChild(visitor, getName()); acceptChildren(visitor, this.moduleStatements); } visitor.endVisit(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.14 */ public boolean match(ModuleDeclaration node, Object other) { if (!(other instanceof ModuleDeclaration)) { return false; } ModuleDeclaration o = (ModuleDeclaration) other; return (safeSubtreeMatch(node.getJavadoc(), o.getJavadoc()) && safeSubtreeListMatch(node.annotations(), o.annotations()) && node.isOpen() == o.isOpen() && safeSubtreeMatch(node.getName(), o.getName()) && safeSubtreeListMatch(node.moduleStatements(), o.moduleStatements())); }
/** * 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.14 */ public boolean match(ModuleDeclaration node, Object other) { if (!(other instanceof ModuleDeclaration)) { return false; } ModuleDeclaration o = (ModuleDeclaration) other; return (safeSubtreeMatch(node.getJavadoc(), o.getJavadoc()) && safeSubtreeListMatch(node.annotations(), o.annotations()) && node.isOpen() == o.isOpen() && safeSubtreeMatch(node.getName(), o.getName()) && safeSubtreeListMatch(node.moduleStatements(), o.moduleStatements())); }
@SuppressWarnings("unchecked") @Override ASTNode clone0(AST target) { ModuleDeclaration result = new ModuleDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc())); result.setOpen(isOpen()); result.annotations().addAll(ASTNode.copySubtrees(target, annotations())); result.setName((SimpleName) getName().clone(target)); result.moduleStatements().addAll(ASTNode.copySubtrees(target, moduleStatements())); return result; }
@SuppressWarnings("unchecked") @Override ASTNode clone0(AST target) { ModuleDeclaration result = new ModuleDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc())); result.setOpen(isOpen()); result.annotations().addAll(ASTNode.copySubtrees(target, annotations())); result.setName((SimpleName) getName().clone(target)); result.moduleStatements().addAll(ASTNode.copySubtrees(target, moduleStatements())); return result; }