Groovy 2.2.1

groovy.mock.interceptor
[Java] Class MockProxyMetaClass

java.lang.Object
  groovy.lang.MetaClassImpl
      groovy.lang.ProxyMetaClass
          groovy.mock.interceptor.MockProxyMetaClass

public class MockProxyMetaClass
extends ProxyMetaClass

The ProxyMetaClass for the MockInterceptor. Instance and class methods are intercepted, but constructors are not to allow mocking of aggregated objects.

Authors:
Dierk Koenig


Field Summary
boolean interceptConstruction

 
Fields inherited from class ProxyMetaClass
EMPTY_ARGUMENTS
 
Fields inherited from class MetaClassImpl
EMPTY_ARGUMENTS
 
Method Summary
def MockProxyMetaClass(MetaClassRegistry registry, Class theClass, MetaClass adaptee)

@param adaptee the MetaClass to decorate with interceptability

def MockProxyMetaClass(MetaClassRegistry registry, Class theClass, MetaClass adaptee, boolean interceptConstruction)

@param adaptee the MetaClass to decorate with interceptability

Object getProperty(Class aClass, Object object, String property, boolean b, boolean b1)

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)

Object invokeStaticMethod(Object object, String methodName, Object[] arguments)

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)

 
Methods inherited from class ProxyMetaClass
invokeMethod, invokeConstructor, invokeStaticMethod, use, use, getAdaptee, setAdaptee, getInterceptor, setInterceptor, setProperty, getProperty, getInstance, initialize, getTheClass, hasProperty, invokeMethod, invokeMethod, pickMethod, getClassInfo, getClassNode, invokeMissingMethod, invokeMissingProperty, getMetaMethods, selectConstructorAndTransformArguments, respondsTo, respondsTo, getMetaProperty, getStaticMetaMethod, getMetaMethod, incVersion, createPojoCallSite, getAdditionalMetaMethods, addMetaMethod, getTheCachedClass, getMethodWithoutCaching, addMetaBeanProperty, isModified, isGroovyObject, addNewInstanceMethod, addNewStaticMethod, getMethodWithCaching, retrieveConstructor, retrieveConstructor, retrieveStaticMethod, getEffectiveGetMetaProperty, createStaticSite, createPogoCallSite, createPogoCallCurrentSite, createConstructorSite, setProperty, getProperty, toString, getMethods, getProperties, setProperties, getAttribute, getAttribute, getAttribute, setAttribute, setAttribute, getRegistry, getVersion, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll
 
Methods inherited from class MetaClassImpl
getTheClass, hasProperty, invokeMethod, invokeMethod, invokeMethod, pickMethod, getClassInfo, getClassNode, invokeMissingMethod, invokeMissingProperty, getMetaMethods, selectConstructorAndTransformArguments, respondsTo, respondsTo, getMetaProperty, getStaticMetaMethod, getMetaMethod, invokeConstructor, invokeStaticMethod, incVersion, createPojoCallSite, getAdditionalMetaMethods, addMetaMethod, getTheCachedClass, getMethodWithoutCaching, addMetaBeanProperty, isModified, isGroovyObject, addNewInstanceMethod, addNewStaticMethod, getMethodWithCaching, retrieveConstructor, retrieveConstructor, retrieveStaticMethod, getEffectiveGetMetaProperty, createStaticSite, createPogoCallSite, createPogoCallCurrentSite, createConstructorSite, setProperty, setProperty, getProperty, getProperty, toString, getMethods, getProperties, setProperties, initialize, getAttribute, getAttribute, getAttribute, setAttribute, setAttribute, getRegistry, getVersion, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll
 

Field Detail

interceptConstruction

public final boolean interceptConstruction


 
Method Detail

MockProxyMetaClass

public def MockProxyMetaClass(MetaClassRegistry registry, Class theClass, MetaClass adaptee)
Parameters:
adaptee - the MetaClass to decorate with interceptability


MockProxyMetaClass

public def MockProxyMetaClass(MetaClassRegistry registry, Class theClass, MetaClass adaptee, boolean interceptConstruction)
Parameters:
adaptee - the MetaClass to decorate with interceptability


getProperty

public Object getProperty(Class aClass, Object object, String property, boolean b, boolean b1)


invokeConstructor

public Object invokeConstructor(Object[] arguments)
Unlike general impl in superclass, ctors are not intercepted but relayed unless interceptConstruction is set.


invokeMethod

public Object invokeMethod(Object object, String methodName, Object[] arguments)


invokeStaticMethod

public Object invokeStaticMethod(Object object, String methodName, Object[] arguments)


make

public static MockProxyMetaClass make(Class theClass)
convenience factory method for the most usual case.


make

public static MockProxyMetaClass make(Class theClass, boolean interceptConstruction)
convenience factory method allowing interceptConstruction to be set.


setProperty

public void setProperty(Class aClass, Object object, String property, Object newValue, boolean b, boolean b1)


 

Copyright © 2003-2013 The Codehaus. All rights reserved.