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
Method Summary |
java.lang.Object |
invokeConstructor(java.lang.Object[] arguments)
Unlike general impl in superclass, ctors are not intercepted but relayed |
java.lang.Object |
invokeMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] arguments)
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. |
static MockProxyMetaClass |
make(java.lang.Class theClass)
convenience factory method for the most usual case. |
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MockProxyMetaClass
public MockProxyMetaClass(MetaClassRegistry registry,
java.lang.Class theClass,
MetaClass adaptee)
throws java.beans.IntrospectionException
- Parameters:
adaptee
- the MetaClass to decorate with interceptability
- Throws:
java.beans.IntrospectionException
make
public static MockProxyMetaClass make(java.lang.Class theClass)
throws java.beans.IntrospectionException
- convenience factory method for the most usual case.
- Throws:
java.beans.IntrospectionException
invokeMethod
public java.lang.Object invokeMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.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 java.lang.Object invokeStaticMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.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 java.lang.Object invokeConstructor(java.lang.Object[] arguments)
- Unlike general impl in superclass, ctors are not intercepted but relayed
- Overrides:
invokeConstructor
in class ProxyMetaClass
Copyright © 2003-2011 The Codehaus. All Rights Reserved.