Package groovy.ui
Class InteractiveShell
- java.lang.Object
-
- groovy.ui.InteractiveShell
-
- All Implemented Interfaces:
java.lang.Runnable
@Deprecated public class InteractiveShell extends java.lang.Object implements java.lang.Runnable
Deprecated.A simple interactive shell for evaluating groovy expressions on the command line (aka. groovysh).- Version:
- $Revision$
- Author:
- James Strachan, Chris Poirier, Yuri Schimke, Brian McCallistair, Guillaume Laforge, Dierk Koenig, include the inspect command, June 2005, Jason Dillon
-
-
Constructor Summary
Constructors Constructor Description InteractiveShell()
Deprecated.Default constructor, initializes uses new binding and system streams.InteractiveShell(Binding binding, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
Deprecated.Constructs a new InteractiveShell instanceInteractiveShell(java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
Deprecated.Constructs a new InteractiveShell instanceInteractiveShell(java.lang.ClassLoader parent, Binding binding, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
Deprecated.Constructs a new InteractiveShell instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
Deprecated.Entry point when called directly.protected java.lang.String
read()
Deprecated.Reads a single statement from the command line.protected void
reset()
Deprecated.Resets the command-line processing machinery after use.void
run()
Deprecated.Reads commands and statements from input stream and processes them.void
setAfterExecution(Closure afterExecution)
Deprecated.A closure that is executed after the execution of the last script.void
setBeforeExecution(Closure beforeExecution)
Deprecated.A closure that is executed before the execution of a given script
-
-
-
Constructor Detail
-
InteractiveShell
public InteractiveShell() throws java.io.IOException
Deprecated.Default constructor, initializes uses new binding and system streams.- Throws:
java.io.IOException
-
InteractiveShell
public InteractiveShell(java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err) throws java.io.IOException
Deprecated.Constructs a new InteractiveShell instance- Parameters:
in
- The input stream to useout
- The output stream to useerr
- The error stream to use- Throws:
java.io.IOException
-
InteractiveShell
public InteractiveShell(Binding binding, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err) throws java.io.IOException
Deprecated.Constructs a new InteractiveShell instance- Parameters:
binding
- The binding instancein
- The input stream to useout
- The output stream to useerr
- The error stream to use- Throws:
java.io.IOException
-
InteractiveShell
public InteractiveShell(java.lang.ClassLoader parent, Binding binding, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err) throws java.io.IOException
Deprecated.Constructs a new InteractiveShell instance- Parameters:
parent
- The parent ClassLoaderbinding
- The binding instancein
- The input stream to useout
- The output stream to useerr
- The error stream to use- Throws:
java.io.IOException
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
Deprecated.Entry point when called directly.
-
run
public void run()
Deprecated.Reads commands and statements from input stream and processes them.- Specified by:
run
in interfacejava.lang.Runnable
-
setBeforeExecution
public void setBeforeExecution(Closure beforeExecution)
Deprecated.A closure that is executed before the execution of a given script- Parameters:
beforeExecution
- The closure to execute
-
setAfterExecution
public void setAfterExecution(Closure afterExecution)
Deprecated.A closure that is executed after the execution of the last script. The result of the execution is passed as the first argument to the closure (the value of 'it')- Parameters:
afterExecution
- The closure to execute
-
reset
protected void reset()
Deprecated.Resets the command-line processing machinery after use.
-
read
protected java.lang.String read()
Deprecated.Reads a single statement from the command line. Also identifies and processes command shell commands. Returns the command text on success, or null when command processing is complete. NOTE: Changed, for now, to read until 'execute' is issued. At 'execute', the statement must be complete.
-
-