|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovy.lang.GroovyObjectSupport
groovy.lang.Binding
public class Binding
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 multithreaded context.
Constructor Summary | |
---|---|
Binding()
|
|
Binding(java.util.Map variables)
|
|
Binding(java.lang.String[] args)
A helper constructor used in main(String[]) method calls |
Method Summary | |
---|---|
java.lang.Object |
getProperty(java.lang.String property)
Overloaded to make variables appear as bean properties or via the subscript operator |
java.lang.Object |
getVariable(java.lang.String name)
|
java.util.Map |
getVariables()
|
boolean |
hasVariable(java.lang.String name)
Simple check for whether the binding contains a particular variable or not. |
void |
setProperty(java.lang.String property,
java.lang.Object newValue)
Overloaded to make variables appear as bean properties or via the subscript operator |
void |
setVariable(java.lang.String name,
java.lang.Object value)
Sets the value of the given variable |
Methods inherited from class groovy.lang.GroovyObjectSupport |
---|
getMetaClass, invokeMethod, setMetaClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Binding()
public Binding(java.util.Map variables)
public Binding(java.lang.String[] args)
args
- are the command line arguments from a main()Method Detail |
---|
public java.lang.Object getVariable(java.lang.String name)
name
- the name of the variable to lookup
public void setVariable(java.lang.String name, java.lang.Object value)
name
- the name of the variable to setvalue
- the new value for the given variablepublic boolean hasVariable(java.lang.String name)
name
- the name of the variable to check forpublic java.util.Map getVariables()
public java.lang.Object getProperty(java.lang.String property)
getProperty
in interface GroovyObject
getProperty
in class GroovyObjectSupport
property
- the name of the property of interest
public void setProperty(java.lang.String property, java.lang.Object newValue)
setProperty
in interface GroovyObject
setProperty
in class GroovyObjectSupport
property
- the name of the property of interestnewValue
- the new value for the property
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |