public abstract class TypeFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static Type<Object> |
TYPE_OF_OBJECT
The Type instance which represents the Object class
|
| Modifier and Type | Method and Description |
|---|---|
static String |
nameOf(Type type,
Type associatedType)
Gets the name for a type, using the Simple name when the type does not
match the associated type, but using fully-qualified name when the associated
type has a matching simple name, but is not the same.
|
static <T> Type<T> |
resolveValueOf(Class<T> type,
Type<?> referenceType)
Resolve the Type for the given Class, using the provided referenceType to
resolve the actual type arguments.
|
static <T> Type<T> |
resolveValueOf(ParameterizedType type,
Type<?> referenceType)
Resolve the Type for the given ParameterizedType, using the provided
referenceType to resolve any unresolved actual type arguments.
|
static <E> Type<E> |
valueOf(Class<E> rawType)
Resolves the Type value of the specified raw Class type
|
static <E> Type<E> |
valueOf(Class<E> rawType,
Type... actualTypeArguments)
Resolve the Type value of the given raw Class type, filling the type
parameters with the provided actual type arguments
|
static <T> Type<T> |
valueOf(ParameterizedType type)
Return the Type for the given ParameterizedType, resolving actual type
arguments where possible.
|
static Type<?> |
valueOf(String typeDescriptor)
Constructs a nested type from a string description of that type; allows for package names
to be omitted for 'java.lang' and 'java.util' classes.
|
static <T> Type<T> |
valueOf(Type type)
Return the Type for the given java.lang.reflect.Type, either for a
ParameterizedType or a Class instance
|
static <T> Type<T> |
valueOf(Type<T> type)
This method declaration helps to shortcut the other methods for
ParameterizedType which it extends; we just return it.
|
static <T> Type<T> |
valueOf(TypeVariable<?> var)
Finds the Type value of the given TypeVariable
|
static <T> Type<T> |
valueOf(WildcardType var)
Finds the Type value of the given wildcard type
|
public static <E> Type<E> valueOf(Class<E> rawType)
rawType - public static Type<?> valueOf(String typeDescriptor)
typeDescriptor - a string representation of the java declaration of a generic typepublic static <E> Type<E> valueOf(Class<E> rawType, Type... actualTypeArguments)
rawType - actualTypeArguments - public static <T> Type<T> valueOf(Type<T> type)
type - public static <T> Type<T> valueOf(ParameterizedType type)
type - public static <T> Type<T> valueOf(TypeVariable<?> var)
var - public static <T> Type<T> valueOf(WildcardType var)
var - public static <T> Type<T> valueOf(Type type)
type - public static <T> Type<T> resolveValueOf(ParameterizedType type, Type<?> referenceType)
type - referenceType - public static <T> Type<T> resolveValueOf(Class<T> type, Type<?> referenceType)
type - referenceType - public static String nameOf(Type type, Type associatedType)
type - the type for which to return the nameassociatedType - the associated type, used to decide the level of detail
required in the returned nameCopyright © 2019 Glasnost. All rights reserved.