|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.dataio.provider.helpers.ALDParametrizedClassDataIOHelper
public class ALDParametrizedClassDataIOHelper
Helper class to configure and handle parametrized class objects.
Constructor Summary | |
---|---|
ALDParametrizedClassDataIOHelper()
|
Method Summary | |
---|---|
static java.util.HashMap<java.lang.String,java.lang.reflect.Field> |
getAnnotatedFields(java.lang.Class<?> myclass)
Return all fields for member variables of myclass or any of its super classes
which is annotated with ALDClassParameter . |
static java.lang.Object |
getValue(java.lang.reflect.Field field,
java.lang.Object obj)
Return the value of the member variable associated with field in
the object obj . |
static void |
setValue(java.lang.reflect.Field field,
java.lang.Object obj,
java.lang.Object value)
Sets the value of the member variable associated with field in
the object obj . |
static void |
setValue(java.lang.String name,
java.lang.Object obj,
java.lang.Object value)
Sets the field with given name of object obj to value . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ALDParametrizedClassDataIOHelper()
Method Detail |
---|
public static java.util.HashMap<java.lang.String,java.lang.reflect.Field> getAnnotatedFields(java.lang.Class<?> myclass)
myclass
or any of its super classes
which is annotated with ALDClassParameter
.
myclass
-
public static java.lang.Object getValue(java.lang.reflect.Field field, java.lang.Object obj)
field
in
the object obj
.
field
- field of the member variableobj
- from which to return the value
public static void setValue(java.lang.reflect.Field field, java.lang.Object obj, java.lang.Object value) throws java.lang.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 value
java.lang.IllegalAccessException
public static void setValue(java.lang.String name, java.lang.Object obj, java.lang.Object value) throws java.lang.IllegalAccessException
name
of object obj
to 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.
java.lang.IllegalAccessException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |