|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrailo.runtime.reflection.Invoker
public final class Invoker
To invoke a Object on different ways
Constructor Summary | |
---|---|
Invoker()
|
Method Summary | |
---|---|
static Object |
callGetter(Object o,
String prop)
to invoke a getter Method of a Object |
static Object |
callMethod(Object object,
String methodName,
Object[] parameters)
call of a method from given object |
static void |
callSetter(Object o,
String prop,
Object value)
to invoke a setter Method of a Object |
static Object |
callStaticMethod(Class staticClass,
String methodName,
Object[] values)
call of a static method of a Class |
static ConstructorParameterPair |
getConstructorParameterPairIgnoreCase(Class clazz,
Object[] parameters)
search the matching constructor to defined parameter list, also translate parameters for matching |
static Field |
getFieldIgnoreCase(Class c,
String name)
same like method getField from Class but ignore case from field name |
static MethodParameterPair |
getMethodParameterPairIgnoreCase(Class objectClass,
String methodName,
Object[] parameters)
search the matching method to defined Method Name, also translate parameters for matching |
static Object |
getProperty(Object o,
String prop)
to get a visible Property of a object |
static Object |
newInstance(Class clazz,
Object[] parameters)
|
static void |
setProperty(Object o,
String prop,
Object value)
assign a value to a visible property of a object |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Invoker()
Method Detail |
---|
public static Object newInstance(Class clazz, Object[] parameters) throws NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
clazz
- parameters
-
NoSuchMethodException
IllegalArgumentException
InstantiationException
IllegalAccessException
InvocationTargetException
public static ConstructorParameterPair getConstructorParameterPairIgnoreCase(Class clazz, Object[] parameters) throws NoSuchMethodException
clazz
- class to get constructo fromparameters
- parameter for the constructor
NoSuchMethodException
public static Object callMethod(Object object, String methodName, Object[] parameters) throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
object
- object to call method frommethodName
- name of the method to callparameters
- parameter for method
SecurityException
NoSuchMethodException
IllegalArgumentException
IllegalAccessException
InvocationTargetException
public static MethodParameterPair getMethodParameterPairIgnoreCase(Class objectClass, String methodName, Object[] parameters) throws NoSuchMethodException
objectClass
- class object where searching method frommethodName
- name of the method to searchparameters
- whished parameter list
NoSuchMethodException
public static Object callGetter(Object o, String prop) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
o
- Object to invoke method fromprop
- Name of the Method without get
SecurityException
NoSuchMethodException
IllegalArgumentException
IllegalAccessException
InvocationTargetException
public static void callSetter(Object o, String prop, Object value) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
o
- Object to invoke method fromprop
- Name of the Method without getvalue
- Value to set to the Method
SecurityException
NoSuchMethodException
IllegalArgumentException
IllegalAccessException
InvocationTargetException
public static Object getProperty(Object o, String prop) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException
o
- Object to invokeprop
- property to call
NoSuchFieldException
IllegalArgumentException
IllegalAccessException
public static void setProperty(Object o, String prop, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException
o
- Object to assign value to his propertyprop
- name of propertyvalue
- Value to assign
IllegalArgumentException
IllegalAccessException
NoSuchFieldException
public static Field getFieldIgnoreCase(Class c, String name) throws NoSuchFieldException
c
- class to search the fieldname
- name to search
NoSuchFieldException
public static Object callStaticMethod(Class staticClass, String methodName, Object[] values) throws PageException
staticClass
- class how contains method to invokemethodName
- method name to invokevalues
- Arguments for the Method
PageException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |