public final class ReflectionHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
createInstances(List<String> fullyQualifiedClassNames,
Class<T> superType) |
static Class<?> |
getArrayType(Class<?> type)
Get the array type of type, or null if type is not an array.
|
static Class<?> |
getClassForName(String className) |
static Field |
getDeclaredField(Object bean,
String fieldName) |
static Set<Field> |
getDeclaredFieldsWithAnnotationRecursively(Class<?> clazz,
Class<? extends Annotation> annotationClass) |
static Object |
getFieldValue(Object bean,
String fieldName) |
static Class<?> |
getGenericType(Field field)
Get the actual type of a one-dimensional generic field.
|
static <T> T[] |
newArrayFromCollection(Collection<?> collection,
Class<T> elementType) |
static Collection<Object> |
newCollectionInstance(Class<? extends Collection> clazz) |
static <T> T |
newInstance(Class<T> clazz) |
static <T> T |
newInstance(String fullyQualifiedClassName,
Class<T> superType) |
static void |
setFieldValue(Object bean,
String fieldName,
Object value) |
public static Class<?> getClassForName(String className) throws ClassNotFoundException
ClassNotFoundExceptionpublic static Class<?> getArrayType(Class<?> type)
type - The array class type.public static Class<?> getGenericType(Field field)
field - The fieldpublic static Collection<Object> newCollectionInstance(Class<? extends Collection> clazz)
public static <T> T newInstance(Class<T> clazz)
public static <T> List<T> createInstances(List<String> fullyQualifiedClassNames, Class<T> superType)
public static Set<Field> getDeclaredFieldsWithAnnotationRecursively(Class<?> clazz, Class<? extends Annotation> annotationClass)
public static <T> T[] newArrayFromCollection(Collection<?> collection, Class<T> elementType)
Copyright © 2017 akquinet tech@spree GmbH. All Rights Reserved.