Package groovy.util
Class ProxyGenerator
java.lang.Object
groovy.util.ProxyGenerator
Generates 'Proxy' objects which implement interfaces, maps of closures and/or
 extend classes/delegates.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleangetDebug()booleaninstantiateAggregate(List<Class> interfaces) instantiateAggregate(Map closureMap, List<Class> interfaces) instantiateAggregate(Map closureMap, List<Class> interfaces, Class clazz) instantiateAggregateFromBaseClass(Closure cl, Class clazz) instantiateAggregateFromBaseClass(Class clazz, Object[] constructorArgs) instantiateAggregateFromBaseClass(Map map, Class clazz) instantiateAggregateFromBaseClass(Map map, Class clazz, Object[] constructorArgs) instantiateAggregateFromInterface(Map map, Class clazz) instantiateDelegate(Object delegate) instantiateDelegate(List<Class> interfaces, Object delegate) instantiateDelegate(Map closureMap, List<Class> interfaces, Object delegate) instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate) instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate, Class baseClass) instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate, Class baseClass, 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(ClassLoader override) 
- 
Field Details- 
INSTANCE
 
- 
- 
Constructor Details- 
ProxyGeneratorpublic ProxyGenerator()
 
- 
- 
Method Details- 
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
 
- 
getOverride
- 
setOverride
- 
instantiateAggregateFromBaseClass
- 
instantiateAggregateFromBaseClass
- 
instantiateAggregateFromBaseClass
- 
instantiateAggregateFromBaseClass
- 
instantiateAggregateFromBaseClasspublic GroovyObject instantiateAggregateFromBaseClass(Map map, Class clazz, Object[] constructorArgs) 
- 
instantiateAggregateFromInterface
- 
instantiateAggregateFromInterface
- 
instantiateAggregate
- 
instantiateAggregate
- 
instantiateAggregate
- 
instantiateAggregate
- 
instantiateDelegate
- 
instantiateDelegate
- 
instantiateDelegate
- 
instantiateDelegateWithBaseClasspublic GroovyObject instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate) 
- 
instantiateDelegateWithBaseClass
- 
instantiateDelegateWithBaseClasspublic GroovyObject instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate, Class baseClass, 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
 
 
-