當前位置: 首頁>>代碼示例>>Java>>正文


Java ClassDoc類代碼示例

本文整理匯總了Java中com.sun.javadoc.ClassDoc的典型用法代碼示例。如果您正苦於以下問題:Java ClassDoc類的具體用法?Java ClassDoc怎麽用?Java ClassDoc使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ClassDoc類屬於com.sun.javadoc包,在下文中一共展示了ClassDoc類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: getInputParams

import com.sun.javadoc.ClassDoc; //導入依賴的package包/類
@Override
protected APIParameter getInputParams(ClassDoc classDoc) {
	if(classDoc.tags(WRMqConsumerTaglet.NAME).length > 0) {
		APIParameter apiParameter = new APIParameter();
		apiParameter.setParameterOccurs(ParameterOccurs.REQUIRED);
		apiParameter.setType(classDoc.qualifiedTypeName());
		apiParameter.setName(classDoc.name());
		HashSet<String> processingClasses = new HashSet<String>();
		apiParameter.setFields(this.getFields(classDoc,
				ParameterType.Request, processingClasses));
		apiParameter.setDescription(classDoc.commentText());
		return apiParameter;
	} else {
		return null;
	}
}
 
開發者ID:WinRoad-NET,項目名稱:wrdocletbase,代碼行數:17,代碼來源:MQDocBuilder.java

示例3: processOpenAPIClasses

import com.sun.javadoc.ClassDoc; //導入依賴的package包/類
@Override
protected void processOpenAPIClasses(ClassDoc[] classes,
		Configuration configuration) {
	for (int i = 0; i < classes.length; i++) {
		if (configuration.nodeprecated
				&& (Util.isDeprecated(classes[i]) || Util
						.isDeprecated(classes[i].containingPackage()))) {
			continue;
		}

		if (this.isServiceInterface(classes[i])) {
			this.processServiceClass(classes[i], configuration);
			MethodDoc[] methods = classes[i].methods();
			for (int l = 0; l < methods.length; l++) {
				if (configuration.nodeprecated
						&& Util.isDeprecated(methods[l])) {
					continue;
				}
				this.processOpenAPIMethod(methods[l], configuration);
			}
		}
	}
}
 
開發者ID:WinRoad-NET,項目名稱:wrdocletbase,代碼行數:24,代碼來源:AbstractServiceDocBuilder.java

示例4: isInStopClasses

import com.sun.javadoc.ClassDoc; //導入依賴的package包/類
protected boolean isInStopClasses(ClassDoc classDoc) {
	String property = ApplicationContextConfig.getStopClasses();
	if (property != null) {
		String[] stopClasses = property.split(",");
		String[] cdParts = classDoc.qualifiedTypeName().split("\\.");
		for (String stopClass : stopClasses) {
			String[] scParts = stopClass.trim().split("\\.");
			if (scParts.length <= cdParts.length) {
				boolean hasDiffPart = false;
				for (int i = 0; i < scParts.length; i++) {
					if (scParts[i].equals("*")) {
						return true;
					} else if (!scParts[i].equalsIgnoreCase(cdParts[i])) {
						hasDiffPart = true;
						break;
					}
				}
				if (scParts.length == cdParts.length && !hasDiffPart) {
					return true;
				}
			}
		}
	}

	return false;
}
 
開發者ID:WinRoad-NET,項目名稱:wrdocletbase,代碼行數:27,代碼來源:AbstractDocBuilder.java

示例5: 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

示例6: isDubboService

import com.sun.javadoc.ClassDoc; //導入依賴的package包/類
protected boolean isDubboService(ClassDoc classDoc) {
	AnnotationDesc[] annotations = classDoc.annotations();
	for (int i = 0; i < annotations.length; i++) {
		if (annotations[i].annotationType().qualifiedTypeName().equals("com.alibaba.dubbo.config.annotation.Service")) {
			AnnotationDesc.ElementValuePair[] elementValuePairs = annotations[i].elementValues();
			for (AnnotationDesc.ElementValuePair elementValuePair : elementValuePairs) {
				if("protocol".equals(elementValuePair.element().name())
						&& "http".equals(protocolMap.get(elementValuePair.value().toString().replace("\"", "")))) {
					return false;
				}
			}
			return true;
		}
	}
	return false;
}
 
開發者ID:WinRoad-NET,項目名稱:wrdocletbase,代碼行數:17,代碼來源:DubboDocBuilder.java

示例7: mergeWith

