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.
- Version:
- $Revision: 14401 $
- Author:
- James Strachan
Field Summary |
private java.util.Map |
variables
|
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()
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
variables
private java.util.Map variables
Binding
public Binding()
Binding
public Binding(java.util.Map variables)
Binding
public Binding(java.lang.String[] args)
- A helper constructor used in main(String[]) method calls
- Parameters:
args
- are the command line arguments from a main()
getVariable
public java.lang.Object getVariable(java.lang.String name)
- Parameters:
name
- the name of the variable to lookup
- Returns:
- the variable value
setVariable
public 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 setvalue
- the new value for the given variable
getVariables
public java.util.Map getVariables()
getProperty
public java.lang.Object getProperty(java.lang.String property)
- Overloaded to make variables appear as bean properties or via the subscript operator
- Specified by:
getProperty
in interface GroovyObject
- Overrides:
getProperty
in class GroovyObjectSupport
- Parameters:
property
- the name of the property of interest
- Returns:
- the given property
setProperty
public 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:
setProperty
in interface GroovyObject
- Overrides:
setProperty
in class GroovyObjectSupport
- Parameters:
property
- the name of the property of interestnewValue
- the new value for the property
Copyright © ${year} The Codehaus. All Rights Reserved.