本文整理汇总了Java中com.sun.javadoc.Doc.commentText方法的典型用法代码示例。如果您正苦于以下问题:Java Doc.commentText方法的具体用法?Java Doc.commentText怎么用?Java Doc.commentText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.javadoc.Doc
的用法示例。
在下文中一共展示了Doc.commentText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toComment
import com.sun.javadoc.Doc; //导入方法依赖的package包/类
/**
* Transforms comments on the Doc object into XML.
*
* @param doc The Doc object.
* @param node The node to add the comment nodes to.
*/
private static XMLNode toComment(Doc doc) {
if (doc.commentText() == null || doc.commentText().length() == 0) return null;
XMLNode node = new XMLNode("comment", doc, doc.position().line());
StringBuilder comment = new StringBuilder();
// Analyse each token and produce comment node
for (Tag t : doc.inlineTags()) {
Taglet taglet = options.getTagletForName(t.name());
if (taglet != null) {
comment.append(taglet.toString(t));
} else {
comment.append(t.text());
}
}
return node.text(comment.toString());
}
示例2: toComment
import com.sun.javadoc.Doc; //导入方法依赖的package包/类
/**
* Transforms comments on the Doc object into XML.
*
* @param doc The Doc object.
* @param node The node to add the comment nodes to.
*/
private static XMLNode toComment(Doc doc) {
if (doc.commentText() == null || doc.commentText().length() == 0) return null;
XMLNode node = new XMLNode("comment", doc, doc.position().line());
StringBuilder comment = new StringBuilder();
// Analyse each token and produce comment node
for (Tag t : doc.inlineTags()) {
Taglet taglet = options.getTagletForName(t.name());
if (taglet != null) comment.append(taglet.toString(t));
else comment.append(t.text());
}
return node.text(comment.toString());
}
示例3: toShortComment
import com.sun.javadoc.Doc; //导入方法依赖的package包/类
/**
* Transforms short comments on the Doc object into XML.
*
* @param doc The Doc object.
* @param node The node to add the comment nodes to.
*/
private static XMLNode toShortComment(Doc doc) {
if (doc.commentText() == null || doc.commentText().length() == 0) return null;
XMLNode node = new XMLNode("shortComment", doc, doc.position().line());
StringBuilder comment = new StringBuilder();
// Analyse each token and produce comment node
for (Tag t : doc.firstSentenceTags()) {
Taglet taglet = options.getTagletForName(t.name());
if (taglet != null) comment.append(taglet.toString(t));
else comment.append(t.text());
}
return node.text(comment.toString());
}