| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final LRUCache | adapterCache
The adapter cache is used to cache proxy classes. |
| private boolean | |
| private static final Map | |
| private boolean | |
| public static final ProxyGenerator | |
| private ClassLoader |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private ProxyGeneratorAdapter | |
| public boolean | |
| public boolean | |
| public ClassLoader | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | |
| public GroovyObject | Returns: a proxy object implementing the specified interfaces, and delegating to the provided objectthe closure for methods not handled by the delegate closureMap, List<Class<T>> interfaces to be implemented interfaces, Object the delegate object delegate, Class<T> the base class baseClass, String the name of the proxy, unused, but kept for compatibility with previous versions of Groovy. name)Creates a proxy with a delegate object. |
| public void | setDebug(boolean
true if you want generated source to be printed debug)Instructs |
| public void | setEmptyMethods(boolean
true if you want generated methods to be empty emptyMethods)Changes generated methods to have empty implementations. |
| private static void | |
| public void |
| adapterCache | back to summary |
|---|---|
| private final LRUCache<ProxyGenerator. The adapter cache is used to cache proxy classes. When, for example, a call like: map as MyClass is found, then a lookup is made into the cache to find if a suitable adapter already exists. If so, then the class is reused, instead of generating a new class. | |
| debug | back to summary |
|---|---|
| private boolean debug | |
| EMPTY_CLOSURE_MAP | back to summary |
|---|---|
| private static final Map<Object, Object> EMPTY_CLOSURE_MAP | |
| emptyMethods | back to summary |
|---|---|
| private boolean emptyMethods | |
| INSTANCE | back to summary |
|---|---|
| public static final ProxyGenerator INSTANCE | |
| override | back to summary |
|---|---|
| private ClassLoader override | |
| ProxyGenerator | back to summary |
|---|---|
| public ProxyGenerator() | |
| createAdapter | back to summary |
|---|---|
| private ProxyGeneratorAdapter createAdapter(final Map<Object, Object> closureMap, final List<Class<T>> interfaceList, final Class<T> delegateClass, final Class<T> baseClass) | |
| getDebug | back to summary |
|---|---|
| public boolean getDebug() | |
| getEmptyMethods | back to summary |
|---|---|
| public boolean getEmptyMethods() | |
| getOverride | back to summary |
|---|---|
| public ClassLoader getOverride() | |
| instantiateAggregate | back to summary |
|---|---|
| public GroovyObject instantiateAggregate(List<Class<T>> interfaces) | |
| instantiateAggregate | back to summary |
|---|---|
| public GroovyObject instantiateAggregate(Map<K, V> closureMap, List<Class<T>> interfaces) | |
| instantiateAggregate | back to summary |
|---|---|
| public GroovyObject instantiateAggregate(Map<K, V> closureMap, List<Class<T>> interfaces, Class<T> clazz) | |
| instantiateAggregate | back to summary |
|---|---|
| public GroovyObject instantiateAggregate(Map<K, V> closureMap, List<Class<T>> interfaces, Class<T> clazz, Object[] constructorArgs) | |
| instantiateAggregateFromBaseClass | back to summary |
|---|---|
| public GroovyObject instantiateAggregateFromBaseClass(Class<T> clazz) | |
| instantiateAggregateFromBaseClass | back to summary |
|---|---|
| public GroovyObject instantiateAggregateFromBaseClass(Map<K, V> map, Class<T> clazz) | |
| instantiateAggregateFromBaseClass | back to summary |
|---|---|
| public GroovyObject instantiateAggregateFromBaseClass(Closure<V> cl, Class<T> clazz) | |
| instantiateAggregateFromBaseClass | back to summary |
|---|---|
| public GroovyObject instantiateAggregateFromBaseClass(Class<T> clazz, Object[] constructorArgs) | |
| instantiateAggregateFromBaseClass | back to summary |
|---|---|
| public GroovyObject instantiateAggregateFromBaseClass(Map<K, V> map, Class<T> clazz, Object[] constructorArgs) | |
| instantiateAggregateFromInterface | back to summary |
|---|---|
| public GroovyObject instantiateAggregateFromInterface(Class<T> clazz) | |
| instantiateAggregateFromInterface | back to summary |
|---|---|
| public GroovyObject instantiateAggregateFromInterface(Map<K, V> map, Class<T> clazz) | |
| instantiateDelegate | back to summary |
|---|---|
| public GroovyObject instantiateDelegate(Object delegate) | |
| instantiateDelegate | back to summary |
|---|---|
| public GroovyObject instantiateDelegate(List<Class<T>> interfaces, Object delegate) | |
| instantiateDelegate | back to summary |
|---|---|
| public GroovyObject instantiateDelegate(Map<K, V> closureMap, List<Class<T>> interfaces, Object delegate) | |
| instantiateDelegateWithBaseClass | back to summary |
|---|---|
| public GroovyObject instantiateDelegateWithBaseClass(Map<K, V> closureMap, List<Class<T>> interfaces, Object delegate) | |
| instantiateDelegateWithBaseClass | back to summary |
|---|---|
| public GroovyObject instantiateDelegateWithBaseClass(Map<K, V> closureMap, List<Class<T>> interfaces, Object delegate, Class<T> baseClass) | |
| instantiateDelegateWithBaseClass | back to summary |
|---|---|
| public GroovyObject instantiateDelegateWithBaseClass(Map<K, V> closureMap, List<Class<T>> interfaces, Object delegate, Class<T> baseClass, String name) Creates a proxy with a delegate object.
| |
| setDebug | back to summary |
|---|---|
| public void setDebug(boolean debug) Instructs
| |
| setEmptyMethods | back to summary |
|---|---|
| public 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
| |
| setMetaClass | back to summary |
|---|---|
| private static void setMetaClass(final MetaClass metaClass) | |
| setOverride | back to summary |
|---|---|
| public void setOverride(ClassLoader override) | |
| Modifier and Type | Class and Description |
|---|---|
| private static class | ProxyGenerator.CacheKey.ClassReference
A weak reference which delegates equals and hashcode to the referent. |
| Modifier and Type | Field and Description |
|---|---|
| private final ProxyGenerator. | |
| private final ProxyGenerator. | |
| private final boolean | |
| private static final Comparator | |
| private final ProxyGenerator. | |
| private final Set | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(final Object
the reference object with which to compare. o)Overrides java. |
| public int |
| baseClass | back to summary |
|---|---|
| private final ProxyGenerator. | |
| delegateClass | back to summary |
|---|---|
| private final ProxyGenerator. | |
| emptyMethods | back to summary |
|---|---|
| private final boolean emptyMethods | |
| INTERFACE_COMPARATOR | back to summary |
|---|---|
| private static final Comparator<Class<T>> INTERFACE_COMPARATOR | |
| interfaces | back to summary |
|---|---|
| private final ProxyGenerator. | |
| methods | back to summary |
|---|---|
| private final Set<String> methods | |
| useDelegate | back to summary |
|---|---|
| private final boolean useDelegate | |
| CacheKey | back to summary |
|---|---|
| private CacheKey(final Class<T> baseClass, final Class<T> delegateClass, final Set<String> methods, final Class<T>[] interfaces, final boolean emptyMethods, final boolean useDelegate) | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(final Object
the reference object with which to compare. o)Overrides java. |
| public int |
| ClassReference | back to summary |
|---|---|
| public ClassReference(Class<T> referent) | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |