public class Binding extends GroovyObjectSupport
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
|
Modifier and Type | Method and Description |
---|---|
Object |
getProperty(String property)
Overloaded to make variables appear as bean properties or via the subscript operator
|
Object |
getVariable(String name) |
Map |
getVariables() |
boolean |
hasVariable(String name)
Simple check for whether the binding contains a particular variable or not.
|
void |
setProperty(String property,
Object newValue)
Overloaded to make variables appear as bean properties or via the subscript operator
|
void |
setVariable(String name,
Object value)
Sets the value of the given variable
|
getMetaClass, invokeMethod, setMetaClass
public Binding()
public Binding(Map variables)
public Binding(String[] args)
args
- are the command line arguments from a main()public Object getVariable(String name)
name
- the name of the variable to lookuppublic void setVariable(String name, Object value)
name
- the name of the variable to setvalue
- the new value for the given variablepublic boolean hasVariable(String name)
name
- the name of the variable to check forpublic Map getVariables()
public Object getProperty(String property)
getProperty
in interface GroovyObject
getProperty
in class GroovyObjectSupport
property
- the name of the property of interestpublic void setProperty(String property, Object newValue)
setProperty
in interface GroovyObject
setProperty
in class GroovyObjectSupport
property
- the name of the property of interestnewValue
- the new value for the property