当前位置: 首页>>代码示例>>Java>>正文


Java ClassDoc.methods方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:PrivacyStreams,项目名称:PrivacyStreams,代码行数:21,代码来源:PSItemDoc.java

示例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);
	}
}
 
开发者ID:WinRoad-NET,项目名称:wrdocletbase,代码行数:27,代码来源:AbstractServiceDocBuilder.java

示例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;
}
 
开发者ID:WinRoad-NET,项目名称:wrdocletbase,代码行数:27,代码来源:DubboDocBuilder.java

示例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]);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:22,代码来源:UnitTestDoclet.java

示例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);
    }
}
 
开发者ID:PrivacyStreams,项目名称:PrivacyStreams,代码行数:12,代码来源:PSOperatorWrapperDoc.java

示例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;
}
 
开发者ID:PrivacyStreams,项目名称:PrivacyStreams,代码行数:28,代码来源:PSDoclet.java

示例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;
}
 
开发者ID:treeleafj,项目名称:xDoc,代码行数:37,代码来源:SunDocHandler.java


注:本文中的com.sun.javadoc.ClassDoc.methods方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。