Script (Groovy 5.1.0)

Package: groovy.lang

## [Java] Class Script

- groovy.lang.Script

-     public abstract class Script
      extends GroovyObjectSupport

  This object represents a Groovy script

- - ### Constructor Summary

    Constructors
    Constructor and description
    `protected Script()`
    `protected Script(Binding binding)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Object` | `evaluate(String expression)` A helper method to allow the dynamic evaluation of groovy expressions using this scripts binding as the variable scope
    `` | `public Object` | `evaluate(File file)` A helper method to allow the dynamic evaluation of groovy expressions using this scripts binding as the variable scope
    `` | `public Binding` | `getBinding()`
    `` | `public Object` | `getProperty(String property)`
    `` | `public Object` | `invokeMethod(String name, Object args)` Invoke a method (or closure in the binding) defined.
    `` | `public void` | `print(Object value)` Prints the value to the current 'out' variable which should be a PrintWriter or at least have a print() method defined on it.
    `` | `public void` | `printf(String format, Object value)` Prints a formatted string using the specified format string and argument.
    `` | `public void` | `printf(String format, Object[] values)` Prints a formatted string using the specified format string and arguments.
    `` | `public void` | `println()` Prints a newline to the current 'out' variable which should be a PrintWriter or at least have a println() method defined on it.
    `` | `public void` | `println(Object value)` Prints the value and a newline to the current 'out' variable which should be a PrintWriter or at least have a println() method defined on it.
    `` | `public abstract Object` | `run()` The main instance method of a script which has variables in scope as defined by the current Binding instance.
    `` | `public void` | `run(File file, String[] arguments)` A helper method to allow scripts to be run taking command line arguments
    `` | `public void` | `setBinding(Binding binding)`
    `` | `public void` | `setProperty(String property, Object newValue)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class GroovyObjectSupport` | `getMetaClass, setMetaClass`

- - ### Constructor Detail

    - #### protected Script()

    - #### protected Script(Binding binding)

  - ### Method Detail

    - #### public Object evaluate(String expression)

      A helper method to allow the dynamic evaluation of groovy expressions using this scripts binding as the variable scope

      Parameters:
        `expression` - is the Groovy script expression to evaluate

    - #### public Object evaluate(File file)

      A helper method to allow the dynamic evaluation of groovy expressions using this scripts binding as the variable scope

      Parameters:
        `file` - is the Groovy script to evaluate

    - #### public Binding getBinding()

    - #### @Override
      public Object getProperty(String property)

    - #### @Override
      public Object invokeMethod(String name, Object args)

      Invoke a method (or closure in the binding) defined.

      Parameters:
        `name` - method to call
        `args` - arguments to pass to the method
      Returns:
        value

    - #### public void print(Object value)

      Prints the value to the current 'out' variable which should be a PrintWriter or at least have a print() method defined on it. If there is no 'out' property then print to standard out.

    - #### public void printf(String format, Object value)

      Prints a formatted string using the specified format string and argument.

      Parameters:
        `format` - the format to follow
        `value` - the value to be formatted

    - #### public void printf(String format, Object[] values)

      Prints a formatted string using the specified format string and arguments.

      Parameters:
        `format` - the format to follow
        `values` - an array of values to be formatted

    - #### public void println()

      Prints a newline to the current 'out' variable which should be a PrintWriter or at least have a println() method defined on it. If there is no 'out' property then print to standard out.

    - #### public void println(Object value)

      Prints the value and a newline to the current 'out' variable which should be a PrintWriter or at least have a println() method defined on it. If there is no 'out' property then print to standard out.

    - #### public abstract Object run()

      The main instance method of a script which has variables in scope as defined by the current Binding instance.

    - #### public void run(File file, String[] arguments)

      A helper method to allow scripts to be run taking command line arguments

    - #### public void setBinding(Binding binding)

    - #### @Override
      public void setProperty(String property, Object newValue)