|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.wasync.util.TypeResolver
public final class TypeResolver
Enhanced type resolution utilities. Based on org.springframework.core.GenericTypeResolver.
| Nested Class Summary | |
|---|---|
static class |
TypeResolver.Unknown
An unknown type. |
| Method Summary | ||
|---|---|---|
static void |
disableCache()
Disables the internal caching of TypeVariables. |
|
static void |
enableCache()
Enables the internal caching of TypeVariables. |
|
static
|
resolveArgument(Class<I> initialType,
Class<T> targetType)
Returns the raw class representing the type argument for the targetType resolved
upwards from the initialType. |
|
static Class<?> |
resolveArgument(Type genericType,
Class<?> targetType)
Resolves the type argument for the genericType using type variable information from the
sourceType. |
|
static
|
resolveArguments(Class<I> initialType,
Class<T> targetType)
Returns an array of raw classes representing type arguments for the targetType resolved
upwards from the initialType. |
|
static Class<?>[] |
resolveArguments(Type genericType,
Class<?> targetType)
Resolves the arguments for the genericType using the type variable information for the
targetType. |
|
static Type |
resolveBound(TypeVariable<?> typeVariable)
Resolves the first bound for the typeVariable, returning Unknown.class if none
can be resolved. |
|
static Class<?> |
resolveClass(Type genericType,
Class<?> targetType)
Resolves the raw class for the given genericType, using the type variable information
from the targetType. |
|
static Type |
resolveGenericType(Type initialType,
Class<?> targetType)
Resolves the generic Type for the targetType by walking the type hierarchy upwards from
the initialType. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void enableCache()
public static void disableCache()
public static <T,I extends T> Class<?> resolveArgument(Class<I> initialType,
Class<T> targetType)
targetType resolved
upwards from the initialType. If no arguments can be resolved then
Unknown.class is returned.
initialType - to resolve upwards fromtargetType - to resolve arguments for
initialType else null if no type arguments are
declared
IllegalArgumentException - if more or less than one type argument is resolved for the
give types
public static Class<?> resolveArgument(Type genericType,
Class<?> targetType)
genericType using type variable information from the
sourceType. If genericType is an instance of class, then genericType is
returned. If no arguments can be resolved then Unknown.class is returned.
genericType - to resolve upwards fromtargetType - to resolve arguments for
initialType else null if no type arguments are
declared
IllegalArgumentException - if more or less than one type argument is resolved for the
give types
public static <T,I extends T> Class<?>[] resolveArguments(Class<I> initialType,
Class<T> targetType)
targetType resolved
upwards from the initialType. Arguments for targetType that cannot be resolved
to a Class are returned as Unknown.class. If no arguments can be resolved then
null is returned.
initialType - to resolve upwards fromtargetType - to resolve arguments for
initialType else
null if no type arguments are declared
public static Class<?>[] resolveArguments(Type genericType,
Class<?> targetType)
genericType using the type variable information for the
targetType. Returns null if genericType is not parameterized or if
arguments cannot be resolved.
public static Type resolveGenericType(Type initialType,
Class<?> targetType)
targetType by walking the type hierarchy upwards from
the initialType.
public static Class<?> resolveClass(Type genericType,
Class<?> targetType)
genericType, using the type variable information
from the targetType.
public static Type resolveBound(TypeVariable<?> typeVariable)
typeVariable, returning Unknown.class if none
can be resolved.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||