本文整理汇总了Java中org.eclipse.jdt.core.dom.PackageDeclaration.getJavadoc方法的典型用法代码示例。如果您正苦于以下问题:Java PackageDeclaration.getJavadoc方法的具体用法?Java PackageDeclaration.getJavadoc怎么用?Java PackageDeclaration.getJavadoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.dom.PackageDeclaration
的用法示例。
在下文中一共展示了PackageDeclaration.getJavadoc方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.eclipse.jdt.core.dom.PackageDeclaration; //导入方法依赖的package包/类
@Override
public boolean visit(PackageDeclaration node) {
if (node.getAST().apiLevel() >= JLS3) {
if (node.getJavadoc() != null) {
node.getJavadoc().accept(this);
}
for (Iterator<Annotation> it= node.annotations().iterator(); it.hasNext();) {
Annotation p= it.next();
p.accept(this);
this.fBuffer.append(" ");//$NON-NLS-1$
}
}
this.fBuffer.append("package ");//$NON-NLS-1$
node.getName().accept(this);
this.fBuffer.append(";");//$NON-NLS-1$
return false;
}
示例2: visit
import org.eclipse.jdt.core.dom.PackageDeclaration; //导入方法依赖的package包/类
public boolean visit(PackageDeclaration node) {
if (node.getAST().apiLevel() >= JLS3) {
if (node.getJavadoc() != null) {
node.getJavadoc().accept(this);
}
for (Iterator it = node.annotations().iterator(); it.hasNext(); ) {
Annotation p = (Annotation) it.next();
p.accept(this);
this.buffer.append(" ");//$NON-NLS-1$
}
}
printIndent();
this.buffer.append("package ");//$NON-NLS-1$
node.getName().accept(this);
this.buffer.append(";\n");//$NON-NLS-1$
return false;
}
示例3: visit
import org.eclipse.jdt.core.dom.PackageDeclaration; //导入方法依赖的package包/类
@Override
public boolean visit(PackageDeclaration node) {
//System.out.println("Found: " + node.getClass());
if (node.getJavadoc() != null) {
node.getJavadoc().accept(this);
}
print("module ");
Writer w = new StringWriter();
pushWriter(w);
node.getName().accept(this);
popWriter();
packageName = w.toString();
println(packageName + "." + moduleName + ";");
return false;
}
示例4: hasCopyrightsComment
import org.eclipse.jdt.core.dom.PackageDeclaration; //导入方法依赖的package包/类
/**
* Checks whether {@link CompilationUnit} has copyright header
*
* @param compilationUnit
* checked compilation unit
* @return true if {@link CompilationUnit} has copyright header
*/
public boolean hasCopyrightsComment(final CompilationUnit compilationUnit) {
final List<Comment> comments = getCommentList(compilationUnit);
boolean hasCopyrights = false;
if (!comments.isEmpty()) {
final PackageDeclaration packageNode = compilationUnit.getPackage();
final boolean commentBeforePackage = comments.get(0).getStartPosition() <= packageNode.getStartPosition();
final boolean hasJavaDoc = packageNode.getJavadoc() != null;
hasCopyrights = commentBeforePackage || hasJavaDoc;
}
return hasCopyrights;
}
示例5: getPackageJavadocNode
import org.eclipse.jdt.core.dom.PackageDeclaration; //导入方法依赖的package包/类
private static Javadoc getPackageJavadocNode(IJavaElement element, String cuSource) {
CompilationUnit cu= createAST(element, cuSource);
if (cu != null) {
PackageDeclaration packDecl= cu.getPackage();
if (packDecl != null) {
return packDecl.getJavadoc();
}
}
return null;
}
示例6: getPackageJavadocNode
import org.eclipse.jdt.core.dom.PackageDeclaration; //导入方法依赖的package包/类
private static Javadoc getPackageJavadocNode(IJavaElement element, String cuSource) {
CompilationUnit cu = createAST(element, cuSource);
if (cu != null) {
PackageDeclaration packDecl = cu.getPackage();
if (packDecl != null) {
return packDecl.getJavadoc();
}
}
return null;
}