public abstract class GenericTypeResolver
extends java.lang.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 java.lang.Class<?> |
extractClass(java.lang.Class<?> ownerClass,
java.lang.reflect.Type arg)
Extract a class instance from given Type.
|
static java.lang.reflect.Type |
getTargetType(MethodParameter methodParam)
Determine the target type for the given parameter specification.
|
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<?> |
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.
|
public static java.lang.reflect.Type getTargetType(MethodParameter methodParam)
methodParam - the method parameter specificationpublic static java.lang.Class<?> resolveParameterType(MethodParameter methodParam, java.lang.Class<?> clazz)
methodParam - the method parameter specificationclazz - the class to resolve type variables againstpublic 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 againstpublic 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 fromnull 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 fromnull if not
resolvablepublic static java.lang.Class<?> extractClass(java.lang.Class<?> ownerClass,
java.lang.reflect.Type arg)
Copyright © 2015 Molindo GmbH. All Rights Reserved.