Groovy 1.7.0

groovy.lang
Class Binding

java.lang.Object
  groovy.lang.GroovyObjectSupport
      groovy.lang.Binding

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.

author:
James Strachan
version:
$Revision: 14400 $


Constructor Summary
Binding()

Binding(Map variables)

Binding(String[] args)

A helper constructor used in main(String[]) method calls

 
Method Summary
Object getProperty(String property)

Overloaded to make variables appear as bean properties or via the subscript operator

Object getVariable(String name)

Map getVariables()

void setProperty(String property, Object newValue)

void setVariable(String name, Object value)

Sets the value of the given variable

 
Methods inherited from class GroovyObjectSupport
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty
 
Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Constructor Detail

Binding

public Binding()


Binding

public Binding(Map variables)


Binding

public Binding(String[] args)
A helper constructor used in main(String[]) method calls
param:
args are the command line arguments from a main()


 
Method Detail

getProperty

public Object getProperty(String property)
Overloaded to make variables appear as bean properties or via the subscript operator


getVariable

public Object getVariable(String name)
param:
name the name of the variable to lookup
return:
the variable value


getVariables

public Map getVariables()


setProperty

public void setProperty(String property, Object newValue)
todo:
we should check if we have the property with the metaClass instead of try/catch


setVariable

public void setVariable(String name, Object value)
Sets the value of the given variable
param:
name the name of the variable to set
param:
value the new value for the given variable


 

Copyright © 2003-2009 The Codehaus. All rights reserved.