本文整理匯總了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());
}