com.sun.javadoc.ParameterizedType Java Examples

The following examples show how to use com.sun.javadoc.ParameterizedType. 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: Utils.java    From PrivacyStreams with Apache License 2.0 6 votes vote down vote up
public static String getSimpleTypeName(Type type) {
    if (type instanceof ParameterizedType) {
        String typeName = type.typeName() + "<";
        boolean firstParameter = true;
        for (Type parameter : ((ParameterizedType) type).typeArguments()) {
            if (firstParameter) {
                typeName += getSimpleTypeName(parameter);
                firstParameter = false;
            }
            else {
                typeName += "," + getSimpleTypeName(parameter);
            }
        }
        typeName += ">";
        return typeName;
    }
    return type.typeName();
}
 
Example #2
Source File: Parser.java    From xml-doclet with Apache License 2.0 6 votes vote down vote up
protected TypeInfo parseTypeInfo(Type type) {
	TypeInfo typeInfoNode = objectFactory.createTypeInfo();
	typeInfoNode.setQualified(type.qualifiedTypeName());
	String dimension = type.dimension();
	if (dimension.length() > 0) {
		typeInfoNode.setDimension(dimension);
	}

	WildcardType wildcard = type.asWildcardType();
	if (wildcard != null) {
		typeInfoNode.setWildcard(parseWildcard(wildcard));
	}

	ParameterizedType parameterized = type.asParameterizedType();
	if (parameterized != null) {
		for (Type typeArgument : parameterized.typeArguments()) {
			typeInfoNode.getGeneric().add(parseTypeInfo(typeArgument));
		}
	}

	return typeInfoNode;
}
 
Example #3
Source File: SarlLinkFactory.java    From sarl with Apache License 2.0 5 votes vote down vote up
/** Create the label for a procedure lambda.
 *
 * @param linkInfo the type.
 * @return the label.
 */
protected Content createProcedureLambdaLabel(LinkInfoImpl linkInfo) {
	final ParameterizedType type = linkInfo.type.asParameterizedType();
	if (type != null) {
		final Type[] arguments = type.typeArguments();
		if (arguments != null && arguments.length > 0) {
			return createLambdaLabel(linkInfo, arguments, arguments.length);
		}
	}
	return linkInfo.label;
}
 
Example #4
Source File: SarlLinkFactory.java    From sarl with Apache License 2.0 5 votes vote down vote up
/** Create the label for a function lambda.
 *
 * @param linkInfo the type.
 * @return the label.
 */
protected Content createFunctionLambdaLabel(LinkInfoImpl linkInfo) {
	final ParameterizedType type = linkInfo.type.asParameterizedType();
	if (type != null) {
		final Type[] arguments = type.typeArguments();
		if (arguments != null && arguments.length > 0) {
			return createLambdaLabel(linkInfo, arguments, arguments.length - 1);
		}
	}
	return linkInfo.label;
}
 
Example #5
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public ParameterizedType asParameterizedType() {
	return this.delegate.asParameterizedType();
}
 
Example #6
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public ParameterizedType asParameterizedType() {
	return this.delegate.asParameterizedType();
}