public class ALDParametrizedClassDataIOHelper extends Object
| Constructor and Description |
|---|
ALDParametrizedClassDataIOHelper() |
| Modifier and Type | Method and Description |
|---|---|
static HashMap<String,Field> |
getAnnotatedFields(Class<?> myclass)
Return all fields for member variables of
myclass or any of its super classes
which is annotated with ALDClassParameter. |
static Object |
getValue(Field field,
Object obj)
Return the value of the member variable associated with
field in
the object obj. |
static void |
setValue(Field field,
Object obj,
Object value)
Sets the value of the member variable associated with
field
in the object obj. |
static void |
setValue(String name,
Object obj,
Object value)
Sets the field with given
name of object objto value. |
public static HashMap<String,Field> getAnnotatedFields(Class<?> myclass)
myclass or any of its super classes
which is annotated with ALDClassParameter.myclass - public static Object getValue(Field field, Object obj)
field in
the object obj.field - field of the member variableobj - from which to return the valuepublic static void setValue(Field field, Object obj, Object value) throws IllegalAccessException
field
in the object obj.
Primitive datatype can not be set from a value == null.
field - field of the member variableobj - from which to return the valueIllegalAccessExceptionpublic static void setValue(String name, Object obj, Object value) throws IllegalAccessException
name of object objto value.
The method recursively iterates over all class fields and fields of super classes to find the requested field. An exception is thrown if the requested field could not be found or accessed.
name - Name of field to set.obj - Object in which field is to set.value - Value to set for the field.IllegalAccessExceptionCopyright © 2010–2015 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.