public class ReflectionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static List<Field> |
getAnnotatedFields(Class<?> clazz,
Class<? extends Annotation> annotation,
boolean checkSuperclass)
Returns all field from a given class that are annotated with provided annotation type.
|
static Class<?> |
getFieldType(Field field) |
static String |
getTypeName(Class<?> clazz)
Returns the type name defined using Type annotation on provided class.
|
public static List<Field> getAnnotatedFields(Class<?> clazz, Class<? extends Annotation> annotation, boolean checkSuperclass)
clazz - source classannotation - target annotationcheckSuperclass - if true, method will follow class hierarchy to look for fields with target annotationpublic static String getTypeName(Class<?> clazz)
clazz - type classnull in case Type annotation is not presentCopyright © 2017. All rights reserved.