Package groovy.util
Class ProxyGenerator
- java.lang.Object
- 
- groovy.util.ProxyGenerator
 
- 
 public class ProxyGenerator extends java.lang.ObjectClasses to generate 'Proxy' objects which implement interfaces, maps of closures and/or extend classes/delegates.
- 
- 
Field SummaryFields Modifier and Type Field Description static ProxyGeneratorINSTANCE
 - 
Constructor SummaryConstructors Constructor Description ProxyGenerator()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetDebug()booleangetEmptyMethods()java.lang.ClassLoadergetOverride()GroovyObjectinstantiateAggregate(java.util.List<java.lang.Class> interfaces)GroovyObjectinstantiateAggregate(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces)GroovyObjectinstantiateAggregate(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Class clazz)GroovyObjectinstantiateAggregate(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Class clazz, java.lang.Object[] constructorArgs)GroovyObjectinstantiateAggregateFromBaseClass(Closure cl, java.lang.Class clazz)GroovyObjectinstantiateAggregateFromBaseClass(java.lang.Class clazz)GroovyObjectinstantiateAggregateFromBaseClass(java.lang.Class clazz, java.lang.Object[] constructorArgs)GroovyObjectinstantiateAggregateFromBaseClass(java.util.Map map, java.lang.Class clazz)GroovyObjectinstantiateAggregateFromBaseClass(java.util.Map map, java.lang.Class clazz, java.lang.Object[] constructorArgs)GroovyObjectinstantiateAggregateFromInterface(java.lang.Class clazz)GroovyObjectinstantiateAggregateFromInterface(java.util.Map map, java.lang.Class clazz)GroovyObjectinstantiateDelegate(java.lang.Object delegate)GroovyObjectinstantiateDelegate(java.util.List<java.lang.Class> interfaces, java.lang.Object delegate)GroovyObjectinstantiateDelegate(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Object delegate)GroovyObjectinstantiateDelegateWithBaseClass(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Object delegate)GroovyObjectinstantiateDelegateWithBaseClass(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Object delegate, java.lang.Class baseClass)GroovyObjectinstantiateDelegateWithBaseClass(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Object delegate, java.lang.Class baseClass, java.lang.String name)Creates a proxy with a delegate object.voidsetDebug(boolean debug)InstructsProxyGeneratorto dump generated Groovy source code to standard output during construction.voidsetEmptyMethods(boolean emptyMethods)Changes generated methods to have empty implementations.voidsetOverride(java.lang.ClassLoader override)
 
- 
- 
- 
Field Detail- 
INSTANCEpublic static final ProxyGenerator INSTANCE 
 
- 
 - 
Method Detail- 
getDebugpublic boolean getDebug() 
 - 
setDebugpublic void setDebug(boolean debug) InstructsProxyGeneratorto dump generated Groovy source code to standard output during construction. This is useful for debugging purposes but should be turned off in production.- Parameters:
- debug- true if you want generated source to be printed
 
 - 
getEmptyMethodspublic boolean getEmptyMethods() 
 - 
setEmptyMethodspublic void setEmptyMethods(boolean emptyMethods) Changes generated methods to have empty implementations.Methods in generated aggregates not supplied in a closures map or base class are given 'default' implementations. The implementation will normally throw an UnsupportedOperationExceptionbut setting this boolean will leave it empty.- Parameters:
- emptyMethods- true if you want generated methods to be empty
 
 - 
getOverridepublic java.lang.ClassLoader getOverride() 
 - 
setOverridepublic void setOverride(java.lang.ClassLoader override) 
 - 
instantiateAggregateFromBaseClasspublic GroovyObject instantiateAggregateFromBaseClass(java.lang.Class clazz) 
 - 
instantiateAggregateFromBaseClasspublic GroovyObject instantiateAggregateFromBaseClass(java.util.Map map, java.lang.Class clazz) 
 - 
instantiateAggregateFromBaseClasspublic GroovyObject instantiateAggregateFromBaseClass(Closure cl, java.lang.Class clazz) 
 - 
instantiateAggregateFromBaseClasspublic GroovyObject instantiateAggregateFromBaseClass(java.lang.Class clazz, java.lang.Object[] constructorArgs) 
 - 
instantiateAggregateFromBaseClasspublic GroovyObject instantiateAggregateFromBaseClass(java.util.Map map, java.lang.Class clazz, java.lang.Object[] constructorArgs) 
 - 
instantiateAggregateFromInterfacepublic GroovyObject instantiateAggregateFromInterface(java.lang.Class clazz) 
 - 
instantiateAggregateFromInterfacepublic GroovyObject instantiateAggregateFromInterface(java.util.Map map, java.lang.Class clazz) 
 - 
instantiateAggregatepublic GroovyObject instantiateAggregate(java.util.List<java.lang.Class> interfaces) 
 - 
instantiateAggregatepublic GroovyObject instantiateAggregate(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces) 
 - 
instantiateAggregatepublic GroovyObject instantiateAggregate(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Class clazz) 
 - 
instantiateAggregatepublic GroovyObject instantiateAggregate(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Class clazz, java.lang.Object[] constructorArgs) 
 - 
instantiateDelegatepublic GroovyObject instantiateDelegate(java.lang.Object delegate) 
 - 
instantiateDelegatepublic GroovyObject instantiateDelegate(java.util.List<java.lang.Class> interfaces, java.lang.Object delegate) 
 - 
instantiateDelegatepublic GroovyObject instantiateDelegate(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Object delegate) 
 - 
instantiateDelegateWithBaseClasspublic GroovyObject instantiateDelegateWithBaseClass(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Object delegate) 
 - 
instantiateDelegateWithBaseClasspublic GroovyObject instantiateDelegateWithBaseClass(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Object delegate, java.lang.Class baseClass) 
 - 
instantiateDelegateWithBaseClasspublic GroovyObject instantiateDelegateWithBaseClass(java.util.Map closureMap, java.util.List<java.lang.Class> interfaces, java.lang.Object delegate, java.lang.Class baseClass, java.lang.String name) Creates a proxy with a delegate object.- Parameters:
- closureMap- the closure for methods not handled by the delegate
- interfaces- interfaces to be implemented
- delegate- the delegate object
- baseClass- the base class
- name- the name of the proxy, unused, but kept for compatibility with previous versions of Groovy.
- Returns:
- a proxy object implementing the specified interfaces, and delegating to the provided object
 
 
- 
 
-