mil.dod.th.word.htm.doclet/src/org/udri/doclet/msword/MSHTMLDoclet.java
private static String generateGenericTypeInfo(Type fulltype,
            boolean isVarArgs) {
        StringBuilder type = new StringBuilder("");
        if (fulltype instanceof WildcardType) {
            // Handle wild cards, i.e., <?>, <? extends java.util.Map>, <? super
            // java.lang.Integer>, etc.
            WildcardType wildCard = (WildcardType) fulltype;
            type.append(wildCard.simpleTypeName());
            Type[] extendsTypes = wildCard.extendsBounds();
            if (extendsTypes.length > 0) {
                type.append(" extends ");
                for (int i = 0; i < extendsTypes.length; i++) {
                    if (i > 0) {
                        type.append(", ");
                    }
                    type.append(generateGenericTypeInfo(extendsTypes[i],
                            isVarArgs));
                }

            }
            Type[] superTypes = wildCard.superBounds();
            if (superTypes.length > 0) {
                type.append(" super ");
                for (int i = 0; i < superTypes.length; i++) {
                    if (i > 0) {
                        type.append(", ");
                    }
                    type.append(generateGenericTypeInfo(superTypes[i],
                            isVarArgs));
                }
            }
        } else if (fulltype instanceof ParameterizedType) {
            // This is a parameterized type, so grab the type name and all of
            // its argument types.
            // Since there can be nested parameterized types, account for that
            // by recursing through this method.
            ParameterizedType paramType = (ParameterizedType) fulltype;
            type.append(paramType.simpleTypeName())
            .append(paramType.dimension()).append("&lt;");
            Type[] args = paramType.typeArguments();
            for (int i = 0; i < args.length; i++) {
                if (i > 0) {
                    type.append(", ");
                }
                type.append(generateGenericTypeInfo(args[i], isVarArgs));
            }
            type.append("&gt;");
        } else {
            // if t's just a regular type, print the unqualified name and
            // dimension.
            type.append(fulltype.typeName());
            if (isVarArgs) {
                type.append("...");
            } else {
                type.append(fulltype.dimension());
            }
        }
        return type.toString();
    }
/**
     * Generate formatted names to handle generic types.
     * 
     * @param fulltype
     *            the fulltype of the parameter, containing the fully qualified
     *            name
     * @param isVarArgs
     *            True if this parameter is variable-length.
     * @return A simplified type name, taking into account wildcards and
     *         parameterized types.
     */
Generate formatted names to handle generic types.

@param fulltype
the fulltype of the parameter, containing the fully qualified
name
@param isVarArgs
True if this parameter is variable-length.
@return A simplified type name, taking into account wildcards and
parameterized types.
Generate formatted names to handle generic types . @param fulltype the fulltype of the parameter containing the fully qualified name @param isVarArgs True if this parameter is variable - length . @return A simplified type name taking into account wildcards and parameterized types .
private static String generateGenericTypeInfo(Type fulltype,
            boolean isVarArgs) {
        StringBuilder type = new StringBuilder("");
        if (fulltype instanceof WildcardType) {
            WildcardType wildCard = (WildcardType) fulltype;
            type.append(wildCard.simpleTypeName());
            Type[] extendsTypes = wildCard.extendsBounds();
            if (extendsTypes.length > 0) {
                type.append(" extends ");
                for (int i = 0; i < extendsTypes.length; i++) {
                    if (i > 0) {
                        type.append(", ");
                    }
                    type.append(generateGenericTypeInfo(extendsTypes[i],
                            isVarArgs));
                }
            }
            Type[] superTypes = wildCard.superBounds();
            if (superTypes.length > 0) {
                type.append(" super ");
                for (int i = 0; i < superTypes.length; i++) {
                    if (i > 0) {
                        type.append(", ");
                    }
                    type.append(generateGenericTypeInfo(superTypes[i],
                            isVarArgs));
                }
            }
        } else if (fulltype instanceof ParameterizedType) {
            ParameterizedType paramType = (ParameterizedType) fulltype;
            type.append(paramType.simpleTypeName())
            .append(paramType.dimension()).append("&lt;");
            Type[] args = paramType.typeArguments();
            for (int i = 0; i < args.length; i++) {
                if (i > 0) {
                    type.append(", ");
                }
                type.append(generateGenericTypeInfo(args[i], isVarArgs));
            }
            type.append("&gt;");
        } else {
            type.append(fulltype.typeName());
            if (isVarArgs) {
                type.append("...");
            } else {
                type.append(fulltype.dimension());
            }
        }
        return type.toString();
    }
private static String generateGenericTypeInfo ( Type fulltype , boolean isVarArgs ) { StringBuilder type = new StringBuilder ( "" ) ; if ( fulltype instanceof WildcardType ) { WildcardType wildCard = ( WildcardType ) fulltype ; type . append ( wildCard . simpleTypeName ( ) ) ; Type [ ] extendsTypes = wildCard . extendsBounds ( ) ; if ( extendsTypes . length > 0 ) { type . append ( " extends " ) ; for ( int i = 0 ; i < extendsTypes . length ; i ++ ) { if ( i > 0 ) { type . append ( ", " ) ; } type . append ( generateGenericTypeInfo ( extendsTypes [ i ] , isVarArgs ) ) ; } } Type [ ] superTypes = wildCard . superBounds ( ) ; if ( superTypes . length > 0 ) { type . append ( " super " ) ; for ( int i = 0 ; i < superTypes . length ; i ++ ) { if ( i > 0 ) { type . append ( ", " ) ; } type . append ( generateGenericTypeInfo ( superTypes [ i ] , isVarArgs ) ) ; } } } else if ( fulltype instanceof ParameterizedType ) { ParameterizedType paramType = ( ParameterizedType ) fulltype ; type . append ( paramType . simpleTypeName ( ) ) . append ( paramType . dimension ( ) ) . append ( "&lt;" ) ; Type [ ] args = paramType . typeArguments ( ) ; for ( int i = 0 ; i < args . length ; i ++ ) { if ( i > 0 ) { type . append ( ", " ) ; } type . append ( generateGenericTypeInfo ( args [ i ] , isVarArgs ) ) ; } type . append ( "&gt;" ) ; } else { type . append ( fulltype . typeName ( ) ) ; if ( isVarArgs ) { type . append ( "..." ) ; } else { type . append ( fulltype . dimension ( ) ) ; } } return type . toString ( ) ; }
Generate formatted names to handle generic types.
Generate formatted names to handle generic types .
// Handle wild cards, i.e., <?>, <? extends java.util.Map>, <? super // java.lang.Integer>, etc. // This is a parameterized type, so grab the type name and all of // its argument types. // Since there can be nested parameterized types, account for that // by recursing through this method. // if t's just a regular type, print the unqualified name and // dimension.