public abstract class GenericTypeResolver extends Object
Mainly intended for usage within the framework, resolving method parameter types even when they are declared generically.
GenericCollectionTypeResolver,
JdkVersion| Constructor and Description |
|---|
GenericTypeResolver() |
| Modifier and Type | Method and Description |
|---|---|
static Class<?> |
extractClass(Class<?> ownerClass,
Type arg)
Extract a class instance from given Type.
|
static Type |
getTargetType(MethodParameter methodParam)
Determine the target type for the given parameter specification.
|
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<?> |
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.
|
public static Type getTargetType(MethodParameter methodParam)
methodParam - the method parameter specificationpublic static Class<?> resolveParameterType(MethodParameter methodParam, Class<?> clazz)
methodParam - the method parameter specificationclazz - the class to resolve type variables againstpublic static Class<?> resolveReturnType(Method method, Class<?> clazz)
method - the method to introspectclazz - the class to resolve type variables againstpublic static Class<?> resolveTypeArgument(Class<?> clazz, Class<?> genericIfc)
clazz - the target class to check againstgenericIfc - the generic interface or superclass to resolve the type
argument fromnull 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 fromnull if not
resolvableCopyright © 2014 Molindo GmbH. All Rights Reserved.