public final class Reflection extends Object
Modifier and Type | Method and Description |
---|---|
static Class<?> |
getClass(Type type)
Get the
Class for a generic type. |
static boolean |
isGetter(Method method)
Is the given method a JavaBeans getter.
|
static boolean |
isListIndex(Method method)
Does the given method represent a
List index. |
static Type |
resultType(Type declaringType,
Type type)
Get the resulting type of invoking a method.
|
static Type |
variableType(ParameterizedType type,
TypeVariable<?> variable)
Get the type for a class type variable.
|
public static Type resultType(Type declaringType, Type type)
declaringType
- declaring class of the methodtype
- return type of methodnull
if not knownpublic static Type variableType(ParameterizedType type, TypeVariable<?> variable)
previousType
- the owning typevariable
- the variablenull
public static Class<?> getClass(Type type)
Class
for a generic type.type
- Class
or ParameterizedType
IllegalArgumentException
- if type doesn't represent a classpublic static boolean isGetter(Method method)
method
- method to testtrue
if method is a getterCopyright © 2015. All rights reserved.