本文整理匯總了Java中com.sun.javadoc.ClassDoc.name方法的典型用法代碼示例。如果您正苦於以下問題:Java ClassDoc.name方法的具體用法?Java ClassDoc.name怎麽用?Java ClassDoc.name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sun.javadoc.ClassDoc
的用法示例。
在下文中一共展示了ClassDoc.name方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: PSItemDoc
import com.sun.javadoc.ClassDoc; //導入方法依賴的package包/類
private PSItemDoc(ClassDoc classDoc) {
this.classDoc = classDoc;
this.name = classDoc.name();
this.description = classDoc.commentText();
this.itemFieldDocs = new ArrayList<>();
this.providerDocs = new ArrayList<>();
List<FieldDoc> allFields = new ArrayList<>();
this.getAllFieldDocs(classDoc, allFields);
for (FieldDoc fieldDoc : allFields) {
PSItemFieldDoc itemFieldDoc = PSItemFieldDoc.build(this, fieldDoc);
if (itemFieldDoc != null) this.itemFieldDocs.add(itemFieldDoc);
}
for (MethodDoc methodDoc : classDoc.methods()) {
PSOperatorDoc providerDoc = PSOperatorDoc.build(classDoc, methodDoc);
if (providerDoc != null) this.providerDocs.add(providerDoc);
}
}
示例2: PSOperatorDoc
import com.sun.javadoc.ClassDoc; //導入方法依賴的package包/類
private PSOperatorDoc(ClassDoc classDoc, MethodDoc methodDoc) {
this.declaringClassDoc = classDoc;
this.methodDoc = methodDoc;
this.description = methodDoc.commentText().replace('\n', ' ');
this.paramDesc = "";
Tag[] paramTags = methodDoc.tags("param");
for (Tag paramTag : paramTags) {
String paraStr = paramTag.text();
String paraName = paraStr.substring(0, paraStr.indexOf(' ')).replace('\n', ' ');;
String paraDesc = paraStr.substring(paraStr.indexOf(' ') + 1).replace('\n', ' ');;
this.paramDesc += "<br> - `" + paraName + "`: " + paraDesc;
}
this.returnType = methodDoc.returnType();
// ParameterizedType returnType = methodDoc.returnType().asParameterizedType();
// this.inputType = returnType.typeArguments()[0];
// this.outputType = returnType.typeArguments()[1];
// this.completeSignature = "Function<" + this.inputType + ", " + this.outputType + "> " + methodDoc.toString();
String shortSignature = classDoc.name() + "." + methodDoc.name() + "(";
boolean firstParameter = true;
for (Parameter parameter : methodDoc.parameters()) {
if (firstParameter) {
shortSignature += Utils.getSimpleTypeName(parameter.type()) + " " + parameter.name();
firstParameter = false;
} else {
shortSignature += ", " + Utils.getSimpleTypeName(parameter.type()) + " " + parameter.name();
}
}
shortSignature += ")";
this.shortSignature = shortSignature;
}
示例3: PSOperatorWrapperDoc
import com.sun.javadoc.ClassDoc; //導入方法依賴的package包/類
private PSOperatorWrapperDoc(ClassDoc classDoc) {
this.classDoc = classDoc;
this.name = classDoc.name();
this.description = classDoc.commentText();
this.operatorDocs = new ArrayList<>();
for (MethodDoc methodDoc : classDoc.methods()) {
PSOperatorDoc operatorDoc = PSOperatorDoc.build(classDoc, methodDoc);
if (operatorDoc != null) this.operatorDocs.add(operatorDoc);
}
}
示例4: instanceOf
import com.sun.javadoc.ClassDoc; //導入方法依賴的package包/類
public static boolean instanceOf(ClassDoc classDoc, String superClassName) {
if (classDoc == null || superClassName == null) return false;
String className = classDoc.containingPackage().name() + "." + classDoc.name();
// System.out.println(className + " " + superClassName);
if (className.startsWith(superClassName)) {
return true;
}
return instanceOf(classDoc.superclass(), superClassName);
}
示例5: forName
import com.sun.javadoc.ClassDoc; //導入方法依賴的package包/類
/**
* Return the path for the simple name of the class.
* For example, if the class is java.lang.Object,
* the path is Object.html.
*/
public static DocPath forName(ClassDoc cd) {
return (cd == null) ? empty : new DocPath(cd.name() + ".html");
}