|
Spring for Android | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 java.lang.reflect.Type |
getTargetType(MethodParameter methodParam)
Determine the target type for the given parameter specification. |
static java.util.Map<java.lang.reflect.TypeVariable<?>,java.lang.reflect.Type> |
getTypeVariableMap(java.lang.Class<?> clazz)
Build a mapping of TypeVariable names to concrete
Class for the specified Class . |
static java.lang.Class<?> |
resolveParameterType(MethodParameter methodParam,
java.lang.Class<?> clazz)
Determine the target type for the given generic parameter type. |
static java.lang.Class<?> |
resolveReturnType(java.lang.reflect.Method method,
java.lang.Class<?> clazz)
Determine the target type for the generic return type of the given method. |
static java.lang.Class<?> |
resolveReturnTypeArgument(java.lang.reflect.Method method,
java.lang.Class<?> genericIfc)
Resolve the single type argument of the given generic interface against the given target method which is assumed to return the given interface or an implementation of it. |
static java.lang.Class<?> |
resolveType(java.lang.reflect.Type genericType,
java.util.Map<java.lang.reflect.TypeVariable<?>,java.lang.reflect.Type> typeVariableMap)
Resolve the specified generic type against the given TypeVariable map. |
static java.lang.Class<?> |
resolveTypeArgument(java.lang.Class<?> clazz,
java.lang.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 java.lang.Class<?>[] |
resolveTypeArguments(java.lang.Class<?> clazz,
java.lang.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 java.lang.reflect.Type getTargetType(MethodParameter methodParam)
methodParam
- the method parameter specification
public static java.lang.Class<?> resolveParameterType(MethodParameter methodParam, java.lang.Class<?> clazz)
methodParam
- the method parameter specificationclazz
- the class to resolve type variables against
public static java.lang.Class<?> resolveReturnType(java.lang.reflect.Method method, java.lang.Class<?> clazz)
method
- the method to introspectclazz
- the class to resolve type variables against
public static java.lang.Class<?> resolveReturnTypeArgument(java.lang.reflect.Method method, java.lang.Class<?> genericIfc)
method
- the target method to check the return type ofgenericIfc
- the generic interface or superclass to resolve the type argument from
null
if not resolvable or if the
single argument is of type WildcardType
.public static java.lang.Class<?> resolveTypeArgument(java.lang.Class<?> clazz, java.lang.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 java.lang.Class<?>[] resolveTypeArguments(java.lang.Class<?> clazz, java.lang.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 java.lang.Class<?> resolveType(java.lang.reflect.Type genericType, java.util.Map<java.lang.reflect.TypeVariable<?>,java.lang.reflect.Type> typeVariableMap)
genericType
- the generic type to resolvetypeVariableMap
- the TypeVariable Map to resolved against
Object.class
otherwisepublic static java.util.Map<java.lang.reflect.TypeVariable<?>,java.lang.reflect.Type> getTypeVariableMap(java.lang.Class<?> clazz)
TypeVariable names
to concrete
Class
for the specified Class
. Searches all super types,
enclosing types and interfaces.
|
Spring for Android | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |