org.codehaus.groovy.runtime
Class MethodClosure
java.lang.Object
|
+--groovy.lang.GroovyObjectSupport
|
+--groovy.lang.Closure
|
+--org.codehaus.groovy.runtime.MethodClosure
- All Implemented Interfaces:
- GroovyObject
- public class MethodClosure
- extends Closure
Represents a method on an object using a closure which can be invoked
at any time
- Version:
- $Revision: 1.5 $
- Author:
- James Strachan
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MethodClosure
public MethodClosure(Object delegate)
MethodClosure
public MethodClosure(Object owner,
String method)
getMethod
public String getMethod()
call
public Object call(Object arguments)
- Description copied from class:
Closure
- Invokes the closure, returning any value if applicable.
- Overrides:
call
in class Closure
- Parameters:
arguments
- could be a single value or a List of values
- Returns:
- the value if applicable or null if there is no return statement in the closure
getMetaClass
public groovy.lang.MetaClass getMetaClass()
- Specified by:
getMetaClass
in interface GroovyObject
- Overrides:
getMetaClass
in class GroovyObjectSupport
- Returns:
- the metaClass of this instance
setMetaClass
public void setMetaClass(groovy.lang.MetaClass metaClass)
- Description copied from interface:
GroovyObject
- Allows the MetaClass to be replaced with a derived implementation
- Specified by:
setMetaClass
in interface GroovyObject
- Overrides:
setMetaClass
in class GroovyObjectSupport
Copyright © 2003 The Codehaus. All Rights Reserved.