|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.grails.commons.metaclass.AbstractDynamicMethods
public abstract class AbstractDynamicMethods
This class provides the base implementation responsible for performing dynamic method invocation such as the dynamic finders in GORM
Field Summary | |
---|---|
protected Class |
clazz
|
protected Collection |
dynamicConstructors
|
protected Collection |
dynamicMethodInvocations
|
protected Map |
dynamicProperties
|
protected Collection |
staticMethodInvocations
|
Constructor Summary | |
---|---|
AbstractDynamicMethods()
A non-registering constructor that simple creates an instance |
|
AbstractDynamicMethods(Class theClass)
Creates and registers a DelegatingMetaClass instance in the registry that delegates to this class |
|
AbstractDynamicMethods(Class theClass,
boolean inRegistry)
Creates and optionally registers a DelegatingMetaClass in the MetaClasRegistry that delegates to this class |
Method Summary | |
---|---|
void |
addDynamicConstructor(DynamicConstructor constructor)
Adds a dynamic constructor |
void |
addDynamicMethodInvocation(DynamicMethodInvocation methodInvocation)
Adds a new dynamic method invocation |
void |
addDynamicProperty(DynamicProperty property)
Adds a new dynamic property |
void |
addStaticMethodInvocation(StaticMethodInvocation methodInvocation)
Adds a new static method invocation |
DynamicMethodInvocation |
getDynamicMethod(String method_signature)
Retrieves a dynamic method for the specified method name |
DynamicProperty |
getDynamicProperty(String propertyName)
Retrieves a dynamic property for the specified property name |
Object |
getProperty(Object object,
String propertyName,
InvocationCallback callback)
Attempts to get a dynamic property. |
Object |
invokeConstructor(Object[] arguments,
InvocationCallback callBack)
Attempts to invoke a dynamic constructor. |
Object |
invokeMethod(Object object,
String methodName,
Object[] arguments,
InvocationCallback callback)
Attempts to invoke a dynamic method with the specified name and arguments If successful the callback object is marked as invoked. |
Object |
invokeStaticMethod(Object object,
String methodName,
Object[] arguments,
InvocationCallback callBack)
Attempts to invoke a dynamic static method with the specified name and arguments If successful the callback object is marked as invoked. |
void |
setProperty(Object object,
String propertyName,
Object newValue,
InvocationCallback callback)
Attempts to set a dynamic property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Collection dynamicMethodInvocations
protected Collection staticMethodInvocations
protected Collection dynamicConstructors
protected Map dynamicProperties
protected Class clazz
Constructor Detail |
---|
public AbstractDynamicMethods(Class theClass) throws IntrospectionException
theClass
-
IntrospectionException
public AbstractDynamicMethods(Class theClass, boolean inRegistry) throws IntrospectionException
theClass
- inRegistry
-
IntrospectionException
public AbstractDynamicMethods()
Method Detail |
---|
public void addDynamicConstructor(DynamicConstructor constructor)
DynamicMethods
addDynamicConstructor
in interface DynamicMethods
constructor
- The constructor to addpublic void addDynamicMethodInvocation(DynamicMethodInvocation methodInvocation)
DynamicMethods
addDynamicMethodInvocation
in interface DynamicMethods
public void addStaticMethodInvocation(StaticMethodInvocation methodInvocation)
DynamicMethods
addStaticMethodInvocation
in interface DynamicMethods
public void addDynamicProperty(DynamicProperty property)
DynamicMethods
addDynamicProperty
in interface DynamicMethods
public Object getProperty(Object object, String propertyName, InvocationCallback callback)
DynamicMethods
getProperty
in interface DynamicMethods
object
- The instancepropertyName
- The property name to getcallback
- The callback object
public void setProperty(Object object, String propertyName, Object newValue, InvocationCallback callback)
DynamicMethods
setProperty
in interface DynamicMethods
object
- The instancepropertyName
- The property name to setcallback
- The callback objectpublic Object invokeMethod(Object object, String methodName, Object[] arguments, InvocationCallback callback)
DynamicMethods
invokeMethod
in interface DynamicMethods
object
- The instance to invoke onmethodName
- The name of the methodarguments
- The arguments of the methodcallback
- The callback object
public Object invokeConstructor(Object[] arguments, InvocationCallback callBack)
DynamicMethods
invokeConstructor
in interface DynamicMethods
arguments
- The argumentscallBack
- The callback object
public Object invokeStaticMethod(Object object, String methodName, Object[] arguments, InvocationCallback callBack)
DynamicMethods
invokeStaticMethod
in interface DynamicMethods
object
- The instance to invoke onmethodName
- The name of the methodarguments
- The arguments of the methodcallBack
- The callback object
public DynamicProperty getDynamicProperty(String propertyName)
DynamicMethods
getDynamicProperty
in interface DynamicMethods
propertyName
- The name of the property
public DynamicMethodInvocation getDynamicMethod(String method_signature)
DynamicMethods
getDynamicMethod
in interface DynamicMethods
method_signature
- Then signature of the method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |