Package groovy.lang
Class Binding
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.Binding
- All Implemented Interfaces:
- GroovyObject
- Direct Known Subclasses:
- FactoryBuilderSupport,- ServletBinding
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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetProperty(String property) Overloaded to make variables appear as bean properties or via the subscript operatorgetVariable(String name) booleanhasVariable(String name) Simple check for whether the binding contains a particular variable or not.voidremoveVariable(String name) remove the variable with the specified namevoidsetProperty(String property, Object newValue) Overloaded to make variables appear as bean properties or via the subscript operatorvoidsetVariable(String name, Object value) Sets the value of the given variableMethods inherited from class groovy.lang.GroovyObjectSupportgetMetaClass, setMetaClassMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface groovy.lang.GroovyObjectinvokeMethod
- 
Constructor Details- 
Bindingpublic Binding()
- 
Binding
- 
BindingA helper constructor used in main(String[]) method calls- Parameters:
- args- are the command line arguments from a main()
 
 
- 
- 
Method Details- 
getVariable- Parameters:
- name- the name of the variable to lookup
- Returns:
- the variable value
 
- 
setVariableSets the value of the given variable- Parameters:
- name- the name of the variable to set
- value- the new value for the given variable
 
- 
removeVariableremove the variable with the specified name- Parameters:
- name- the name of the variable to remove
 
- 
hasVariableSimple check for whether the binding contains a particular variable or not.- Parameters:
- name- the name of the variable to check for
 
- 
getVariables
- 
getPropertyOverloaded to make variables appear as bean properties or via the subscript operator- Parameters:
- property- the name of the property of interest
- Returns:
- the given property
 
- 
setPropertyOverloaded to make variables appear as bean properties or via the subscript operator- Parameters:
- property- the name of the property of interest
- newValue- the new value for the property
 
 
-