public abstract class AbstractDynamicMethods extends java.lang.Object implements DynamicMethods
Constructor and Description |
---|
AbstractDynamicMethods()
A non-registering constructor that simple creates an instance
|
AbstractDynamicMethods(java.lang.Class<?> theClass)
Creates and registers a DelegatingMetaClass instance in the registry that delegates to this class.
|
AbstractDynamicMethods(java.lang.Class<?> theClass,
boolean inRegistry)
Creates and optionally registers a DelegatingMetaClass in the MetaClasRegistry that
delegates to this class.
|
Modifier and Type | Method and Description |
---|---|
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(java.lang.String methodSignature)
Retrieves a dynamic method for the specified method name.
|
DynamicProperty |
getDynamicProperty(java.lang.String propertyName)
Retrieves a dynamic property for the specified property name.
|
java.lang.Object |
getProperty(java.lang.Object object,
java.lang.String propertyName,
InvocationCallback callback)
Attempts to get a dynamic property.
|
java.lang.Object |
invokeConstructor(java.lang.Object[] arguments,
InvocationCallback callBack)
Attempts to invoke a dynamic constructor.
|
java.lang.Object |
invokeMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] arguments,
InvocationCallback callback)
Attempts to invoke a dynamic method with the specified name and arguments.
|
java.lang.Object |
invokeStaticMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] arguments,
InvocationCallback callBack)
Attempts to invoke a dynamic static method with the specified name and arguments.
|
void |
setProperty(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object newValue,
InvocationCallback callback)
Attempts to set a dynamic property.
|
public AbstractDynamicMethods(java.lang.Class<?> theClass)
theClass
- public AbstractDynamicMethods(java.lang.Class<?> theClass, boolean inRegistry)
theClass
- inRegistry
- public AbstractDynamicMethods()
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 java.lang.Object getProperty(java.lang.Object object, java.lang.String propertyName, InvocationCallback callback)
DynamicMethods
getProperty
in interface DynamicMethods
object
- The instancepropertyName
- The property name to getcallback
- The callback objectpublic void setProperty(java.lang.Object object, java.lang.String propertyName, java.lang.Object newValue, InvocationCallback callback)
DynamicMethods
setProperty
in interface DynamicMethods
object
- The instancepropertyName
- The property name to setcallback
- The callback objectpublic java.lang.Object invokeMethod(java.lang.Object object, java.lang.String methodName, java.lang.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 objectpublic java.lang.Object invokeConstructor(java.lang.Object[] arguments, InvocationCallback callBack)
DynamicMethods
invokeConstructor
in interface DynamicMethods
arguments
- The argumentscallBack
- The callback objectpublic java.lang.Object invokeStaticMethod(java.lang.Object object, java.lang.String methodName, java.lang.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 objectpublic DynamicProperty getDynamicProperty(java.lang.String propertyName)
DynamicMethods
getDynamicProperty
in interface DynamicMethods
propertyName
- The name of the propertypublic DynamicMethodInvocation getDynamicMethod(java.lang.String methodSignature)
DynamicMethods
getDynamicMethod
in interface DynamicMethods
methodSignature
- Then signature of the method