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
ClosureScript
as 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.GroovyObject
invokeMethod
in class groovy.lang.Script
public Object getProperty(String property)
getProperty
in interface groovy.lang.GroovyObject
getProperty
in class groovy.lang.Script
Copyright © 2014. All rights reserved.