Package groovy.lang
Class Binding
- java.lang.Object
- 
- groovy.lang.GroovyObjectSupport
- 
- groovy.lang.Binding
 
 
- 
- All Implemented Interfaces:
- GroovyObject
 - Direct Known Subclasses:
- FactoryBuilderSupport,- ServletBinding
 
 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. 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetProperty(java.lang.String property)Overloaded to make variables appear as bean properties or via the subscript operatorjava.lang.ObjectgetVariable(java.lang.String name)java.util.MapgetVariables()booleanhasVariable(java.lang.String name)Simple check for whether the binding contains a particular variable or not.voidsetProperty(java.lang.String property, java.lang.Object newValue)Overloaded to make variables appear as bean properties or via the subscript operatorvoidsetVariable(java.lang.String name, java.lang.Object value)Sets the value of the given variable- 
Methods inherited from class groovy.lang.GroovyObjectSupportgetMetaClass, invokeMethod, setMetaClass
 
- 
 
- 
- 
- 
Method Detail- 
getVariablepublic java.lang.Object getVariable(java.lang.String name) - Parameters:
- name- the name of the variable to lookup
- Returns:
- the variable value
 
 - 
setVariablepublic void setVariable(java.lang.String name, java.lang.Object value)Sets the value of the given variable- Parameters:
- name- the name of the variable to set
- value- the new value for the given variable
 
 - 
hasVariablepublic boolean hasVariable(java.lang.String name) Simple check for whether the binding contains a particular variable or not.- Parameters:
- name- the name of the variable to check for
 
 - 
getVariablespublic java.util.Map getVariables() 
 - 
getPropertypublic java.lang.Object getProperty(java.lang.String property) Overloaded to make variables appear as bean properties or via the subscript operator- Specified by:
- getPropertyin interface- GroovyObject
- Overrides:
- getPropertyin class- GroovyObjectSupport
- Parameters:
- property- the name of the property of interest
- Returns:
- the given property
 
 - 
setPropertypublic void setProperty(java.lang.String property, java.lang.Object newValue)Overloaded to make variables appear as bean properties or via the subscript operator- Specified by:
- setPropertyin interface- GroovyObject
- Overrides:
- setPropertyin class- GroovyObjectSupport
- Parameters:
- property- the name of the property of interest
- newValue- the new value for the property
 
 
- 
 
-