public final class ReflectionUtil extends Object
When a generic class is extended we often need to know which types were used to typify the generic.
| Constructor and Description |
|---|
ReflectionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Class<?> |
getClass(Type type)
Get the underlying class for a type, or null if the type is a variable type.
|
static <T> List<Class<?>> |
getTypeArguments(Class<T> baseClass,
Class<? extends T> childClass)
Get the actual type arguments a child class has used to extend a generic base class.
|
static <T> Map<TypeVariable<?>,Type> |
getTypeArgumentsMap(Class<T> baseClass,
Class<? extends T> childClass)
Get the type parameters and the corresponding actual type arguments a child class has used to extend a generic base class.
|
public static Class<?> getClass(Type type)
type - the typepublic static <T> List<Class<?>> getTypeArguments(Class<T> baseClass, Class<? extends T> childClass)
baseClass - the base classchildClass - the child classpublic static <T> Map<TypeVariable<?>,Type> getTypeArgumentsMap(Class<T> baseClass, Class<? extends T> childClass)
baseClass - the base classchildClass - the child classCopyright © 2011-2013. All Rights Reserved.