public abstract class ReflectionHelper extends Object
| Constructor and Description |
|---|
ReflectionHelper() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,Type> |
calculateInferredTypeParameters(Class clazz,
Type[] actualTypeParameters)
Calculates the map of inferred type parameters for the given class based upon the given array of known type parameters from the class hierarchy
|
static Class |
extractRawClass(Type type) |
static Type |
findInterface(Type type,
Class interfaceToFind)
Example:
static class ValueClass {}
static class SomeOtherClass<V extends ValueClass> extends ArrayList<V> implements List<V> {}
static class SomeSpecializedList extends SomeOtherClass<ValueClass> {}
|
static List<FieldTypePair> |
getDeclaredAndInheritedFieldTypePairs(Type type,
boolean returnFinalFields)
calculates all fields of class hierarchy
|
static List<MethodTypePair> |
getDeclaredAndInheritedMethods(Type type) |
static FieldTypePair |
getIdFieldIfPresent(Class clazz) |
static FieldTypePair |
getLockingVersionFieldIfPresent(Class clazz) |
static Type |
inferRealType(Type type,
Map<String,Type> realTypeMap) |
public static List<FieldTypePair> getDeclaredAndInheritedFieldTypePairs(Type type, boolean returnFinalFields)
type - the value typereturnFinalFields - indicate if final fields should be retuned as wellpublic static Map<String,Type> calculateInferredTypeParameters(Class clazz, Type[] actualTypeParameters)
clazz - the class to work onactualTypeParameters - array of type parameterspublic static List<MethodTypePair> getDeclaredAndInheritedMethods(Type type)
public static FieldTypePair getIdFieldIfPresent(Class clazz)
public static FieldTypePair getLockingVersionFieldIfPresent(Class clazz)
public static Type findInterface(Type type, Class interfaceToFind)
static class ValueClass {}
static class SomeOtherClass<V extends ValueClass> extends ArrayList<V> implements List<V> {}
static class SomeSpecializedList extends SomeOtherClass<ValueClass> {}
type - e.g. SomeSpecializedListinterfaceToFind - example List.classList<ValueClass>Copyright © 2017 BILD GmbH & Co. KG. All rights reserved.