public class Reflect extends Object
Modifier and Type | Method and Description |
---|---|
static List<Field> |
getAllFields(Class<?> fieldClass)
This method return all the fields (including private) from the given class and its super
classes.
|
List<Field> |
getInheritedFields(Class subClass)
This method return all the fields (including private) until the given parameterized class
|
boolean |
hasField(Field field) |
static boolean |
isCollection(Class<?> fieldClass) |
static boolean |
isCollection(Object object) |
boolean |
isCollectionField(Field field)
This method validate the given field is Collection and the elements should be of
parameterized type
|
boolean |
isSuperClass(Class subClass) |
boolean |
isSuperClass(Object object) |
public Reflect(Class parametrizedClass)
parametrizedClass
- Classpublic static boolean isCollection(Class<?> fieldClass)
fieldClass
- public static boolean isCollection(Object object)
object
- Objectpublic static List<Field> getAllFields(Class<?> fieldClass)
fieldClass
- Classpublic boolean isSuperClass(Class subClass)
subClass
- Classpublic boolean isSuperClass(Object object)
object
- Objectpublic boolean isCollectionField(Field field)
field
- Fieldpublic List<Field> getInheritedFields(Class subClass)
subClass
- Classpublic boolean hasField(Field field)
field
- Copyright © 2018 OpenMRS LLC.. All Rights Reserved.