本文整理汇总了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;
}