|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.objectwave.utility.ReflectiveHelper
A collection of functions that may assist when working with java's reflective capabilities.
| Constructor Summary | |
ReflectiveHelper()
Constructor for the ReflectiveHelper object |
|
| Method Summary | |
protected java.lang.reflect.Method |
findMethod(java.lang.String fieldName,
java.lang.Class targetClass)
Find the method called get |
protected java.lang.reflect.Method |
findMethod(java.lang.String fieldName,
java.lang.Class fieldType,
java.lang.Class targetClass)
Find the method called set |
java.lang.Object |
getValue(java.lang.reflect.Field field,
java.lang.Object obj)
Use the getMethod to get the value of the provided field. |
protected void |
initialize()
Establish the object formatter for converting string properties to their actuall class type. |
void |
setValue(java.lang.reflect.Field field,
java.lang.Object valueToSet,
java.lang.Object obj)
Use the setMethod to set a field property. |
void |
setValue(java.lang.reflect.Field field,
java.lang.String valueToSet,
java.lang.Object obj)
Use the setMethod to set a field property. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ReflectiveHelper()
| Method Detail |
public void setValue(java.lang.reflect.Field field,
java.lang.String valueToSet,
java.lang.Object obj)
throws java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException
valueToSet - String The value to set.field - The field that will ultimately have the set value.obj - The object upon which the setProperty method will be called.
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public void setValue(java.lang.reflect.Field field,
java.lang.Object valueToSet,
java.lang.Object obj)
throws java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException
field - The new Value valuevalueToSet - The new Value valueobj - The new Value value
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public java.lang.Object getValue(java.lang.reflect.Field field,
java.lang.Object obj)
throws java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException
field - obj -
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessExceptionprotected void initialize()
protected java.lang.reflect.Method findMethod(java.lang.String fieldName,
java.lang.Class fieldType,
java.lang.Class targetClass)
fieldType - The class of the field. This should be the set method's
argument type.fieldName - The name of a field on the target class.targetClass -
protected java.lang.reflect.Method findMethod(java.lang.String fieldName,
java.lang.Class targetClass)
fieldName - The name of a field on the target class.targetClass -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||