Class ShellConsole
- java.lang.Object
-
- org.mozilla.javascript.tools.shell.ShellConsole
-
public abstract class ShellConsole extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
flush()
Flushes the console's outputstatic ShellConsole
getConsole(java.io.InputStream in, java.io.PrintStream ps, java.nio.charset.Charset cs)
static ShellConsole
getConsole(Scriptable scope, java.nio.charset.Charset cs)
Provides a specializedShellConsole
to handle line editing, history and completion.abstract java.io.InputStream
getIn()
Returns the underlyingInputStream
abstract void
print(java.lang.String s)
Prints a single string to the consoleabstract void
println()
Prints the newline character-sequence to the consoleabstract void
println(java.lang.String s)
Prints a string and the newline character-sequence to the consoleabstract java.lang.String
readLine()
Reads a single line from the consoleabstract java.lang.String
readLine(java.lang.String prompt)
Reads a single line from the console and sets the console's prompt toprompt
-
-
-
Method Detail
-
getIn
public abstract java.io.InputStream getIn()
Returns the underlyingInputStream
-
readLine
public abstract java.lang.String readLine() throws java.io.IOException
Reads a single line from the console- Throws:
java.io.IOException
-
readLine
public abstract java.lang.String readLine(java.lang.String prompt) throws java.io.IOException
Reads a single line from the console and sets the console's prompt toprompt
- Throws:
java.io.IOException
-
flush
public abstract void flush() throws java.io.IOException
Flushes the console's output- Throws:
java.io.IOException
-
print
public abstract void print(java.lang.String s) throws java.io.IOException
Prints a single string to the console- Throws:
java.io.IOException
-
println
public abstract void println() throws java.io.IOException
Prints the newline character-sequence to the console- Throws:
java.io.IOException
-
println
public abstract void println(java.lang.String s) throws java.io.IOException
Prints a string and the newline character-sequence to the console- Throws:
java.io.IOException
-
getConsole
public static ShellConsole getConsole(java.io.InputStream in, java.io.PrintStream ps, java.nio.charset.Charset cs)
-
getConsole
public static ShellConsole getConsole(Scriptable scope, java.nio.charset.Charset cs)
Provides a specializedShellConsole
to handle line editing, history and completion. Relies on the JLine library (see http://jline.sourceforge.net).
-
-