An interactive shell for evaluating Groovy code from the command-line (aka. groovysh).
The set of available commands can be modified by placing a file in the classpath named
org/codehaus/groovy/tools/shell/commands.xml
See XmlCommandRegistrar
Modifiers | Name | Description |
---|---|---|
static String |
AUTOINDENT_PREFERENCE_KEY |
|
static String |
COLLECTED_BOUND_VARS_MAP_VARNAME |
|
static String |
COLORS_PREFERENCE_KEY |
|
static String |
INTERPRETER_MODE_PREFERENCE_KEY |
|
static String |
METACLASS_COMPLETION_PREFIX_LENGTH_PREFERENCE_KEY |
Type | Name and description |
---|---|
BufferManager |
buffers |
Closure |
defaultErrorHook |
Closure |
defaultResultHook |
Closure |
errorHook |
String |
evictedLine |
FileHistory |
history |
boolean |
historyFull |
List<String> |
imports |
int |
indentSize |
Interpreter |
interp |
PackageHelper |
packageHelper |
Parser |
parser |
Closure |
resultHook |
InteractiveShellRunner |
runner |
Type | Name and description |
---|---|
void |
displayBuffer(List buffer) Display the given buffer. |
void |
displayWelcomeBanner(InteractiveShellRunner runner) maybe displays log information and a welcome message |
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 |
getImportStatements() |
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() |
static boolean |
isTypeOrMethodDeclaration(List<String> buffer) return true if the buffer can be recognized as a type declaration statement |
protected void |
loadUserScript(String filename) Loads file from within user groovy state directory |
String |
renderPrompt() |
int |
run(String evalString, List<String> filenames) Run Interactive Shell with optional initial script and files to load |
int |
run(String commandLine) Run Interactive Shell with initial command |
Methods inherited from class | Name |
---|---|
class Shell |
execute, findCommand, isExecutable, leftShift, leftShift, register |
Display the given buffer.
maybe displays log information and a welcome message
Execute a single line, where the line may be a command or Groovy code (complete or incomplete).
Calculate probably desired indentation based on parenthesis balance and last char, as well as what the user used last as indentation.
return true if the buffer can be recognized as a type declaration statement
Loads file from within user groovy state directory
Run Interactive Shell with optional initial script and files to load
Run Interactive Shell with initial command
Copyright © 2003-2015 The Apache Software Foundation. All rights reserved.