Example usage for java.lang.reflect ParameterizedType toString

List of usage examples for java.lang.reflect ParameterizedType toString

Introduction

In this page you can find the example usage for java.lang.reflect ParameterizedType toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:com.link_intersystems.lang.reflect.TypeVariableToStringTransformer.java

private String parameterizedTypeToString(ParameterizedType parameterizedType) {
    return parameterizedType.toString();
}

From source file:org.ocelotds.dashboard.services.ServiceToolsTest.java

/**
 * Test of getLiteralType method, of class ServiceTools.
 *//*from w  w  w.  jav a2 s  .  c o m*/
@Test
public void testGetLiteralParameterizedType() {
    System.out.println("getLiteralType");
    String expResult = "java.lang.Collection<java.lang.Map<java.lang.String, java.lang.Collection<java.lang.Integer>>>";
    ParameterizedType type = mock(ParameterizedType.class);
    when(type.toString()).thenReturn(expResult);
    String result = instance.getLiteralType(type);
    assertThat(result).isEqualTo(expResult);
}

From source file:org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.java

private String getTypeName(Type type) {
    String typeName = null;// www  . j  a v a 2 s .c o m
    if (type instanceof Class) {
        Class classType = (Class) type;
        if (classType.isArray()) {
            typeName = getTypeName(classType.getComponentType()) + "[]";
        } else {
            typeName = classType.getName();
        }
    } else if (type instanceof ParameterizedType) {
        ParameterizedType parameterizedType = (ParameterizedType) type;
        typeName = parameterizedType.toString();
    }

    return typeName;
}