public class MockProxyMetaClass extends ProxyMetaClass
MetaClassImpl.Index, MetaClassImpl.MetaConstructor
Modifier and Type | Field and Description |
---|---|
boolean |
interceptConstruction |
adaptee, interceptor
EMPTY_ARGUMENTS, getPropertyMethod, INVOKE_METHOD_METHOD, invokeMethodMethod, isGroovyObject, isMap, metaMethodIndex, METHOD_MISSING, PROPERTY_MISSING, registry, setPropertyMethod, STATIC_METHOD_MISSING, STATIC_PROPERTY_MISSING, theCachedClass, theClass
Constructor and Description |
---|
MockProxyMetaClass(MetaClassRegistry registry,
Class theClass,
MetaClass adaptee) |
MockProxyMetaClass(MetaClassRegistry registry,
Class theClass,
MetaClass adaptee,
boolean interceptConstruction) |
Modifier and Type | Method and Description |
---|---|
Object |
getProperty(Class aClass,
Object object,
String property,
boolean b,
boolean b1)
Interceptors the call to getProperty if a PropertyAccessInterceptor is
available
|
Object |
invokeConstructor(Object[] arguments)
Unlike general impl in superclass, ctors are not intercepted but relayed
unless interceptConstruction is set.
|
Object |
invokeMethod(Object object,
String methodName,
Object[] arguments)
Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor.
|
Object |
invokeStaticMethod(Object object,
String methodName,
Object[] arguments)
Call invokeStaticMethod on adaptee with logic like in MetaClass unless we have an Interceptor.
|
static MockProxyMetaClass |
make(Class theClass)
convenience factory method for the most usual case.
|
static MockProxyMetaClass |
make(Class theClass,
boolean interceptConstruction)
convenience factory method allowing interceptConstruction to be set.
|
void |
setProperty(Class aClass,
Object object,
String property,
Object newValue,
boolean b,
boolean b1)
Interceptors the call to a property setter if a PropertyAccessInterceptor
is available
|
getAdaptee, getInstance, getInterceptor, initialize, invokeMethod, setAdaptee, setInterceptor, use, use
addMetaBeanProperty, addMetaMethod, addMetaMethodToIndex, addNewInstanceMethod, addNewStaticMethod, applyPropertyDescriptors, checkIfGroovyObjectMethod, checkInitalised, chooseMethod, clearInvocationCaches, createConstructorSite, createErrorMessageForAmbiguity, createPogoCallCurrentSite, createPogoCallSite, createPojoCallSite, createStaticSite, createTransformMetaMethod, doChooseMostSpecificParams, dropMethodCache, dropStaticMethodCache, findMethodInClassHierarchy, findMixinMethod, findOwnMethod, findPropertyInClassHierarchy, getAdditionalMetaMethods, getAttribute, getAttribute, getAttribute, getClassInfo, getClassNode, getEffectiveGetMetaProperty, getMetaMethod, getMetaMethods, getMetaProperty, getMethods, getMethodWithCaching, getMethodWithoutCaching, getProperties, getProperty, getRegistry, getStaticMetaMethod, getSubclassMetaMethods, getSuperClasses, getTheCachedClass, getTheClass, getVersion, handleMatches, hasCustomInvokeMethod, hasCustomStaticInvokeMethod, hasProperty, incVersion, invokeMethod, invokeMissingMethod, invokeMissingProperty, invokeStaticMissingProperty, isGroovyObject, isInitialized, isModified, onGetPropertyFoundInHierarchy, onInvokeMethodFoundInHierarchy, onMixinMethodFound, onSetPropertyFoundInHierarchy, onSuperMethodFoundInHierarchy, onSuperPropertyFoundInHierarchy, pickMethod, respondsTo, respondsTo, retrieveConstructor, retrieveConstructor, retrieveStaticMethod, selectConstructorAndTransformArguments, setAttribute, setAttribute, setProperties, setProperty, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAttribute, getClassNode, getMetaMethods, getMethods, getProperties, invokeMissingMethod, invokeMissingProperty, pickMethod, selectConstructorAndTransformArguments, setAttribute
getAttribute, getMetaMethod, getMetaProperty, getProperty, getStaticMetaMethod, getTheClass, hasProperty, invokeMethod, respondsTo, respondsTo, setAttribute, setProperty
public MockProxyMetaClass(MetaClassRegistry registry, Class theClass, MetaClass adaptee)
adaptee
- the MetaClass to decorate with interceptabilitypublic MockProxyMetaClass(MetaClassRegistry registry, Class theClass, MetaClass adaptee, boolean interceptConstruction)
adaptee
- the MetaClass to decorate with interceptabilitypublic static MockProxyMetaClass make(Class theClass)
public static MockProxyMetaClass make(Class theClass, boolean interceptConstruction)
public Object invokeMethod(Object object, String methodName, Object[] arguments)
ProxyMetaClass
invokeMethod
in interface MetaObjectProtocol
invokeMethod
in class ProxyMetaClass
object
- The object which the method was invoked onmethodName
- The name of the methodarguments
- The arguments to the methodMetaClass.invokeMethod(Class, Object, String, Object[], boolean, boolean)
public Object invokeStaticMethod(Object object, String methodName, Object[] arguments)
ProxyMetaClass
invokeStaticMethod
in interface MetaObjectProtocol
invokeStaticMethod
in class ProxyMetaClass
object
- An instance of the class returned by the getTheClass() method or the class itselfmethodName
- The name of the methodarguments
- The arguments to the methodMissingMethodException
public Object getProperty(Class aClass, Object object, String property, boolean b, boolean b1)
ProxyMetaClass
getProperty
in interface MetaClass
getProperty
in class ProxyMetaClass
aClass
- The java.lang.Class instance that requested the propertyobject
- the object to invoke the getter onproperty
- the property nameb
- Whether the call is to a super class propertyb1
- ??public void setProperty(Class aClass, Object object, String property, Object newValue, boolean b, boolean b1)
ProxyMetaClass
setProperty
in interface MetaClass
setProperty
in class ProxyMetaClass
aClass
- The java.lang.Class instance that is mutating the propertyobject
- The object to invoke the setter onproperty
- The property name to setnewValue
- The new value of the propertyb
- Whether the call is to a super class propertyb1
- Whether the call was invoked from the inside or the outside of the class.public Object invokeConstructor(Object[] arguments)
invokeConstructor
in interface MetaObjectProtocol
invokeConstructor
in class ProxyMetaClass
arguments
- The arguments to the constructor