本文整理匯總了Java中com.sun.javadoc.MethodDoc.commentText方法的典型用法代碼示例。如果您正苦於以下問題:Java MethodDoc.commentText方法的具體用法?Java MethodDoc.commentText怎麽用?Java MethodDoc.commentText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sun.javadoc.MethodDoc
的用法示例。
在下文中一共展示了MethodDoc.commentText方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: fromMethodDoc
import com.sun.javadoc.MethodDoc; //導入方法依賴的package包/類
public static MethodDocumentation fromMethodDoc(MethodDoc methodDoc) {
MethodDocumentation md = new MethodDocumentation();
md.comment = methodDoc.commentText();
for (Tag tag : methodDoc.tags()) {
if (tag instanceof ParamTag) {
ParamTag paramTag = (ParamTag) tag;
md.parameters.put(paramTag.parameterName(), paramTag.parameterComment());
} else {
md.tags.put(cleanupTagName(tag.name()), tag.text());
}
}
return md;
}
示例2: getDocText
import com.sun.javadoc.MethodDoc; //導入方法依賴的package包/類
private static String getDocText(MethodDoc method, RootDoc root) {
if (method.commentText() != null && !method.commentText().equals("")) {
return method.commentText();
}
String docText = method.getRawCommentText();
if (docText != null && docText.contains("@see")) {
String classMethodName = docText.replace("@see", "").replace("\n", "").replace(" ", "");
String className = classMethodName.substring(0, classMethodName.indexOf("#"));
String methodName = classMethodName.substring(classMethodName.indexOf("#") + 1).replace("()", "");
ClassDoc classDoc = root.classNamed(className);
if (classDoc == null) {
System.err.println("warning - Comment on "
+ method.toString()
+ " does not have valid fully qualified "
+ "method in @see annotation.\n"
+ docText);
return "";
}
MethodDoc methodDoc = getNoParamMethodFromClassDocByName(classDoc, methodName);
return methodDoc.commentText();
}
return "";
}
示例3: fromMethodDoc
import com.sun.javadoc.MethodDoc; //導入方法依賴的package包/類
static ElementData fromMethodDoc(MethodDoc methodDoc) {
ElementData data = new ElementData();
data.name = sanitizeName(methodDoc.name(), ELEMENT_PREFIXES);
data.description = methodDoc.commentText();
return data;
}