final String basePackageName = BindingMapping.getRootPackageName(module.getQNameModule());
final JavaTypeName identifier = JavaTypeName.create(BindingGeneratorUtil.packageNameForGeneratedType(basePackageName,
identity.getPath()), BindingMapping.getClassName(identity.getQName()));
- final Type paramType = Types.wildcardTypeFor(identifier);
- return Types.parameterizedTypeFor(Types.typeForClass(Class.class), paramType);
+ return Types.classType(Types.wildcardTypeFor(identifier));
}
/**
public static final ConcreteType BYTE_ARRAY = typeForClass(byte[].class);
public static final ConcreteType CHAR_ARRAY = typeForClass(char[].class);
+ private static final ConcreteType CLASS = typeForClass(Class.class);
private static final ConcreteType OBJECT = typeForClass(Object.class);
private static final ConcreteType PRIMITIVE_VOID = typeForClass(void.class);
private static final ConcreteType SERIALIZABLE = typeForClass(Serializable.class);
private Types() {
}
+ /**
+ * Returns an instance of {@link ParameterizedType} which represents JAVA <code>java.lang.Class</code> type
+ * specialized to specified type.
+ *
+ * @param type Type for which to specialize
+ * @return A parameterized type corresponding to {@code Class<Type>}
+ * @throws NullPointerException if {@code type} is null
+ */
+ public static ParameterizedType classType(final Type type) {
+ return parameterizedTypeFor(CLASS, type);
+ }
+
/**
* Returns an instance of {@link ConcreteType} which represents JAVA <code>java.lang.Void</code> type.
*