Package ghidra.app.script

# Class ScriptControls

java.lang.Object
ghidra.app.script.ScriptControls

public class ScriptControls extends Object
Class to encapsulate `GhidraScript` control mechanisms such as stdout/stderr writers and other feedback to the user

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final ScriptControls`
  `NONE`
  A `ScriptControls` that does nothing

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ScriptControls(ghidra.app.plugin.core.interpreter.InterpreterConsole console, TaskMonitor monitor)`
  Creates a new `ScriptControls` with no decorated output
  `ScriptControls(ConsoleService console, TaskMonitor monitor)`
  Creates a new `ScriptControls` with no decorated output
  `ScriptControls(OutputStream stream, OutputStream errorStream, TaskMonitor monitor)`
  Creates a new `ScriptControls` with no decorated output
  `ScriptControls(PrintWriter writer, PrintWriter errorWriter, boolean decorateOutput, TaskMonitor monitor)`
  Creates a new `ScriptControls`
  `ScriptControls(PrintWriter writer, PrintWriter errorWriter, TaskMonitor monitor)`
  Creates a new `ScriptControls` with no decorated output

- ## Method Summary

  Modifier and Type
  Method
  Description
  `PrintWriter`
  `getErrorWriter()`
  Returns the target of script "printerr" statements (may be null).
  `TaskMonitor`
  `getMonitor()`
  Returns A cancellable monitor.
  `PrintWriter`
  `getWriter()`
  Returns the target of script "print" statements (may be null).
  `boolean`
  `shouldDecorateOutput()`
  Returns True to decorate the writer output with a script name prefix; otherwise, false.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### NONE

    public static final ScriptControls NONE
    A `ScriptControls` that does nothing

- ## Constructor Details

  - ### ScriptControls

    public ScriptControls(PrintWriter writer, PrintWriter errorWriter, boolean decorateOutput, TaskMonitor monitor)
    Creates a new `ScriptControls`
    Parameters:
      `writer` - The target of script "print" statements (may be null)
      `errorWriter` - The target of script "printerr" statements (may be null)
      `decorateOutput` - True to decorate the writer output with a script name prefix; otherwise, false (see `GhidraScript.decorate(String)`
      `monitor` - A cancellable monitor

  - ### ScriptControls

    public ScriptControls(PrintWriter writer, PrintWriter errorWriter, TaskMonitor monitor)
    Creates a new `ScriptControls` with no decorated output
    Parameters:
      `writer` - The target of script "print" statements (may be null)
      `errorWriter` - The target of script "printerr" statements (may be null) otherwise, false (see `GhidraScript.decorate(String)`
      `monitor` - A cancellable monitor

  - ### ScriptControls

    public ScriptControls(OutputStream stream, OutputStream errorStream, TaskMonitor monitor)
    Creates a new `ScriptControls` with no decorated output
    Parameters:
      `stream` - The target of script "print" statements (may be null)
      `errorStream` - The target of script "printerr" statements (may be null) otherwise, false (see `GhidraScript.decorate(String)`
      `monitor` - A cancellable monitor

  - ### ScriptControls

    public ScriptControls(ConsoleService console, TaskMonitor monitor)
    Creates a new `ScriptControls` with no decorated output
    Parameters:
      `console` - The target of script "print" and "printerr" statements
      `monitor` - A cancellable monitor

  - ### ScriptControls

    public ScriptControls(ghidra.app.plugin.core.interpreter.InterpreterConsole console, TaskMonitor monitor)
    Creates a new `ScriptControls` with no decorated output
    Parameters:
      `console` - The target of script "print" and "printerr" statements
      `monitor` - A cancellable monitor

- ## Method Details

  - ### getWriter

    public PrintWriter getWriter()
    Returns the target of script "print" statements (may be null).
    Returns:
      the target of script "print" statements (may be null)

  - ### getErrorWriter

    public PrintWriter getErrorWriter()
    Returns the target of script "printerr" statements (may be null).
    Returns:
      the target of script "printerr" statements (may be null)

  - ### shouldDecorateOutput

    public boolean shouldDecorateOutput()
    Returns True to decorate the writer output with a script name prefix; otherwise, false.
    Returns:
      True to decorate the writer output with a script name prefix; otherwise, false
    See Also:
      - `GhidraScript.decorate(String)`

  - ### getMonitor

    public TaskMonitor getMonitor()
    Returns A cancellable monitor.
    Returns:
      A cancellable monitor