|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A helper class to invoke methods or extract properties on arbitrary Java objects dynamically. All methodes in this calss are deprecated!
Field Summary | |
---|---|
def |
EMPTY_ARGUMENTS
|
def |
EMPTY_TYPES
|
MetaClassRegistry |
metaRegistry
|
Constructor Summary | |
Invoker()
|
Method Summary | |
---|---|
def |
asArray(Object arguments)
Converts the given object into an array; if its an array then just cast otherwise wrap it in an array |
def |
asUnwrappedArray(Object arguments)
|
Object |
getAttribute(Object object, String attribute)
Looks up the given attribute (field) on the given object |
MetaClass |
getMetaClass(Object object)
|
MetaClassRegistry |
getMetaRegistry()
|
Closure |
getMethodPointer(Object object, String methodName)
Returns the method pointer for the given object name |
Object |
getProperty(Object object, String property)
Looks up the given property of the given object |
Object |
invokeConstructorOf(Class type, Object arguments)
|
Object |
invokeMethod(Object object, String methodName, Object arguments)
Invokes the given method on the object. |
Object |
invokePogoMethod(Object object, String methodName, Object arguments)
|
Object |
invokePojoMethod(Object object, String methodName, Object arguments)
|
Object |
invokeStaticMethod(Class type, String method, Object arguments)
|
Object |
invokeSuperMethod(Object object, String methodName, Object arguments)
|
void |
removeMetaClass(Class clazz)
|
void |
setAttribute(Object object, String attribute, Object newValue)
Sets the given attribute (field) on the given object |
void |
setProperty(Object object, String property, Object newValue)
Sets the property on the given object |
Constructor Detail |
---|
Invoker()
Method Detail |
---|
public def asArray(Object arguments)
public def asUnwrappedArray(Object arguments)
public Object getAttribute(Object object, String attribute)
public MetaClass getMetaClass(Object object)
public MetaClassRegistry getMetaRegistry()
public Closure getMethodPointer(Object object, String methodName)
public Object getProperty(Object object, String property)
public Object invokeConstructorOf(Class type, Object arguments)
public Object invokeMethod(Object object, String methodName, Object arguments)
Object invokePogoMethod(Object object, String methodName, Object arguments)
Object invokePojoMethod(Object object, String methodName, Object arguments)
public Object invokeStaticMethod(Class type, String method, Object arguments)
public Object invokeSuperMethod(Object object, String methodName, Object arguments)
public void removeMetaClass(Class clazz)
public void setAttribute(Object object, String attribute, Object newValue)
public void setProperty(Object object, String property, Object newValue)