Java Code Examples for com.sun.javadoc.ClassDoc#interfaceTypes()

The following examples show how to use com.sun.javadoc.ClassDoc#interfaceTypes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Parser.java    From xml-doclet with Apache License 2.0 5 votes vote down vote up
protected Enum parseEnum(ClassDoc classDoc) {
	Enum enumNode = objectFactory.createEnum();
	enumNode.setName(classDoc.name());
	enumNode.setQualified(classDoc.qualifiedName());
	String comment = classDoc.commentText();
	if (comment.length() > 0) {
		enumNode.setComment(comment);
	}
	enumNode.setIncluded(classDoc.isIncluded());
	enumNode.setScope(parseScope(classDoc));

	Type superClassType = classDoc.superclassType();
	if (superClassType != null) {
		enumNode.setClazz(parseTypeInfo(superClassType));
	}

	for (Type interfaceType : classDoc.interfaceTypes()) {
		enumNode.getInterface().add(parseTypeInfo(interfaceType));
	}

	for (FieldDoc field : classDoc.enumConstants()) {
		enumNode.getConstant().add(parseEnumConstant(field));
	}

	for (AnnotationDesc annotationDesc : classDoc.annotations()) {
		enumNode.getAnnotation().add(parseAnnotationDesc(annotationDesc, classDoc.qualifiedName()));
	}

	for (Tag tag : classDoc.tags()) {
		enumNode.getTag().add(parseTag(tag));
	}

	return enumNode;
}
 
Example 2
Source File: Parser.java    From xml-doclet with Apache License 2.0 5 votes vote down vote up
protected Interface parseInterface(ClassDoc classDoc) {

		Interface interfaceNode = objectFactory.createInterface();
		interfaceNode.setName(classDoc.name());
		interfaceNode.setQualified(classDoc.qualifiedName());
		String comment = classDoc.commentText();
		if (comment.length() > 0) {
			interfaceNode.setComment(comment);
		}
		interfaceNode.setIncluded(classDoc.isIncluded());
		interfaceNode.setScope(parseScope(classDoc));

		for (TypeVariable typeVariable : classDoc.typeParameters()) {
			interfaceNode.getGeneric().add(parseTypeParameter(typeVariable));
		}

		for (Type interfaceType : classDoc.interfaceTypes()) {
			interfaceNode.getInterface().add(parseTypeInfo(interfaceType));
		}

		for (MethodDoc method : classDoc.methods()) {
			interfaceNode.getMethod().add(parseMethod(method));
		}

		for (AnnotationDesc annotationDesc : classDoc.annotations()) {
			interfaceNode.getAnnotation().add(parseAnnotationDesc(annotationDesc, classDoc.qualifiedName()));
		}

		for (Tag tag : classDoc.tags()) {
			interfaceNode.getTag().add(parseTag(tag));
		}

		for (FieldDoc field : classDoc.fields()) {
			interfaceNode.getField().add(parseField(field));
		}

		return interfaceNode;
	}
 
Example 3
Source File: Parser.java    From xml-doclet with Apache License 2.0 4 votes vote down vote up
protected Class parseClass(ClassDoc classDoc) {

		Class classNode = objectFactory.createClass();
		classNode.setName(classDoc.name());
		classNode.setQualified(classDoc.qualifiedName());
		String comment = classDoc.commentText();
		if (comment.length() > 0) {
			classNode.setComment(comment);
		}
		classNode.setAbstract(classDoc.isAbstract());
		classNode.setError(classDoc.isError());
		classNode.setException(classDoc.isException());
		classNode.setExternalizable(classDoc.isExternalizable());
		classNode.setIncluded(classDoc.isIncluded());
		classNode.setSerializable(classDoc.isSerializable());
		classNode.setScope(parseScope(classDoc));

		for (TypeVariable typeVariable : classDoc.typeParameters()) {
			classNode.getGeneric().add(parseTypeParameter(typeVariable));
		}

		Type superClassType = classDoc.superclassType();
		if (superClassType != null) {
			classNode.setClazz(parseTypeInfo(superClassType));
		}

		for (Type interfaceType : classDoc.interfaceTypes()) {
			classNode.getInterface().add(parseTypeInfo(interfaceType));
		}

		for (MethodDoc method : classDoc.methods()) {
			classNode.getMethod().add(parseMethod(method));
		}

		for (AnnotationDesc annotationDesc : classDoc.annotations()) {
			classNode.getAnnotation().add(parseAnnotationDesc(annotationDesc, classDoc.qualifiedName()));
		}

		for (ConstructorDoc constructor : classDoc.constructors()) {
			classNode.getConstructor().add(parseConstructor(constructor));
		}

		for (FieldDoc field : classDoc.fields()) {
			classNode.getField().add(parseField(field));
		}

		for (Tag tag : classDoc.tags()) {
			classNode.getTag().add(parseTag(tag));
		}

		return classNode;
	}