Class ShellConsole
java.lang.Object
org.htmlunit.corejs.javascript.tools.shell.ShellConsole
- Direct Known Subclasses:
ShellConsole.JLineShellConsoleV1,ShellConsole.JLineShellConsoleV2,ShellConsole.SimpleShellConsole
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classJLine's ConsoleReaderInputStream is no longer public, therefore we need to use our own implementationprivate static classShellConsoleimplementation for JLine v1private static classShellConsoleimplementation for JLine v2private static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidflush()Flushes the console's outputstatic ShellConsolegetConsole(InputStream in, PrintStream ps, Charset cs) static ShellConsolegetConsole(Scriptable scope, Charset cs) Provides a specializedShellConsoleto handle line editing, history and completion.abstract InputStreamgetIn()Returns the underlyingInputStreamprivate static ShellConsole.JLineShellConsoleV1getJLineShellConsoleV1(ClassLoader classLoader, Class<?> readerClass, Scriptable scope, Charset cs) private static ShellConsole.JLineShellConsoleV2getJLineShellConsoleV2(ClassLoader classLoader, Class<?> readerClass, Scriptable scope, Charset cs) abstract voidPrints a single string to the consoleabstract voidprintln()Prints the newline character-sequence to the consoleabstract voidPrints a string and the newline character-sequence to the consoleabstract StringreadLine()Reads a single line from the consoleabstract StringReads a single line from the console and sets the console's prompt topromptprivate static Object
-
Field Details
-
NO_ARG
-
BOOLEAN_ARG
-
STRING_ARG
-
CHARSEQ_ARG
-
-
Constructor Details
-
ShellConsole
protected ShellConsole()
-
-
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
-
tryInvoke
-
getConsole
-
getConsole
Provides a specializedShellConsoleto handle line editing, history and completion. Relies on the JLine library (see http://jline.sourceforge.net). -
getJLineShellConsoleV1
private static ShellConsole.JLineShellConsoleV1 getJLineShellConsoleV1(ClassLoader classLoader, Class<?> readerClass, Scriptable scope, Charset cs) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException -
getJLineShellConsoleV2
private static ShellConsole.JLineShellConsoleV2 getJLineShellConsoleV2(ClassLoader classLoader, Class<?> readerClass, Scriptable scope, Charset cs) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
-