Package de.alpharogroup.model.reflect
Class Reflection
- java.lang.Object
-
- de.alpharogroup.model.reflect.Reflection
-
public final class Reflection extends java.lang.Object
Reflection utilities.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<?>
getClass(java.lang.reflect.Type type)
Get theClass
for a generic type.static boolean
isGetter(java.lang.reflect.Method method)
Is the given method a JavaBeans getter.static boolean
isListIndex(java.lang.reflect.Method method)
Does the given method represent aList
index.static java.lang.reflect.Type
resultType(java.lang.reflect.Type declaringType, java.lang.reflect.Type type)
Get the resulting type of invoking a method.static java.lang.reflect.Type
variableType(java.lang.reflect.ParameterizedType type, java.lang.reflect.TypeVariable<?> variable)
Get the type for a class type variable.
-
-
-
Method Detail
-
getClass
public static java.lang.Class<?> getClass(java.lang.reflect.Type type)
Get theClass
for a generic type.- Parameters:
type
-Class
orParameterizedType
- Returns:
- class class
- Throws:
java.lang.IllegalArgumentException
- if type doesn't represent a class
-
isGetter
public static boolean isGetter(java.lang.reflect.Method method)
Is the given method a JavaBeans getter.- Parameters:
method
- method to test- Returns:
true
if method is a getter
-
isListIndex
public static boolean isListIndex(java.lang.reflect.Method method)
Does the given method represent aList
index.- Parameters:
method
- method to test- Returns:
true
if list index
-
resultType
public static java.lang.reflect.Type resultType(java.lang.reflect.Type declaringType, java.lang.reflect.Type type)
Get the resulting type of invoking a method.- Parameters:
declaringType
- declaring class of the methodtype
- return type of method- Returns:
- resulting type or
null
if not known
-
variableType
public static java.lang.reflect.Type variableType(java.lang.reflect.ParameterizedType type, java.lang.reflect.TypeVariable<?> variable)
Get the type for a class type variable.- Parameters:
type
- the owning typevariable
- the variable- Returns:
- type or
null
-
-