public class ProxyMetaClass
extends MetaClassImpl
Constructor and Description |
---|
ProxyMetaClass(MetaClassRegistry registry,
java.lang.Class<?> theClass,
MetaClass adaptee) |
Modifier and Type | Method and Description |
---|---|
MetaClass |
getAdaptee() |
static ProxyMetaClass |
getInstance(java.lang.Class<?> theClass)
convenience factory method for the most usual case.
|
Interceptor |
getInterceptor() |
java.lang.Object |
getProperty(java.lang.Class aClass,
java.lang.Object object,
java.lang.String property,
boolean b,
boolean b1)
Interceptors the call to getProperty if a PropertyAccessInterceptor is available.
|
java.lang.Object |
invokeConstructor(java.lang.Object[] arguments)
Call invokeConstructor on adaptee with logic like in MetaClass unless we have an Interceptor.
|
java.lang.Object |
invokeMethod(java.lang.Class aClass,
java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] arguments,
boolean b,
boolean b1)
Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor.
|
java.lang.Object |
invokeStaticMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] arguments)
Call invokeStaticMethod on adaptee with logic like in MetaClass unless we have an Interceptor.
|
void |
setAdaptee(MetaClass adaptee) |
void |
setInterceptor(Interceptor interceptor) |
void |
setProperty(java.lang.Class aClass,
java.lang.Object object,
java.lang.String property,
java.lang.Object newValue,
boolean b,
boolean b1)
Interceptors the call to a property setter if a PropertyAccessInterceptor is available.
|
void |
use(Closure closure)
Use the ProxyMetaClass for the given Closure.
|
void |
use(GroovyObject object,
Closure closure)
Use the ProxyMetaClass for the given Closure.
|
public ProxyMetaClass(MetaClassRegistry registry, java.lang.Class<?> theClass, MetaClass adaptee)
adaptee
- the MetaClass to decorate with interceptabilityregistry
- The MetaClassRegistry instancetheClass
- The class to apply this ProxyMetaClass tojava.beans.IntrospectionException
- Thrown when the class cannot be introspectedpublic MetaClass getAdaptee()
public void setAdaptee(MetaClass adaptee)
adaptee
- the adaptee to setpublic static ProxyMetaClass getInstance(java.lang.Class<?> theClass)
theClass
- The class to create a ProxyMetaClass forpublic void use(Closure closure)
closure
- piece of code to be executed with registered ProxyMetaClasspublic void use(GroovyObject object, Closure closure)
closure
- piece of code to be executed with ProxyMetaClassobject
- The GroovyObject to use this ProxyMetaClass withpublic Interceptor getInterceptor()
public void setInterceptor(Interceptor interceptor)
interceptor
- may be null to reset any interceptionpublic java.lang.Object invokeMethod(java.lang.Class aClass, java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments, boolean b, boolean b1)
public java.lang.Object invokeStaticMethod(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments)
public java.lang.Object invokeConstructor(java.lang.Object[] arguments)
public java.lang.Object getProperty(java.lang.Class aClass, java.lang.Object object, java.lang.String property, boolean b, boolean b1)
object
- the object to invoke the getter onproperty
- the property namepublic void setProperty(java.lang.Class aClass, java.lang.Object object, java.lang.String property, java.lang.Object newValue, boolean b, boolean b1)
object
- The object to invoke the setter onproperty
- The property name to setnewValue
- The new value of the property