|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.lang.GroovyObjectSupport groovy.lang.Closure grails.test.AbstractClosureProxy
@SuppressWarnings({ "serial", "rawtypes" }) public abstract class AbstractClosureProxy extends groovy.lang.Closure
Skeleton implementation of a wrapper class for closures that allows you to intercept invocations of the closure. The wrapper can be used anywhere that the target closure can be used.
Field Summary |
---|
Fields inherited from class groovy.lang.Closure | |
---|---|
OWNER_FIRST, DELEGATE_FIRST, OWNER_ONLY, DELEGATE_ONLY, TO_SELF, DONE, SKIP, IDENTITY |
Constructor Summary | |
AbstractClosureProxy(groovy.lang.Closure closure)
Creates a new instance that wraps the target closure and sends profiling events to the given profiler log. |
Method Summary | |
---|---|
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 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 void
|
doAfterCall(java.lang.Object[] args)
This method is called after the target closure is invoked. |
protected 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 |
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)
|
Methods inherited from class groovy.lang.Closure | |
---|---|
groovy.lang.Closure#setDelegate(java.lang.Object), groovy.lang.Closure#call([Ljava.lang.Object;), groovy.lang.Closure#call(), groovy.lang.Closure#call(java.lang.Object), groovy.lang.Closure#setResolveStrategy(int), groovy.lang.Closure#getMaximumNumberOfParameters(), groovy.lang.Closure#getResolveStrategy(), groovy.lang.Closure#getThisObject(), groovy.lang.Closure#getDelegate(), groovy.lang.Closure#getDirective(), groovy.lang.Closure#setDirective(int), groovy.lang.Closure#isCase(java.lang.Object), groovy.lang.Closure#asWritable(), groovy.lang.Closure#curry(java.lang.Object), groovy.lang.Closure#curry([Ljava.lang.Object;), groovy.lang.Closure#rcurry(java.lang.Object), groovy.lang.Closure#rcurry([Ljava.lang.Object;), groovy.lang.Closure#ncurry(int, java.lang.Object), groovy.lang.Closure#ncurry(int, [Ljava.lang.Object;), groovy.lang.Closure#rightShift(groovy.lang.Closure), groovy.lang.Closure#leftShift(java.lang.Object), groovy.lang.Closure#leftShift(groovy.lang.Closure), groovy.lang.Closure#memoize(), groovy.lang.Closure#memoizeAtMost(int), groovy.lang.Closure#memoizeAtLeast(int), groovy.lang.Closure#memoizeBetween(int, int), groovy.lang.Closure#trampoline([Ljava.lang.Object;), groovy.lang.Closure#trampoline(), groovy.lang.Closure#dehydrate(), groovy.lang.Closure#rehydrate(java.lang.Object, java.lang.Object, java.lang.Object), groovy.lang.Closure#run(), groovy.lang.Closure#setProperty(java.lang.String, java.lang.Object), groovy.lang.Closure#getProperty(java.lang.String), groovy.lang.Closure#clone(), groovy.lang.Closure#getOwner(), groovy.lang.Closure#getParameterTypes(), groovy.lang.Closure#getMetaClass(), groovy.lang.Closure#setMetaClass(groovy.lang.MetaClass), groovy.lang.Closure#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Closure#wait(), groovy.lang.Closure#wait(long, int), groovy.lang.Closure#wait(long), groovy.lang.Closure#equals(java.lang.Object), groovy.lang.Closure#toString(), groovy.lang.Closure#hashCode(), groovy.lang.Closure#getClass(), groovy.lang.Closure#notify(), groovy.lang.Closure#notifyAll() |
Methods inherited from class groovy.lang.GroovyObjectSupport | |
---|---|
groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() |
Constructor Detail |
---|
public AbstractClosureProxy(groovy.lang.Closure closure)
closure
- The target closure to wrap.
Method Detail |
---|
@Override public groovy.lang.Closure asWritable()
@Override public java.lang.Object call(java.lang.Object... objects)
protected groovy.lang.Closure createWrapper(groovy.lang.Closure c)
return new MyClosureProxy(c, this.field1, ...)
c
- The closure to wrap/proxy.
@Override public groovy.lang.Closure curry(java.lang.Object... objects)
protected void doAfterCall(java.lang.Object[] args)
args
- The arguments passed to the closure.
protected void doBeforeCall(java.lang.Object[] args)
args
- The arguments passed to the closure.
@Override public boolean equals(java.lang.Object obj)
true
if the given object is the
target closure for this wrapper as well.
@Override public java.lang.Object getDelegate()
@Override public int getDirective()
@Override public int getMaximumNumberOfParameters()
@Override public java.lang.Class[] getParameterTypes()
@Override public java.lang.Object getProperty(java.lang.String property)
@Override public int getResolveStrategy()
@Override public int hashCode()
@Override public boolean isCase(java.lang.Object o)
@Override public void setDelegate(java.lang.Object o)
@Override public void setDirective(int i)
@Override public void setProperty(java.lang.String s, java.lang.Object o)
@Override public void setResolveStrategy(int i)
Groovy Documentation