Class ScriptReference

java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.Reference
org.codehaus.groovy.runtime.ScriptReference
All Implemented Interfaces:
GroovyObject, Serializable

public class ScriptReference extends Reference
Represents a reference to a variable in a script
See Also:
  • Constructor Details

    • ScriptReference

      public ScriptReference(Script script, String variable)
      Constructs a ScriptReference to a variable in the given script.
      Parameters:
      script - the script instance
      variable - the name of the variable to reference
  • Method Details

    • get

      public Object get()
      Gets the current value of the referenced variable.
      Overrides:
      get in class Reference
      Returns:
      the variable value from the script binding
    • set

      public void set(Object value)
      Sets the value of the referenced variable.
      Overrides:
      set in class Reference
      Parameters:
      value - the value to set in the script binding