public class Binding extends GroovyObjectSupport
Represents the variable bindings of a script which can be altered from outside the script object or created outside of a script and passed into it.
Binding instances are not supposed to be used in a multi-threaded context.
| Constructor and description |
|---|
Binding
() |
Binding
(Map variables) |
Binding
(String[] args)A helper constructor used in main(String[]) method calls |
| Type Params | Return Type | Name and description |
|---|---|---|
public Object |
getProperty(String property)Overloaded to make variables appear as bean properties or via the subscript operator | |
public Object |
getVariable(String name)
| |
public Map |
getVariables() | |
public boolean |
hasVariable(String name)Simple check for whether the binding contains a particular variable or not. | |
public void |
removeVariable(String name)remove the variable with the specified name | |
public void |
setProperty(String property, Object newValue)Overloaded to make variables appear as bean properties or via the subscript operator | |
public void |
setVariable(String name, Object value)Sets the value of the given variable |
| Methods inherited from class | Name |
|---|---|
class GroovyObjectSupport | getMetaClass, setMetaClass |
A helper constructor used in main(String[]) method calls
args - are the command line arguments from a main()Overloaded to make variables appear as bean properties or via the subscript operator
name - the name of the variable to lookupSimple check for whether the binding contains a particular variable or not.
name - the name of the variable to check forremove the variable with the specified name
name - the name of the variable to removeOverloaded to make variables appear as bean properties or via the subscript operator
Sets the value of the given variable
name - the name of the variable to setvalue - the new value for the given variable
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/groovy/lang/Binding.html