Groovy 2.2.0

org.codehaus.groovy.tools.shell
[Groovy] Class Groovysh

java.lang.Object
  org.codehaus.groovy.tools.shell.Shell
      org.codehaus.groovy.tools.shell.Groovysh

class Groovysh
extends Shell

An interactive shell for evaluating Groovy code from the command-line (aka. groovysh).

Authors:
Jason Dillon
Version:
\$Id\$


Field Summary
static String AUTOINDENT_PREFERENCE_KEY

 
Fields inherited from class Shell
log
 
Property Summary
BufferManager buffers

Closure defaultErrorHook

Closure defaultResultHook

Closure errorHook

String evictedLine

FileHistory history

boolean historyFull

List imports

int indentSize

Interpreter interp

PackageHelper packageHelper

Parser parser

Closure resultHook

InteractiveShellRunner runner

 
Constructor Summary
Groovysh(ClassLoader classLoader, Binding binding, IO io, Closure registrar)

Groovysh(ClassLoader classLoader, Binding binding, IO io)

Groovysh(Binding binding, IO io)

Groovysh(IO io)

Groovysh()

 
Method Summary
void displayBuffer(List buffer)

Display the given buffer.

Object execute(String line)

Execute a single line, where the line may be a command or Groovy code (complete or incomplete).

protected Object executeCommand(String line)

String getIndentPrefix()

Calculate probably desired indentation based on parenthesis balance and last char, as well as what the user used last as indentation.

File getUserStateDirectory()

String renderPrompt()

int run(String[] args)

int run(String commandLine)

 
Methods inherited from class Shell
execute, findCommand, isExecutable, leftShift, leftShift, parseLine, register
 

Field Detail

AUTOINDENT_PREFERENCE_KEY

public static final String AUTOINDENT_PREFERENCE_KEY


 
Property Detail

buffers

final BufferManager buffers


defaultErrorHook

final Closure defaultErrorHook


defaultResultHook

final Closure defaultResultHook


errorHook

Closure errorHook


evictedLine

String evictedLine


history

FileHistory history


historyFull

boolean historyFull


imports

final List imports


indentSize

int indentSize


interp

final Interpreter interp


packageHelper

PackageHelper packageHelper


parser

final Parser parser


resultHook

Closure resultHook


runner

InteractiveShellRunner runner


 
Constructor Detail

Groovysh

Groovysh(ClassLoader classLoader, Binding binding, IO io, Closure registrar)


Groovysh

Groovysh(ClassLoader classLoader, Binding binding, IO io)


Groovysh

Groovysh(Binding binding, IO io)


Groovysh

Groovysh(IO io)


Groovysh

Groovysh()


 
Method Detail

displayBuffer

void displayBuffer(List buffer)
Display the given buffer.


execute

Object execute(String line)
Execute a single line, where the line may be a command or Groovy code (complete or incomplete).


executeCommand

protected Object executeCommand(String line)


getIndentPrefix

String getIndentPrefix()
Calculate probably desired indentation based on parenthesis balance and last char, as well as what the user used last as indentation.
Returns:
a string to indent the next line in the buffer


getUserStateDirectory

File getUserStateDirectory()


renderPrompt

String renderPrompt()


run

int run(String[] args)


run

int run(String commandLine)


 

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