@Override protected void setJDTJavaDoc(Javadoc javaDoc) { pkg.setJavadoc(javaDoc); } }
/** * Generate comment for the compilation unit. * * @param ast * the JDT Java AST * @param packageDeclaration * the package declaration where we want to insert the javadoc * @param comment * comments */ @SuppressWarnings("unchecked") public void generatePackageJavadoc(AST ast, PackageDeclaration packageDeclaration, String... comment) { Javadoc javadoc = ast.newJavadoc(); for (String actualComment : comment) { TagElement tagElement = ast.newTagElement(); tagElement.setTagName(actualComment); javadoc.tags().add(tagElement); } packageDeclaration.setJavadoc(javadoc); }
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); }
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); }
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); }
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); }
public void convert(org.eclipse.jdt.internal.compiler.ast.Javadoc javadoc, PackageDeclaration packageDeclaration) { if (this.ast.apiLevel == AST.JLS3 && packageDeclaration.getJavadoc() == null) { if (javadoc != null) { if (this.commentMapper == null || !this.commentMapper.hasSameTable(this.commentsTable)) { this.commentMapper = new DefaultCommentMapper(this.commentsTable); } Comment comment = this.commentMapper.getComment(javadoc.sourceStart); if (comment != null && comment.isDocComment() && comment.getParent() == null) { Javadoc docComment = (Javadoc) comment; if (this.resolveBindings) { recordNodes(docComment, javadoc); // resolve member and method references binding Iterator tags = docComment.tags().listIterator(); while (tags.hasNext()) { recordNodes(javadoc, (TagElement) tags.next()); } } packageDeclaration.setJavadoc(docComment); } } } }
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); }
public void convert(org.eclipse.jdt.internal.compiler.ast.Javadoc javadoc, PackageDeclaration packageDeclaration) { switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL : return; } if (packageDeclaration.getJavadoc() == null) { if (javadoc != null) { if (this.commentMapper == null || !this.commentMapper.hasSameTable(this.commentsTable)) { this.commentMapper = new DefaultCommentMapper(this.commentsTable); } Comment comment = this.commentMapper.getComment(javadoc.sourceStart); if (comment != null && comment.isDocComment() && comment.getParent() == null) { Javadoc docComment = (Javadoc) comment; if (this.resolveBindings) { recordNodes(docComment, javadoc); // resolve member and method references binding Iterator tags = docComment.tags().listIterator(); while (tags.hasNext()) { recordNodes(javadoc, (TagElement) tags.next()); } } packageDeclaration.setJavadoc(docComment); } } } }
public void convert(org.eclipse.jdt.internal.compiler.ast.Javadoc javadoc, PackageDeclaration packageDeclaration) { switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL : return; } if (packageDeclaration.getJavadoc() == null) { if (javadoc != null) { if (this.commentMapper == null || !this.commentMapper.hasSameTable(this.commentsTable)) { this.commentMapper = new DefaultCommentMapper(this.commentsTable); } Comment comment = this.commentMapper.getComment(javadoc.sourceStart); if (comment != null && comment.isDocComment() && comment.getParent() == null) { Javadoc docComment = (Javadoc) comment; if (this.resolveBindings) { recordNodes(docComment, javadoc); // resolve member and method references binding Iterator tags = docComment.tags().listIterator(); while (tags.hasNext()) { recordNodes(javadoc, (TagElement) tags.next()); } } packageDeclaration.setJavadoc(docComment); } } } }
public void convert(org.eclipse.jdt.internal.compiler.ast.Javadoc javadoc, PackageDeclaration packageDeclaration) { switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL : return; } if (packageDeclaration.getJavadoc() == null) { if (javadoc != null) { if (this.commentMapper == null || !this.commentMapper.hasSameTable(this.commentsTable)) { this.commentMapper = new DefaultCommentMapper(this.commentsTable); } Comment comment = this.commentMapper.getComment(javadoc.sourceStart); if (comment != null && comment.isDocComment() && comment.getParent() == null) { Javadoc docComment = (Javadoc) comment; if (this.resolveBindings) { recordNodes(docComment, javadoc); // resolve member and method references binding Iterator tags = docComment.tags().listIterator(); while (tags.hasNext()) { recordNodes(javadoc, (TagElement) tags.next()); } } packageDeclaration.setJavadoc(docComment); } } } }
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; }
@SuppressWarnings("unchecked") private void generateRoot() throws IOException { PackageTypeBuilder.createCompilationUnit(this.options.getTargetPath(), packageName(), "package-info", this.options.getCharacterSet(), (ast, cu) -> { final Information info = this.api.getInformation(); final Javadoc doc = ast.newJavadoc(); if (info.getTitle() != null) { final TagElement tag = ast.newTagElement(); tag.fragments().add(JDTHelper.newText(ast, info.getTitle())); doc.tags().add(tag); } if (info.getVersion() != null) { final TagElement version = ast.newTagElement(); version.setTagName("@version"); version.fragments().add(JDTHelper.newText(ast, info.getVersion())); doc.tags().add(version); } cu.getPackage().setJavadoc(doc); }); } }
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; }