/** * convenience factory method for the most usual case. */ public static MockProxyMetaClass make(Class theClass) throws IntrospectionException { return make(theClass, false); }
/** * convenience factory method allowing interceptConstruction to be set. */ public static MockProxyMetaClass make(Class theClass, boolean interceptConstruction) throws IntrospectionException { MetaClassRegistry metaRegistry = GroovySystem.getMetaClassRegistry(); MetaClass meta = metaRegistry.getMetaClass(theClass); return new MockProxyMetaClass(metaRegistry, theClass, meta, interceptConstruction); }
/** * Unlike general impl in superclass, ctors are not intercepted but relayed * unless interceptConstruction is set. */ public Object invokeConstructor(final Object[] arguments) { if (interceptConstruction && null == interceptor) throw new RuntimeException("cannot invoke constructor without interceptor"); if (interceptConstruction) { GroovyObject newInstance = (GroovyObject) interceptor.beforeInvoke(null, getTheClass().getSimpleName(), arguments); newInstance.setMetaClass(this); return newInstance; } return adaptee.invokeConstructor(arguments); }
/** * convenience factory method allowing interceptConstruction to be set. */ public static MockProxyMetaClass make(Class theClass, boolean interceptConstruction) { MetaClassRegistry metaRegistry = GroovySystem.getMetaClassRegistry(); MetaClass meta = metaRegistry.getMetaClass(theClass); return new MockProxyMetaClass(metaRegistry, theClass, meta, interceptConstruction); }
/** * convenience factory method for the most usual case. */ public static MockProxyMetaClass make(Class theClass) { return make(theClass, false); }
/** * Unlike general impl in superclass, ctors are not intercepted but relayed * unless interceptConstruction is set. */ public Object invokeConstructor(final Object[] arguments) { if (interceptConstruction && null == interceptor) throw new RuntimeException("cannot invoke constructor without interceptor"); if (interceptConstruction) { GroovyObject newInstance = (GroovyObject) interceptor.beforeInvoke(null, getTheClass().getSimpleName(), arguments); newInstance.setMetaClass(this); return newInstance; } return adaptee.invokeConstructor(arguments); }
/** * convenience factory method for the most usual case. */ public static MockProxyMetaClass make(Class theClass) throws IntrospectionException { MetaClassRegistry metaRegistry = GroovySystem.getMetaClassRegistry(); MetaClass meta = metaRegistry.getMetaClass(theClass); return new MockProxyMetaClass(metaRegistry, theClass, meta); }
/** * convenience factory method for the most usual case. */ public static MockProxyMetaClass make(Class theClass) throws IntrospectionException { return make(theClass, false); }
/** * Unlike general impl in superclass, ctors are not intercepted but relayed * unless interceptConstruction is set. */ public Object invokeConstructor(final Object[] arguments) { if (interceptConstruction && null == interceptor) throw new RuntimeException("cannot invoke constructor without interceptor"); if (interceptConstruction) { GroovyObject newInstance = (GroovyObject) interceptor.beforeInvoke(null, getTheClass().getSimpleName(), arguments); newInstance.setMetaClass(this); return newInstance; } return adaptee.invokeConstructor(arguments); }
/** * convenience factory method for the most usual case. */ public static MockProxyMetaClass make(Class theClass) throws IntrospectionException { MetaClassRegistry metaRegistry = GroovySystem.getMetaClassRegistry(); MetaClass meta = metaRegistry.getMetaClass(theClass); return new MockProxyMetaClass(metaRegistry, theClass, meta); }
/** * convenience factory method allowing interceptConstruction to be set. */ public static MockProxyMetaClass make(Class theClass, boolean interceptConstruction) throws IntrospectionException { MetaClassRegistry metaRegistry = GroovySystem.getMetaClassRegistry(); MetaClass meta = metaRegistry.getMetaClass(theClass); return new MockProxyMetaClass(metaRegistry, theClass, meta, interceptConstruction); }
/** * convenience factory method for the most usual case. */ public static MockProxyMetaClass make(Class theClass) throws IntrospectionException { MetaClassRegistry metaRegistry = GroovySystem.getMetaClassRegistry(); MetaClass meta = metaRegistry.getMetaClass(theClass); return new MockProxyMetaClass(metaRegistry, theClass, meta); }