/** * Creates and returns a new unparented module declaration * node for an unspecified, but legal, name; no modifiers; no javadoc; * and an empty list of statements. * * @return a new unparented module declaration node * @exception UnsupportedOperationException if this operation is used in an AST with level less than JLS9 * @since 3.14 */ public ModuleDeclaration newModuleDeclaration() { ModuleDeclaration result = new ModuleDeclaration(this); return result; }
/** * Creates and returns a new unparented module declaration * node for an unspecified, but legal, name; no modifiers; no javadoc; * and an empty list of statements. * * @return a new unparented module declaration node * @exception UnsupportedOperationException if this operation is used in an AST with level less than JLS9 * @since 3.14 */ public ModuleDeclaration newModuleDeclaration() { ModuleDeclaration result = new ModuleDeclaration(this); 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; }
@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; }