|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.core.GenericTypeResolver
public abstract class GenericTypeResolver
Helper class for resolving generic types against type variables.
Mainly intended for usage within the framework, resolving method parameter types even when they are declared generically.
GenericCollectionTypeResolver
Constructor Summary | |
---|---|
GenericTypeResolver()
|
Method Summary | |
---|---|
static Type |
getTargetType(MethodParameter methodParam)
Determine the target type for the given parameter specification. |
static Map<TypeVariable,Type> |
getTypeVariableMap(Class clazz)
Build a mapping of TypeVariable names to concrete
Class for the specified Class . |
static Class<?> |
resolveParameterType(MethodParameter methodParam,
Class clazz)
Determine the target type for the given generic parameter type. |
static Class<?> |
resolveReturnType(Method method,
Class clazz)
Determine the target type for the generic return type of the given method. |
static Class<?> |
resolveType(Type genericType,
Map<TypeVariable,Type> typeVariableMap)
Resolve the specified generic type against the given TypeVariable map. |
static Class<?> |
resolveTypeArgument(Class clazz,
Class genericIfc)
Resolve the single type argument of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare a concrete type for its type variable. |
static Class[] |
resolveTypeArguments(Class clazz,
Class genericIfc)
Resolve the type arguments of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare concrete types for its type variables. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericTypeResolver()
Method Detail |
---|
public static Type getTargetType(MethodParameter methodParam)
methodParam
- the method parameter specification
public static Class<?> resolveParameterType(MethodParameter methodParam, Class clazz)
methodParam
- the method parameter specificationclazz
- the class to resolve type variables against
public static Class<?> resolveReturnType(Method method, Class clazz)
method
- the method to introspectclazz
- the class to resolve type variables against
public static Class<?> resolveTypeArgument(Class clazz, Class genericIfc)
clazz
- the target class to check againstgenericIfc
- the generic interface or superclass to resolve the type argument from
null
if not resolvablepublic static Class[] resolveTypeArguments(Class clazz, Class genericIfc)
clazz
- the target class to check againstgenericIfc
- the generic interface or superclass to resolve the type argument from
null
if not resolvablepublic static Class<?> resolveType(Type genericType, Map<TypeVariable,Type> typeVariableMap)
genericType
- the generic type to resolvetypeVariableMap
- the TypeVariable Map to resolved against
Object.class
otherwisepublic static Map<TypeVariable,Type> getTypeVariableMap(Class clazz)
TypeVariable names
to concrete
Class
for the specified Class
. Searches all super types,
enclosing types and interfaces.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |