本文整理汇总了Java中com.sun.javadoc.ClassDoc.methods方法的典型用法代码示例。如果您正苦于以下问题:Java ClassDoc.methods方法的具体用法?Java ClassDoc.methods怎么用?Java ClassDoc.methods使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.javadoc.ClassDoc
的用法示例。
在下文中一共展示了ClassDoc.methods方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: processServiceClass
import com.sun.javadoc.ClassDoc; //导入方法依赖的package包/类
protected void processServiceClass(ClassDoc service,
Configuration configuration) {
Tag[] serviceTagArray = service.tags(WRTagTaglet.NAME);
for (int i = 0; i < serviceTagArray.length; i++) {
Set<String> serviceTags = WRTagTaglet.getTagSet(serviceTagArray[i]
.text());
for (Iterator<String> iter = serviceTags.iterator(); iter.hasNext();) {
String tag = iter.next();
if (!this.taggedOpenAPIMethods.containsKey(tag)) {
this.taggedOpenAPIMethods
.put(tag, new HashSet<MethodDoc>());
}
// all method of this service should be processed later.
for (int j = 0; j < service.methods().length; j++) {
if (configuration.nodeprecated
&& Util.isDeprecated(service.methods()[j])) {
continue;
}
this.taggedOpenAPIMethods.get(tag)
.add(service.methods()[j]);
}
}
this.wrDoc.getWRTags().addAll(serviceTags);
}
}
示例3: processAnnotationDubboInterfaces
import com.sun.javadoc.ClassDoc; //导入方法依赖的package包/类
protected LinkedList<String> processAnnotationDubboInterfaces(ClassDoc[] classes) {
LinkedList<String> result = new LinkedList<String>();
for (int i = 0; i < classes.length; i++) {
// implementation class which used com.alibaba.dubbo.config.annotation.Service
if(isDubboService(classes[i])) {
for(ClassDoc interfaceClassDoc : classes[i].interfaces()) {
result.add(interfaceClassDoc.qualifiedName());
// mapping the method in interface to the method in implementation class
for(MethodDoc implMethodDoc : classes[i].methods()) {
MethodDoc overriddenMethod = implMethodDoc.overriddenMethod();
if(overriddenMethod != null) {
methodMap.put(overriddenMethod, implMethodDoc);
} else {
//It seems that MethodDoc.overriddenMethod() doesn't work, but MethodDoc.overrides() works fine.
for(MethodDoc interfaceMethodDoc : interfaceClassDoc.methods()) {
if(implMethodDoc.overrides(interfaceMethodDoc)) {
methodMap.put(interfaceMethodDoc, implMethodDoc);
}
}
}
}
}
}
}
return result;
}
示例4: getTestMethods
import com.sun.javadoc.ClassDoc; //导入方法依赖的package包/类
/**
* Returns an array containing all of the "test" methods (including those that are inherited) for
* the given class.
*/
private static MethodDoc[] getTestMethods(ClassDoc c) {
Set set = new TreeSet();
while (c != null) {
MethodDoc[] methods = c.methods();
for (int i = 0; i < methods.length; i++) {
MethodDoc method = methods[i];
if (method.isPublic() && method.parameters().length == 0
&& method.name().startsWith("test")) {
set.add(method);
}
}
c = c.superclass();
}
return (MethodDoc[]) set.toArray(new MethodDoc[0]);
}
示例5: 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);
}
}
示例6: build
import com.sun.javadoc.ClassDoc; //导入方法依赖的package包/类
private boolean build(RootDoc rootDoc) {
this.readOptions(rootDoc.options());
ClassDoc[] classes = rootDoc.classes();
for (int i = 0; i < classes.length; ++i) {
ClassDoc classDoc = classes[i];
PSItemDoc itemDoc = PSItemDoc.build(classDoc);
if (itemDoc != null) this.psItems.add(itemDoc);
PSOperatorWrapperDoc operatorWrapperDoc = PSOperatorWrapperDoc.build(classDoc);
if (operatorWrapperDoc != null) this.psOperatorWrappers.add(operatorWrapperDoc);
if (Utils.instanceOf(classDoc, Consts.TYPE_P_STREAM)) {
for (MethodDoc methodDoc : classDoc.methods()) {
PSPipelineDoc pipelineDoc = PSPipelineDoc.build(classDoc, methodDoc);
if (pipelineDoc != null) {
this.psPipelines.add(pipelineDoc);
}
}
}
}
this.dump();
return true;
}
示例7: start
import com.sun.javadoc.ClassDoc; //导入方法依赖的package包/类
public static boolean start(RootDoc root) throws ClassNotFoundException, NoSuchMethodException {
ClassDoc[] classDocs = root.classes();
List<ApiModule> apiModules = new LinkedList<>();
for (int i = 0; i < classDocs.length; i++) {
ClassDoc aClass = classDocs[i];
Class<?> moduleType = Class.forName(aClass.qualifiedTypeName());
ClassFilter classFilter = ClassFilterFactory.getDefaultFilter();
if (!classFilter.filter(moduleType)) {
continue;
}
ApiModule apiModule = new ApiModule();
apiModule.setType(moduleType);
apiModule.setComment(aClass.commentText());
MethodDoc[] methods = aClass.methods(false);
for (MethodDoc method : methods) {
Class[] paramTypes = paramTypes(method);
Method m = moduleType.getDeclaredMethod(method.name(), paramTypes);
DocTags docTags = SunDocUtils.getDocsForTag(method);
ApiAction apiAction = new ApiAction();
apiAction.setComment(method.commentText());
apiAction.setName(method.name());
apiAction.setDocTags(docTags);
apiAction.setMethod(m);
apiModule.getApiActions().add(apiAction);
}
apiModules.add(apiModule);
}
ApiModulesHolder.setCurrentApiModules(apiModules);//设置当前的解析结果
return true;
}