|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgroovy.lang.GroovyObjectSupport
groovy.lang.Closure
groovy.lang.Closure.WritableClosure
private class Closure.WritableClosure
Implementation note: This has to be an inner class! Reason: Closure.this.call will call the outer call method, but with the inner class as executing object. This means any invokeMethod or getProperty call will be called on this inner class instead of the outer!
| Field Summary |
|---|
| Fields inherited from class groovy.lang.Closure |
|---|
DELEGATE_FIRST, DELEGATE_ONLY, DONE, maximumNumberOfParameters, OWNER_FIRST, OWNER_ONLY, parameterTypes, SKIP, TO_SELF |
| Constructor Summary | |
|---|---|
Closure.WritableClosure()
|
|
| Method Summary | |
|---|---|
Closure |
asWritable()
|
java.lang.Object |
call()
Invokes the closure without any parameters, returning any value if applicable. |
java.lang.Object |
call(java.lang.Object arguments)
Invokes the closure, returning any value if applicable. |
java.lang.Object |
call(java.lang.Object[] args)
|
java.lang.Object |
clone()
|
Closure |
curry(java.lang.Object[] arguments)
Support for closure currying |
java.lang.Object |
doCall(java.lang.Object[] args)
|
boolean |
equals(java.lang.Object arg0)
|
java.lang.Object |
getDelegate()
|
int |
getMaximumNumberOfParameters()
|
java.lang.Class[] |
getParameterTypes()
|
java.lang.Object |
getProperty(java.lang.String property)
Retrieves a property value. |
int |
getResolveStrategy()
Gets the strategy which the closure users to resolve methods and properties |
int |
hashCode()
|
java.lang.Object |
invokeMethod(java.lang.String method,
java.lang.Object arguments)
Invokes the given method. |
void |
run()
|
void |
setDelegate(java.lang.Object delegate)
Allows the delegate to be changed such as when performing markup building |
void |
setProperty(java.lang.String property,
java.lang.Object newValue)
Sets the given property to the new value. |
void |
setResolveStrategy(int resolveStrategy)
Sets the strategy which the closure uses to resolve property references. |
java.lang.String |
toString()
|
java.io.Writer |
writeTo(java.io.Writer out)
writes this object to the given stream |
| Methods inherited from class groovy.lang.Closure |
|---|
getDirective, getOwner, getThisObject, isCase, setDirective, throwRuntimeException |
| Methods inherited from class groovy.lang.GroovyObjectSupport |
|---|
getMetaClass, setMetaClass |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Closure.WritableClosure()
| Method Detail |
|---|
public java.io.Writer writeTo(java.io.Writer out)
throws java.io.IOException
Writable
writeTo in interface Writablejava.io.IOException
public java.lang.Object invokeMethod(java.lang.String method,
java.lang.Object arguments)
GroovyObject
invokeMethod in interface GroovyObjectinvokeMethod in class GroovyObjectSupportmethod - the name of the method to callarguments - the arguments to use for the method call
public java.lang.Object getProperty(java.lang.String property)
GroovyObject
getProperty in interface GroovyObjectgetProperty in class Closureproperty - the name of the property of interest
public void setProperty(java.lang.String property,
java.lang.Object newValue)
GroovyObject
setProperty in interface GroovyObjectsetProperty in class Closureproperty - the name of the property of interestnewValue - the new value for the propertypublic java.lang.Object call()
Closure
call in class Closurepublic java.lang.Object call(java.lang.Object arguments)
Closure
call in class Closurearguments - could be a single value or a List of values
public java.lang.Object call(java.lang.Object[] args)
call in class Closurepublic java.lang.Object doCall(java.lang.Object[] args)
public java.lang.Object getDelegate()
getDelegate in class Closurepublic void setDelegate(java.lang.Object delegate)
Closure
setDelegate in class Closuredelegate - the new delegatepublic java.lang.Class[] getParameterTypes()
getParameterTypes in class Closurepublic int getMaximumNumberOfParameters()
getMaximumNumberOfParameters in class Closurepublic Closure asWritable()
asWritable in class Closurepublic void run()
run in interface java.lang.Runnablerun in class Closurepublic java.lang.Object clone()
clone in class Closurepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object arg0)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic Closure curry(java.lang.Object[] arguments)
Closure
curry in class Closurearguments - the arguments to bind
public void setResolveStrategy(int resolveStrategy)
Closure
setResolveStrategy in class ClosureresolveStrategy - The resolve strategy to setClosure.DELEGATE_FIRST,
Closure.DELEGATE_ONLY,
Closure.OWNER_FIRST,
Closure.OWNER_ONLY,
Closure.TO_SELFpublic int getResolveStrategy()
Closure
getResolveStrategy in class ClosureClosure.DELEGATE_FIRST,
Closure.DELEGATE_ONLY,
Closure.OWNER_FIRST,
Closure.OWNER_ONLY,
Closure.TO_SELF
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||