Constructor and Description |
---|
Invoker() |
Modifier and Type | Method and Description |
---|---|
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
|
public Invoker()
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 constructorNoSuchMethodException
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 methodSecurityException
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 listNoSuchMethodException
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 getSecurityException
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 MethodSecurityException
NoSuchMethodException
IllegalArgumentException
IllegalAccessException
InvocationTargetException
public static Object getProperty(Object o, String prop) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException
o
- Object to invokeprop
- property to callNoSuchFieldException
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 assignIllegalArgumentException
IllegalAccessException
NoSuchFieldException
public static Field getFieldIgnoreCase(Class c, String name) throws NoSuchFieldException
c
- class to search the fieldname
- name to searchNoSuchFieldException
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 MethodPageException
Copyright © 2015 Lucee