public abstract class AbstractDynamicMethodsInterceptor extends AbstractDynamicMethods implements Interceptor, PropertyAccessInterceptor, ConstructorInterceptor
Constructor and Description |
---|
AbstractDynamicMethodsInterceptor() |
AbstractDynamicMethodsInterceptor(java.lang.Class<?> theClass) |
AbstractDynamicMethodsInterceptor(java.lang.Class<?> theClass,
boolean inRegistry) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
afterConstructor(java.lang.Object[] args,
java.lang.Object instantiatedInstance)
Executed after the constructor passing the args and the instantiated instance.
|
java.lang.Object |
afterInvoke(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] arguments,
java.lang.Object result)
This code is executed after the method is optionally called.
|
java.lang.Object |
beforeConstructor(java.lang.Object[] args,
InvocationCallback callback)
Executed before the real constructor.
|
java.lang.Object |
beforeGet(java.lang.Object object,
java.lang.String property,
InvocationCallback callback)
Intercepts a getXXX call and returns a result.
|
java.lang.Object |
beforeInvoke(java.lang.Object target,
java.lang.String methodName,
java.lang.Object[] arguments,
InvocationCallback callback)
This code is executed before the method is optionally called.
|
void |
beforeSet(java.lang.Object object,
java.lang.String property,
java.lang.Object newValue,
InvocationCallback callback)
Intercepts a setXXX call.
|
addDynamicConstructor, addDynamicMethodInvocation, addDynamicProperty, addStaticMethodInvocation, getDynamicMethod, getDynamicProperty, getProperty, invokeConstructor, invokeMethod, invokeStaticMethod, setProperty
public AbstractDynamicMethodsInterceptor()
public AbstractDynamicMethodsInterceptor(java.lang.Class<?> theClass, boolean inRegistry)
public AbstractDynamicMethodsInterceptor(java.lang.Class<?> theClass)
public java.lang.Object afterConstructor(java.lang.Object[] args, java.lang.Object instantiatedInstance)
ConstructorInterceptor
afterConstructor
in interface ConstructorInterceptor
args
- The argumentsinstantiatedInstance
- The instantiated instancepublic java.lang.Object beforeConstructor(java.lang.Object[] args, InvocationCallback callback)
ConstructorInterceptor
beforeConstructor
in interface ConstructorInterceptor
args
- The constructor argscallback
- The callback objectpublic java.lang.Object beforeInvoke(java.lang.Object target, java.lang.String methodName, java.lang.Object[] arguments, InvocationCallback callback)
Interceptor
beforeInvoke
in interface Interceptor
target
- receiver object for the method callmethodName
- name of the method to callarguments
- arguments to the method callcallback
- The callback objectpublic java.lang.Object afterInvoke(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments, java.lang.Object result)
Interceptor
afterInvoke
in interface Interceptor
object
- receiver object for the called methodmethodName
- name of the called methodarguments
- arguments to the called methodresult
- result of the executed method call or result of beforeInvoke if method was not calledpublic java.lang.Object beforeGet(java.lang.Object object, java.lang.String property, InvocationCallback callback)
PropertyAccessInterceptor
beforeGet
in interface PropertyAccessInterceptor
object
- The target objectproperty
- The property to getcallback
- The callback objectpublic void beforeSet(java.lang.Object object, java.lang.String property, java.lang.Object newValue, InvocationCallback callback)
PropertyAccessInterceptor
beforeSet
in interface PropertyAccessInterceptor
object
- The target objectproperty
- The property to setnewValue
- The new valuecallback
- The callback object