import com.sun.javadoc.ClassDoc; //導入依賴的package包/類
/**
 * Returns a new Method object that is a legal combination of
 * this Method object and another one.
 *
 * Doing this requires determining the exceptions declared by
 * the combined method, which must be (only) all of the
 * exceptions declared in both old Methods that may thrown in
 * either of them.
 **/
Method mergeWith(Method other) {
    if (!nameAndDescriptor().equals(other.nameAndDescriptor())) {
        throw new AssertionError(
            "attempt to merge method \"" +
            other.nameAndDescriptor() + "\" with \"" +
            nameAndDescriptor());
    }

    List<ClassDoc> legalExceptions = new ArrayList<ClassDoc>();
    collectCompatibleExceptions(
        other.exceptionTypes, exceptionTypes, legalExceptions);
    collectCompatibleExceptions(
        exceptionTypes, other.exceptionTypes, legalExceptions);

    Method merged = clone();
    merged.exceptionTypes =
        legalExceptions.toArray(new ClassDoc[legalExceptions.size()]);

    return merged;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:30,代碼來源:RemoteClass.java

示例8: collectCompatibleExceptions

import com.sun.javadoc.ClassDoc; //導入依賴的package包/類
/**
 * Adds to the supplied list all exceptions in the "froms"
 * array that are subclasses of an exception in the "withs"
 * array.
 **/
private void collectCompatibleExceptions(ClassDoc[] froms,
                                         ClassDoc[] withs,
                                         List<ClassDoc> list)
{
    for (ClassDoc from : froms) {
        if (!list.contains(from)) {
            for (ClassDoc with : withs) {
                if (from.subclassOf(with)) {
                    list.add(from);
                    break;
                }
            }
        }
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:21,代碼來源:RemoteClass.java

示例9: 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

示例10: 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;
    }
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:34,代碼來源:PSOperatorDoc.java

示例11: build

import com.sun.javadoc.ClassDoc; //導入依賴的package包/類
public static PSOperatorDoc build(ClassDoc classDoc, MethodDoc methodDoc) {
    if (methodDoc.isStatic() && methodDoc.isPublic()
            && Utils.instanceOf(methodDoc.returnType().asClassDoc(), Consts.TYPE_FUNCTION)) {
        return new PSOperatorDoc(classDoc, methodDoc);
    }
    return null;
}
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:8,代碼來源:PSOperatorDoc.java

示例12: build

import com.sun.javadoc.ClassDoc; //導入依賴的package包/類
public static PSOperatorWrapperDoc build(ClassDoc classDoc) {
    AnnotationDesc[] annotations = classDoc.annotations();
    for (AnnotationDesc annotation : annotations) {
        AnnotationTypeDoc annotationType = annotation.annotationType();
        if (Consts.OPERATOR_WRAPPER_ANNOTATION.equals(annotationType.toString())) {
            return new PSOperatorWrapperDoc(classDoc);
        }
    }
    return null;
}
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:11,代碼來源:PSOperatorWrapperDoc.java

示例13: build

import com.sun.javadoc.ClassDoc; //導入依賴的package包/類
public static PSPipelineDoc build(ClassDoc classDoc, MethodDoc methodDoc) {
    AnnotationDesc[] annotations = methodDoc.annotations();
    for (AnnotationDesc annotation : annotations) {
        AnnotationTypeDoc annotationType = annotation.annotationType();
        if (Consts.TRANSFORMATION_ANNOTATION.equals(annotationType.toString())) {
            return new PSPipelineDoc(classDoc, methodDoc, annotation, TYPE_TRANSFORMATION);
        }
        else if (Consts.ACTION_ANNOTATION.equals(annotationType.toString())) {
            return new PSPipelineDoc(classDoc, methodDoc, annotation, TYPE_ACTION);
        }
    }
    return null;
}
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:14,代碼來源:PSPipelineDoc.java

示例14: 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

示例15: getAllFieldDocs

import com.sun.javadoc.ClassDoc; //導入依賴的package包/類
private void getAllFieldDocs(ClassDoc classDoc, List<FieldDoc> fieldDocs) {
    if (classDoc.superclass() != null) {
        this.getAllFieldDocs(classDoc.superclass(), fieldDocs);
    }
    if (isValidPSItem(classDoc)) {
        fieldDocs.addAll(Arrays.asList(classDoc.fields()));
    }
}
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:9,代碼來源:PSItemDoc.java


注:本文中的com.sun.javadoc.ClassDoc類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。