|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovy.lang.GroovyObjectSupport
groovy.lang.Closure
Represents any closure object in Groovy.
Field Summary | |
static int |
DONE
|
static int |
SKIP
|
Constructor Summary | |
Closure(Object delegate)
|
Method Summary | |
Closure |
asWritable()
|
Object |
call()
Invokes the closure without any parameters, returning any value if applicable. |
Object |
call(Object arguments)
Invokes the closure, returning any value if applicable. |
Object |
callSpecial(Object arguments)
|
Object |
clone()
|
Closure |
curry(Object[] arguments)
Support for closure currying |
protected Object |
doCall()
An attempt to optimise calling closures with no parameter This method only calls doCall(Object) and will be called by call(Object) if the parameter given to call is an empty Object array |
protected Object |
doCall(Object p1)
An attempt to optimise calling closures with one parameter If the closure has one untyped parameter then it will overload this function If not this will be called ans will use reflection to deal with the case of a single typed parameter |
protected Object |
doCall(Object p1,
Object p2)
An attempt to optimise calling closures with two parameters If the closure has two untyped parameters then it will overload this function If not this will be called ans will use reflection to deal with the case of one or two typed parameters |
Object |
getDelegate()
|
int |
getDirective()
|
String |
getMethod()
Used when a closure wraps a method on a class |
Object |
getOwner()
|
Class[] |
getParameterTypes()
|
Object |
getProperty(String property)
|
Object |
invokeMethod(String method,
Object arguments)
Invokes the given method |
boolean |
isCase(Object candidate)
|
void |
run()
|
void |
setDelegate(Object delegate)
Allows the delegate to be changed such as when performing markup building |
void |
setDirective(int directive)
|
void |
setProperty(String property,
Object newValue)
Sets the given property to the new value |
protected static Object |
throwRuntimeException(Throwable throwable)
|
Methods inherited from class groovy.lang.GroovyObjectSupport |
getMetaClass, setMetaClass |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int DONE
public static int SKIP
Constructor Detail |
public Closure(Object delegate)
Method Detail |
public Object invokeMethod(String method, Object arguments)
GroovyObject
invokeMethod
in interface GroovyObject
invokeMethod
in class GroovyObjectSupport
public Object getProperty(String property)
getProperty
in interface GroovyObject
getProperty
in class GroovyObjectSupport
public void setProperty(String property, Object newValue)
GroovyObject
setProperty
in interface GroovyObject
setProperty
in class GroovyObjectSupport
public boolean isCase(Object candidate)
public Object call()
public Object call(Object arguments)
arguments
- could be a single value or a List of values
public Object callSpecial(Object arguments)
protected static Object throwRuntimeException(Throwable throwable)
protected Object doCall(Object p1)
p1
-
protected Object doCall()
protected Object doCall(Object p1, Object p2)
p1
-
public String getMethod()
public Object getOwner()
public Object getDelegate()
public void setDelegate(Object delegate)
delegate
- public Class[] getParameterTypes()
public Closure asWritable()
public void run()
run
in interface Runnable
public Closure curry(Object[] arguments)
arguments
- public Object clone()
public int getDirective()
public void setDirective(int directive)
directive
- The directive to set.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |