public abstract class ClosureScript
extends groovy.lang.Script
Script that performs method invocations and property access like Closure does.
For example, when the script is:
a = 1; b(2);Using
ClosureScriptas the base class would run it as:delegate.a = 1; delegate.b(2);... whereas in plainScript, this will be run as:binding.setProperty("a",1); ((Closure)binding.getProperty("b")).call(2);
| Modifier | Constructor and Description |
|---|---|
protected |
ClosureScript() |
protected |
ClosureScript(groovy.lang.Binding binding) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getProperty(String property) |
Object |
invokeMethod(String name,
Object args) |
void |
setDelegate(groovy.lang.GroovyObject delegate)
Sets the delegation target.
|
void |
setProperty(String property,
Object newValue) |
protected ClosureScript()
protected ClosureScript(groovy.lang.Binding binding)
public void setDelegate(groovy.lang.GroovyObject delegate)
public Object invokeMethod(String name, Object args)
invokeMethod in interface groovy.lang.GroovyObjectinvokeMethod in class groovy.lang.Scriptpublic Object getProperty(String property)
getProperty in interface groovy.lang.GroovyObjectgetProperty in class groovy.lang.ScriptCopyright © 2019. All rights reserved.