Search in sources :

Example 1 with WildcardType

use of com.sun.javadoc.WildcardType in project com.revolsys.open by revolsys.

the class DocletUtil method typeNameLink.

public static void typeNameLink(final XmlWriter writer, final Type type) {
    if (type instanceof WildcardType) {
        final WildcardType wildCard = (WildcardType) type;
        writer.text("?");
        final Type[] extendsBounds = wildCard.extendsBounds();
        if (extendsBounds.length > 0) {
            writer.text(" extends ");
            for (int i = 0; i < extendsBounds.length; i++) {
                if (i > 0) {
                    writer.text(", ");
                }
                final Type extendsType = extendsBounds[i];
                typeNameLink(writer, extendsType);
            }
        }
    } else {
        final String qualifiedTypeName = type.qualifiedTypeName();
        final String externalLink = getExternalUrl(qualifiedTypeName);
        final boolean included = isTypeIncluded(type);
        if (externalLink != null) {
            HtmlUtil.serializeA(writer, "", externalLink, type.typeName());
        } else if (included) {
            final String url = "#" + qualifiedTypeName;
            HtmlUtil.serializeA(writer, "", url, type.typeName());
        } else {
            writer.text(qualifiedTypeName);
        }
        if (type instanceof ParameterizedType) {
            final ParameterizedType parameterizedType = (ParameterizedType) type;
            final Type[] typeArguments = parameterizedType.typeArguments();
            if (typeArguments.length > 0) {
                writer.text("<");
                for (int i = 0; i < typeArguments.length; i++) {
                    if (i > 0) {
                        writer.text(", ");
                    }
                    final Type typeParameter = typeArguments[i];
                    typeNameLink(writer, typeParameter);
                }
                writer.text(">");
            }
        }
    }
    writer.text(type.dimension());
}
Also used : ParameterizedType(com.sun.javadoc.ParameterizedType) WildcardType(com.sun.javadoc.WildcardType) Type(com.sun.javadoc.Type) ParameterizedType(com.sun.javadoc.ParameterizedType) WildcardType(com.sun.javadoc.WildcardType)

Aggregations

ParameterizedType (com.sun.javadoc.ParameterizedType)1 Type (com.sun.javadoc.Type)1 WildcardType (com.sun.javadoc.WildcardType)1