|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ldaptive.beans.reflect.ReflectionUtils
public final class ReflectionUtils
Provides utility methods for common reflection operations.
| Method Summary | |
|---|---|
static Class<?> |
classFromType(Type t)
Casts the supplied type to a class. |
static Object |
getField(Field field,
Object object)
Returns the value of the supplied field on the supplied object. |
static Object |
invokeGetterMethod(Method method,
Object object)
Invokes the supplied method on the supplied object. |
static void |
invokeSetterMethod(Method method,
Object object,
Object value)
Invokes the supplied method on the supplied object with the supplied value as a parameter. |
static void |
setField(Field field,
Object object,
Object value)
Sets the supplied value of the supplied field on the supplied object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Class<?> classFromType(Type t)
t - to cast
IllegalArgumentException - if t is not an instance of Class
public static Object getField(Field field,
Object object)
field - containing the value to returnobject - that has the field
IllegalArgumentException - if the field cannot be retrieved
public static void setField(Field field,
Object object,
Object value)
field - of the object to setobject - that has the fieldvalue - to set
IllegalArgumentException - if the field cannot be set
public static Object invokeGetterMethod(Method method,
Object object)
method - to invokeobject - that has the method
IllegalArgumentException - if the method cannot be invoked
public static void invokeSetterMethod(Method method,
Object object,
Object value)
method - to invokeobject - that has the methodvalue - to set
IllegalArgumentException - if the method cannot be invoked
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||