|
||||||||||
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 Writable
java.io.IOException
public java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments)
GroovyObject
invokeMethod
in interface GroovyObject
invokeMethod
in class GroovyObjectSupport
method
- 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 GroovyObject
getProperty
in class Closure
property
- the name of the property of interest
public void setProperty(java.lang.String property, java.lang.Object newValue)
GroovyObject
setProperty
in interface GroovyObject
setProperty
in class Closure
property
- the name of the property of interestnewValue
- the new value for the propertypublic java.lang.Object call()
Closure
call
in class Closure
public java.lang.Object call(java.lang.Object arguments)
Closure
call
in class Closure
arguments
- could be a single value or a List of values
public java.lang.Object call(java.lang.Object[] args)
call
in class Closure
public java.lang.Object doCall(java.lang.Object[] args)
public java.lang.Object getDelegate()
getDelegate
in class Closure
public void setDelegate(java.lang.Object delegate)
Closure
setDelegate
in class Closure
delegate
- the new delegatepublic java.lang.Class[] getParameterTypes()
getParameterTypes
in class Closure
public int getMaximumNumberOfParameters()
getMaximumNumberOfParameters
in class Closure
public Closure asWritable()
asWritable
in class Closure
public void run()
run
in interface java.lang.Runnable
run
in class Closure
public java.lang.Object clone()
clone
in class Closure
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object arg0)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Closure curry(java.lang.Object[] arguments)
Closure
curry
in class Closure
arguments
- the arguments to bind
public void setResolveStrategy(int resolveStrategy)
Closure
setResolveStrategy
in class Closure
resolveStrategy
- The resolve strategy to setClosure.DELEGATE_FIRST
,
Closure.DELEGATE_ONLY
,
Closure.OWNER_FIRST
,
Closure.OWNER_ONLY
,
Closure.TO_SELF
public int getResolveStrategy()
Closure
getResolveStrategy
in class Closure
Closure.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 |