## groovy.util
Class ProxyGenerator

Classes to generate 'Proxy' objects which implement interfaces and/or extend classes.

author:
  Paul King

author:
  Guillaume Laforge

Field Summary
`ProxyGenerator` | `INSTANCE`
`boolean` | `debug`
`ClassLoader` | `override`

Constructor Summary
`ProxyGenerator()`

Method Summary
`void` | `addMapOrDummyCall(Map map, StringBuffer buffer, Method method)`
`void` | `addMethodBody(StringBuffer buffer, Method method, def parameterTypes)`
`def` | `addMethodPrefix(StringBuffer buffer, Method method)`
`void` | `addMethodSuffix(StringBuffer buffer)`
`void` | `addNewMapCall(StringBuffer buffer, String methodName)`
`void` | `addOverridingMapCall(StringBuffer buffer, Method method)`
`void` | `addWrappedCall(StringBuffer buffer, Method method, Map map)`
`void` | `addWrappedMethodBody(StringBuffer buffer, Method method, def parameterTypes)`
`boolean` | `containsEquivalentMethod(List publicAndProtectedMethods, Method candidate)`
`boolean` | `getDebug()`
`List` | `getInheritedMethods(Class baseClass)`
`ClassLoader` | `getOverride()`
`String` | `getSimpleName(Class c)` TODO once we switch to Java 1.5 bt default, use Class#getSimpleName() directly
`boolean` | `hasMatchingParameterTypes(Method method, Method candidate)`
`Object` | `instantiateAggregate(List interfaces)`
`Object` | `instantiateAggregate(Map closureMap, List interfaces)`
`Object` | `instantiateAggregate(Map closureMap, List interfaces, Class clazz)`
`Object` | `instantiateAggregate(Map closureMap, List interfaces, Class clazz, def constructorArgs)`
`Object` | `instantiateAggregateFromBaseClass(Class clazz)`
`Object` | `instantiateAggregateFromBaseClass(Map map, Class clazz)`
`Object` | `instantiateAggregateFromBaseClass(Map map, Class clazz, def constructorArgs)`
`Object` | `instantiateAggregateFromInterface(Class clazz)`
`Object` | `instantiateAggregateFromInterface(Map map, Class clazz)`
`Object` | `instantiateDelegate(Object delegate)`
`Object` | `instantiateDelegate(List interfaces, Object delegate)`
`Object` | `instantiateDelegate(Map closureMap, List interfaces, Object delegate)`
`Object` | `instantiateDelegateWithBaseClass(Map closureMap, List interfaces, Object delegate)`
`Object` | `instantiateDelegateWithBaseClass(Map closureMap, List interfaces, Object delegate, Class baseClass)`
`Object` | `instantiateDelegateWithBaseClass(Map closureMap, List interfaces, Object delegate, Class baseClass, String name)`
`void` | `setDebug(boolean debug)`
`static void` | `setMetaClass(MetaClass metaClass)`
`void` | `setOverride(ClassLoader override)`
`String` | `shortName(String name)`

Constructor Detail

### ProxyGenerator

    ProxyGenerator()

Method Detail

### addMapOrDummyCall

    void addMapOrDummyCall(Map map, StringBuffer buffer, Method method)

### addMethodBody

    void addMethodBody(StringBuffer buffer, Method method, def parameterTypes)

### addMethodPrefix

    def addMethodPrefix(StringBuffer buffer, Method method)

### addMethodSuffix

    void addMethodSuffix(StringBuffer buffer)

### addNewMapCall

    void addNewMapCall(StringBuffer buffer, String methodName)

### addOverridingMapCall

    void addOverridingMapCall(StringBuffer buffer, Method method)

### addWrappedCall

    void addWrappedCall(StringBuffer buffer, Method method, Map map)

### addWrappedMethodBody

    void addWrappedMethodBody(StringBuffer buffer, Method method, def parameterTypes)

### containsEquivalentMethod

    boolean containsEquivalentMethod(List publicAndProtectedMethods, Method candidate)

### getDebug

    public boolean getDebug()

### getInheritedMethods

    List getInheritedMethods(Class baseClass)

### getOverride

    public ClassLoader getOverride()

### getSimpleName

    public String getSimpleName(Class c)

  TODO once we switch to Java 1.5 bt default, use Class#getSimpleName() directly
  param:
    c the class of which we want the readable simple name
  return:
    the readable simple name

### hasMatchingParameterTypes

    boolean hasMatchingParameterTypes(Method method, Method candidate)

### instantiateAggregate

    public Object instantiateAggregate(List interfaces)

### instantiateAggregate

    public Object instantiateAggregate(Map closureMap, List interfaces)

### instantiateAggregate

    public Object instantiateAggregate(Map closureMap, List interfaces, Class clazz)

### instantiateAggregate

    public Object instantiateAggregate(Map closureMap, List interfaces, Class clazz, def constructorArgs)

### instantiateAggregateFromBaseClass

    public Object instantiateAggregateFromBaseClass(Class clazz)

### instantiateAggregateFromBaseClass

    public Object instantiateAggregateFromBaseClass(Map map, Class clazz)

### instantiateAggregateFromBaseClass

    public Object instantiateAggregateFromBaseClass(Map map, Class clazz, def constructorArgs)

### instantiateAggregateFromInterface

    public Object instantiateAggregateFromInterface(Class clazz)

### instantiateAggregateFromInterface

    public Object instantiateAggregateFromInterface(Map map, Class clazz)

### instantiateDelegate

    public Object instantiateDelegate(Object delegate)

### instantiateDelegate

    public Object instantiateDelegate(List interfaces, Object delegate)

### instantiateDelegate

    public Object instantiateDelegate(Map closureMap, List interfaces, Object delegate)

### instantiateDelegateWithBaseClass

    public Object instantiateDelegateWithBaseClass(Map closureMap, List interfaces, Object delegate)

### instantiateDelegateWithBaseClass

    public Object instantiateDelegateWithBaseClass(Map closureMap, List interfaces, Object delegate, Class baseClass)

### instantiateDelegateWithBaseClass

    public Object instantiateDelegateWithBaseClass(Map closureMap, List interfaces, Object delegate, Class baseClass, String name)

### setDebug

    public void setDebug(boolean debug)

### setMetaClass

    static void setMetaClass(MetaClass metaClass)

### setOverride

    public void setOverride(ClassLoader override)

### shortName

    public String shortName(String name)