Class ShellConsole
java.lang.Object
org.mozilla.javascript.tools.shell.ShellConsole
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
flush()
Flushes the console's outputstatic ShellConsole
getConsole
(InputStream in, PrintStream ps, Charset cs) static ShellConsole
getConsole
(Scriptable scope, Charset cs) Provides a specializedShellConsole
to handle line editing, history and completion.abstract InputStream
getIn()
Returns the underlyingInputStream
abstract void
Prints a single string to the consoleabstract void
println()
Prints the newline character-sequence to the consoleabstract void
Prints a string and the newline character-sequence to the consoleabstract String
readLine()
Reads a single line from the consoleabstract String
Reads a single line from the console and sets the console's prompt toprompt
-
Method Details
-
getIn
Returns the underlyingInputStream
-
readLine
Reads a single line from the console- Throws:
IOException
-
readLine
Reads a single line from the console and sets the console's prompt toprompt
- Throws:
IOException
-
flush
Flushes the console's output- Throws:
IOException
-
print
Prints a single string to the console- Throws:
IOException
-
println
Prints the newline character-sequence to the console- Throws:
IOException
-
println
Prints a string and the newline character-sequence to the console- Throws:
IOException
-
getConsole
-
getConsole
Provides a specializedShellConsole
to handle line editing, history and completion. Relies on the JLine library (see invalid input: '<'http://jline.sourceforge.net>).
-