Package de.uni_trier.wi2.procake.utils
Class ReflectionUtils
java.lang.Object
de.uni_trier.wi2.procake.utils.ReflectionUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Field
static Object
getFieldValue
(Object obj, String fieldName) static Object
getStaticField
(Class<?> clazz, String fieldName) getStaticFields
(Class<?> clazz) getStaticFields
(List<Class<?>> classes)
-
Constructor Details
-
ReflectionUtils
public ReflectionUtils()
-
-
Method Details
-
getStaticFields
- Parameters:
classes
- List of classes- Returns:
- A mapping of classes to their corresponding static fields
-
getStaticFields
- Parameters:
clazz
- The class from which the static fields should be obtained- Returns:
- The list of static fields from that class
-
getStaticField
- Parameters:
clazz
- The class from which the static field should be obtainedfieldName
- The name of the field that should be obtained- Returns:
- The value of the field
-
getField
- Parameters:
obj
- The object whose field should be accessedfieldName
- The name of the field which should be accessed- Returns:
- The requested
Field
-
getFieldValue
- Parameters:
obj
- The object whose property value should be accessedfieldName
- The name of the field which should be accessed- Returns:
- The requested field value or null if not found
-