public abstract class AbstractClosureProxy
extends groovy.lang.Closure
| Constructor and Description |
|---|
AbstractClosureProxy(groovy.lang.Closure<?> closure)
Creates a new instance that wraps the target closure and sends
profiling events to the given profiler log.
|
| Modifier and Type | Method and Description |
|---|---|
groovy.lang.Closure<?> |
asWritable() |
java.lang.Object |
call(java.lang.Object... objects)
This is the important one: logs entry and exit of the closure call.
|
protected abstract groovy.lang.Closure<?> |
createWrapper(groovy.lang.Closure<?> c)
Called when a new instance of the proxy needs to be created for
the given closure.
|
groovy.lang.Closure<?> |
curry(java.lang.Object... objects) |
protected abstract void |
doAfterCall(java.lang.Object[] args)
This method is called after the target closure is invoked.
|
protected abstract void |
doBeforeCall(java.lang.Object[] args)
This method is called before the target closure is invoked.
|
boolean |
equals(java.lang.Object obj)
Compares based on identities, but unlike the standard implementation
this one will return
true if the given object is the
target closure for this wrapper as well. |
java.lang.Object |
getDelegate() |
int |
getDirective() |
int |
getMaximumNumberOfParameters() |
java.lang.Class<?>[] |
getParameterTypes() |
java.lang.Object |
getProperty(java.lang.String property) |
int |
getResolveStrategy() |
int |
hashCode() |
boolean |
isCase(java.lang.Object o) |
void |
setDelegate(java.lang.Object o) |
void |
setDirective(int i) |
void |
setProperty(java.lang.String s,
java.lang.Object o) |
void |
setResolveStrategy(int i) |
call, call, clone, curry, dehydrate, getOwner, getThisObject, leftShift, leftShift, memoize, memoizeAtLeast, memoizeAtMost, memoizeBetween, ncurry, ncurry, rcurry, rcurry, rehydrate, rightShift, run, throwRuntimeException, trampoline, trampolinepublic AbstractClosureProxy(groovy.lang.Closure<?> closure)
closure - The target closure to wrap.protected abstract void doBeforeCall(java.lang.Object[] args)
args - The arguments passed to the closure.protected abstract void doAfterCall(java.lang.Object[] args)
args - The arguments passed to the closure.protected abstract groovy.lang.Closure<?> createWrapper(groovy.lang.Closure<?> c)
return new MyClosureProxy(c, this.field1, ...)
c - The closure to wrap/proxy.public java.lang.Object call(java.lang.Object... objects)
call in class groovy.lang.Closurepublic boolean equals(java.lang.Object obj)
true if the given object is the
target closure for this wrapper as well.equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic groovy.lang.Closure<?> curry(java.lang.Object... objects)
curry in class groovy.lang.Closurepublic boolean isCase(java.lang.Object o)
isCase in class groovy.lang.Closurepublic groovy.lang.Closure<?> asWritable()
asWritable in class groovy.lang.Closurepublic java.lang.Object getProperty(java.lang.String property)
getProperty in interface groovy.lang.GroovyObjectgetProperty in class groovy.lang.Closurepublic void setProperty(java.lang.String s,
java.lang.Object o)
setProperty in interface groovy.lang.GroovyObjectsetProperty in class groovy.lang.Closurepublic int getMaximumNumberOfParameters()
getMaximumNumberOfParameters in class groovy.lang.Closurepublic java.lang.Class<?>[] getParameterTypes()
getParameterTypes in class groovy.lang.Closurepublic java.lang.Object getDelegate()
getDelegate in class groovy.lang.Closurepublic void setDelegate(java.lang.Object o)
setDelegate in class groovy.lang.Closurepublic int getDirective()
getDirective in class groovy.lang.Closurepublic void setDirective(int i)
setDirective in class groovy.lang.Closurepublic int getResolveStrategy()
getResolveStrategy in class groovy.lang.Closurepublic void setResolveStrategy(int i)
setResolveStrategy in class groovy.lang.Closure