本文整理汇总了Java中com.sun.tools.javac.tree.DocCommentTable类的典型用法代码示例。如果您正苦于以下问题:Java DocCommentTable类的具体用法?Java DocCommentTable怎么用?Java DocCommentTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DocCommentTable类属于com.sun.tools.javac.tree包,在下文中一共展示了DocCommentTable类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attach
import com.sun.tools.javac.tree.DocCommentTable; //导入依赖的package包/类
static void attach(final JCTree node, String docCommentContent, Object map_) {
final String docCommentContent_ = docCommentContent;
((DocCommentTable) map_).putComment(node, new Comment() {
@Override public String getText() {
return docCommentContent_;
}
@Override public int getSourcePos(int index) {
return -1;
}
@Override public CommentStyle getStyle() {
return CommentStyle.JAVADOC;
}
@Override public boolean isDeprecated() {
return JavacHandlerUtil.nodeHasDeprecatedFlag(node);
}
});
}
示例2: PrettyPrinter
import com.sun.tools.javac.tree.DocCommentTable; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
public PrettyPrinter(Writer out, JCCompilationUnit cu, List<CommentInfo> comments, FormatPreferences preferences) {
this.out = out;
this.comments = comments;
this.compilationUnit = cu;
this.formatPreferences = preferences;
/* load doc comments */ {
Object dc = getDocComments(compilationUnit);
if (dc instanceof Map<?, ?>) {
this.docComments = (Map) dc;
this.docTable = null;
} else if (dc instanceof DocCommentTable) {
this.docComments = null;
this.docTable = (DocCommentTable) dc;
} else {
this.docComments = null;
this.docTable = null;
}
}
}
示例3: copyJavadoc
import com.sun.tools.javac.tree.DocCommentTable; //导入依赖的package包/类
static void copyJavadoc(JavacNode from, JCTree to, CopyJavadoc copyMode, Object dc) {
DocCommentTable dct = (DocCommentTable) dc;
Comment javadoc = dct.getComment(from.get());
if (javadoc != null) {
String[] filtered = copyMode.split(javadoc.getText());
if (copyMode == CopyJavadoc.SETTER && shouldReturnThis(from)) {
filtered[0] = addReturnsThisIfNeeded(filtered[0]);
}
dct.putComment(to, createJavadocComment(filtered[0], from));
dct.putComment(from.get(), createJavadocComment(filtered[1], from));
}
}
示例4: loadDocCommentsTable
import com.sun.tools.javac.tree.DocCommentTable; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void loadDocCommentsTable(Object dc) {
if (dc instanceof Map<?, ?>) this.docComments = (Map) dc;
else if (dc instanceof DocCommentTable) this.docTable = (DocCommentTable) dc;
}