|
qflib 0.98.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.qfs.lib.util.Reflector
This class holds a collection of static methods for convenient access to the reflection API.
| Constructor Summary | |
Reflector()
|
|
| Method Summary | |
static java.lang.Object |
call(java.lang.Object instance,
java.lang.String name)
Call a no args method of an object. |
static java.lang.Object |
call(java.lang.Object instance,
java.lang.String name,
boolean forceAccess)
Call a no args method of an object. |
static java.lang.Object |
call(java.lang.Object instance,
java.lang.String name,
java.lang.Class[] parameterTypes,
java.lang.Object[] parameterValues)
Call a method of an object. |
static java.lang.Object |
call(java.lang.Object instance,
java.lang.String name,
java.lang.Class[] parameterTypes,
java.lang.Object[] parameterValues,
boolean forceAccess)
Call a method of an object. |
static java.lang.Object |
call(java.lang.Object instance,
java.lang.String name,
java.lang.Class parameterType,
java.lang.Object parameterValue)
Call a one arg method of an object. |
static java.lang.Object |
call(java.lang.Object instance,
java.lang.String name,
java.lang.Class parameterType,
java.lang.Object parameterValue,
boolean forceAccess)
Call a one arg method of an object. |
static java.lang.Object |
get(java.lang.Object instance,
java.lang.String name)
Get a field value from an object. |
static java.lang.Object |
get(java.lang.Object instance,
java.lang.String name,
boolean forceAccess)
Get a field value from an object. |
static java.lang.Object |
safeCall(java.lang.Object instance,
java.lang.String name)
Call a no args method of an object. |
static java.lang.Object |
safeCall(java.lang.Object instance,
java.lang.String name,
boolean forceAccess)
Call a no args method of an object. |
static java.lang.Object |
safeCall(java.lang.Object instance,
java.lang.String name,
java.lang.Class[] parameterTypes,
java.lang.Object[] parameterValues)
Call a method of an object. |
static java.lang.Object |
safeCall(java.lang.Object instance,
java.lang.String name,
java.lang.Class[] parameterTypes,
java.lang.Object[] parameterValues,
boolean forceAccess)
Call a method of an object. |
static java.lang.Object |
safeCall(java.lang.Object instance,
java.lang.String name,
java.lang.Class parameterType,
java.lang.Object parameterValue)
Call a one arg method of an object. |
static java.lang.Object |
safeCall(java.lang.Object instance,
java.lang.String name,
java.lang.Class parameterType,
java.lang.Object parameterValue,
boolean forceAccess)
Call a one arg method of an object. |
static java.lang.Object |
safeGet(java.lang.Object instance,
java.lang.String name)
Get a field value from an object. |
static java.lang.Object |
safeGet(java.lang.Object instance,
java.lang.String name,
boolean forceAccess)
Get a field value from an object. |
static void |
safeSet(java.lang.Object instance,
java.lang.String name,
java.lang.Object value)
Set a field value in an object. |
static void |
safeSet(java.lang.Object instance,
java.lang.String name,
java.lang.Object value,
boolean forceAccess)
Set a field value in an object. |
static void |
set(java.lang.Object instance,
java.lang.String name,
java.lang.Object value)
Set a field value in an object. |
static void |
set(java.lang.Object instance,
java.lang.String name,
java.lang.Object value,
boolean forceAccess)
Set a field value in an object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Reflector()
| Method Detail |
public static java.lang.Object call(java.lang.Object instance,
java.lang.String name,
java.lang.Class[] parameterTypes,
java.lang.Object[] parameterValues,
boolean forceAccess)
throws java.lang.IllegalAccessException,
java.lang.NoSuchMethodException,
java.lang.reflect.InvocationTargetException
instance - The object whose method to call.name - The name of the method.parameterTypes - The classes of the method parameters.parameterValues - The parameter values.forceAccess - Whether to force access to a normally
inaccessible method via the AccessibleObject.setAccessible
method (only works with JDK 1.2 and above).java.lang.IllegalAccessException - If the method cannot be accessed.java.lang.NoSuchMethodException - If no such method exists.java.lang.reflect.InvocationTargetException - If execution of the method
throws an exception.
public static java.lang.Object call(java.lang.Object instance,
java.lang.String name,
java.lang.Class[] parameterTypes,
java.lang.Object[] parameterValues)
throws java.lang.IllegalAccessException,
java.lang.NoSuchMethodException,
java.lang.reflect.InvocationTargetException
instance - The object whose method to call.name - The name of the method.parameterTypes - The classes of the method parameters.parameterValues - The parameter values.java.lang.IllegalAccessException - If the method cannot be accessed.java.lang.NoSuchMethodException - If no such method exists.java.lang.reflect.InvocationTargetException - If execution of the method
throws an exception.
public static java.lang.Object call(java.lang.Object instance,
java.lang.String name,
boolean forceAccess)
throws java.lang.IllegalAccessException,
java.lang.NoSuchMethodException,
java.lang.reflect.InvocationTargetException
instance - The object whose method to call.name - The name of the method.forceAccess - Whether to force access to a normally
inaccessible method via the AccessibleObject.setAccessible
method (only works with JDK 1.2 and above).java.lang.IllegalAccessException - If the method cannot be accessed.java.lang.NoSuchMethodException - If no such method exists.java.lang.reflect.InvocationTargetException - If execution of the method
throws an exception.
public static java.lang.Object call(java.lang.Object instance,
java.lang.String name)
throws java.lang.IllegalAccessException,
java.lang.NoSuchMethodException,
java.lang.reflect.InvocationTargetException
instance - The object whose method to call.name - The name of the method.java.lang.IllegalAccessException - If the method cannot be accessed.java.lang.NoSuchMethodException - If no such method exists.java.lang.reflect.InvocationTargetException - If execution of the method
throws an exception.
public static java.lang.Object call(java.lang.Object instance,
java.lang.String name,
java.lang.Class parameterType,
java.lang.Object parameterValue,
boolean forceAccess)
throws java.lang.IllegalAccessException,
java.lang.NoSuchMethodException,
java.lang.reflect.InvocationTargetException
instance - The object whose method to call.name - The name of the method.parameterType - The class of the method parameter.parameterValue - The parameter value.forceAccess - Whether to force access to a normally
inaccessible method via the AccessibleObject.setAccessible
method (only works with JDK 1.2 and above).java.lang.IllegalAccessException - If the method cannot be accessed.java.lang.NoSuchMethodException - If no such method exists.java.lang.reflect.InvocationTargetException - If execution of the method
throws an exception.
public static java.lang.Object call(java.lang.Object instance,
java.lang.String name,
java.lang.Class parameterType,
java.lang.Object parameterValue)
throws java.lang.IllegalAccessException,
java.lang.NoSuchMethodException,
java.lang.reflect.InvocationTargetException
instance - The object whose method to call.name - The name of the method.parameterType - The class of the method parameter.parameterValue - The parameter value.java.lang.IllegalAccessException - If the method cannot be accessed.java.lang.NoSuchMethodException - If no such method exists.java.lang.reflect.InvocationTargetException - If execution of the method
throws an exception.
public static java.lang.Object safeCall(java.lang.Object instance,
java.lang.String name,
java.lang.Class[] parameterTypes,
java.lang.Object[] parameterValues,
boolean forceAccess)
Log.DBG.instance - The object whose method to call.name - The name of the method.parameterTypes - The classes of the method parameters.parameterValues - The parameter values.forceAccess - Whether to force access to a normally
inaccessible method via the AccessibleObject.setAccessible
method (only works with JDK 1.2 and above).
public static java.lang.Object safeCall(java.lang.Object instance,
java.lang.String name,
java.lang.Class[] parameterTypes,
java.lang.Object[] parameterValues)
Log.DBG.instance - The object whose method to call.name - The name of the method.parameterTypes - The classes of the method parameters.parameterValues - The parameter values.
public static java.lang.Object safeCall(java.lang.Object instance,
java.lang.String name,
boolean forceAccess)
Log.DBG.instance - The object whose method to call.name - The name of the method.forceAccess - Whether to force access to a normally
inaccessible method via the AccessibleObject.setAccessible
method (only works with JDK 1.2 and above).
public static java.lang.Object safeCall(java.lang.Object instance,
java.lang.String name)
Log.DBG.instance - The object whose method to call.name - The name of the method.
public static java.lang.Object safeCall(java.lang.Object instance,
java.lang.String name,
java.lang.Class parameterType,
java.lang.Object parameterValue,
boolean forceAccess)
Log.DBG.instance - The object whose method to call.name - The name of the method.parameterType - The class of the method parameter.parameterValue - The parameter value.forceAccess - Whether to force access to a normally
inaccessible method via the AccessibleObject.setAccessible
method (only works with JDK 1.2 and above).
public static java.lang.Object safeCall(java.lang.Object instance,
java.lang.String name,
java.lang.Class parameterType,
java.lang.Object parameterValue)
Log.DBG.instance - The object whose method to call.name - The name of the method.parameterType - The class of the method parameter.parameterValue - The parameter value.
public static java.lang.Object get(java.lang.Object instance,
java.lang.String name,
boolean forceAccess)
throws java.lang.IllegalAccessException,
java.lang.NoSuchFieldException,
java.lang.reflect.InvocationTargetException
instance - The object whose field to get.name - The name of the field.forceAccess - Whether to force access to a normally
inaccessible field via the AccessibleObject.setAccessible
method (only works with JDK 1.2 and above).java.lang.IllegalAccessException - If the method cannot be accessed.java.lang.NoSuchFieldException - If no such field exists.java.lang.reflect.InvocationTargetException - If execution of the method
throws an exception.
public static java.lang.Object get(java.lang.Object instance,
java.lang.String name)
throws java.lang.IllegalAccessException,
java.lang.NoSuchFieldException,
java.lang.reflect.InvocationTargetException
instance - The object whose field to get.name - The name of the field.java.lang.IllegalAccessException - If the method cannot be accessed.java.lang.NoSuchFieldException - If no such field exists.java.lang.reflect.InvocationTargetException - If execution of the method
throws an exception.
public static java.lang.Object safeGet(java.lang.Object instance,
java.lang.String name,
boolean forceAccess)
Log.DBG.instance - The object whose field to get.name - The name of the field.forceAccess - Whether to force access to a normally
inaccessible field via the AccessibleObject.setAccessible
method (only works with JDK 1.2 and above).
public static java.lang.Object safeGet(java.lang.Object instance,
java.lang.String name)
Log.DBG.instance - The object whose field to get.name - The name of the field.
public static void set(java.lang.Object instance,
java.lang.String name,
java.lang.Object value,
boolean forceAccess)
throws java.lang.IllegalAccessException,
java.lang.NoSuchFieldException,
java.lang.reflect.InvocationTargetException
instance - The object whose field to get.name - The name of the field.value - The value to set.forceAccess - Whether to force access to a normally
inaccessible field via the AccessibleObject.setAccessible
method (only works with JDK 1.2 and above).java.lang.IllegalAccessException - If the method cannot be accessed.java.lang.NoSuchFieldException - If no such field exists.java.lang.reflect.InvocationTargetException - If execution of the method
throws an exception.
public static void set(java.lang.Object instance,
java.lang.String name,
java.lang.Object value)
throws java.lang.IllegalAccessException,
java.lang.NoSuchFieldException,
java.lang.reflect.InvocationTargetException
instance - The object whose field to get.name - The name of the field.value - The value to set.java.lang.IllegalAccessException - If the method cannot be accessed.java.lang.NoSuchFieldException - If no such field exists.java.lang.reflect.InvocationTargetException - If execution of the method
throws an exception.
public static void safeSet(java.lang.Object instance,
java.lang.String name,
java.lang.Object value,
boolean forceAccess)
Log.DBG.instance - The object whose field to get.name - The name of the field.value - The value to set.forceAccess - Whether to force access to a normally
inaccessible field via the AccessibleObject.setAccessible
method (only works with JDK 1.2 and above).
public static void safeSet(java.lang.Object instance,
java.lang.String name,
java.lang.Object value)
Log.DBG.instance - The object whose field to get.name - The name of the field.value - The value to set.
|
qflib 0.98.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||