groovy.mock.interceptor
Class MockProxyMetaClass
java.lang.Object
groovy.lang.MetaClass
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.
- Author:
- Dierk Koenig
Methods inherited from class groovy.lang.MetaClassImpl |
addMetaMethod, addNewInstanceMethod, addNewStaticMethod, cacheInstanceMethod, cacheStaticMethod, checkInitalised, clearInvocationCaches, getAttribute, getAttribute, getClassNode, getMetaMethods, getMethods, getProperties, getProperty, getProperty, initialize, invokeMethod, isInitialized, pickMethod, pickMethod, retrieveConstructor, retrieveMethod, retrieveMethod, retrieveStaticMethod, selectConstructorAndTransformArguments, setAttribute, setAttribute, setProperties, setProperty, setProperty, toString |
MockProxyMetaClass
public MockProxyMetaClass(MetaClassRegistry registry,
Class theClass,
MetaClass adaptee)
throws IntrospectionException
- Parameters:
adaptee
- the MetaClass to decorate with interceptability
make
public static MockProxyMetaClass make(Class theClass)
throws IntrospectionException
- convenience factory method for the most usual case.
- Throws:
IntrospectionException
invokeMethod
public Object invokeMethod(Object object,
String methodName,
Object[] arguments)
- Description copied from class:
ProxyMetaClass
- Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor.
With Interceptor the call is nested in its beforeInvoke and afterInvoke methods.
The method call is suppressed if Interceptor.doInvoke() returns false.
See Interceptor for details.
- Overrides:
invokeMethod
in class ProxyMetaClass
invokeStaticMethod
public Object invokeStaticMethod(Object object,
String methodName,
Object[] arguments)
- Description copied from class:
ProxyMetaClass
- Call invokeStaticMethod on adaptee with logic like in MetaClass unless we have an Interceptor.
With Interceptor the call is nested in its beforeInvoke and afterInvoke methods.
The method call is suppressed if Interceptor.doInvoke() returns false.
See Interceptor for details.
- Overrides:
invokeStaticMethod
in class ProxyMetaClass
invokeConstructor
public Object invokeConstructor(Object[] arguments)
- Unlike general impl in superclass, ctors are not intercepted but relayed
- Overrides:
invokeConstructor
in class ProxyMetaClass
Copyright © 2003-2007 The Codehaus. All Rights Reserved.