| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private class | JLineConsole.
Class to wrap the line-oriented interface to JLine with an InputStream that can replace System.in. |
| Modifier and Type | Field and Description |
|---|---|
| protected static final String | CTRL_Z
The ctrl-z character String. |
| private ConsoleOutputStream | outWrapper
Stream wrapping System.out in order to capture the last prompt. |
| protected PyObject | pre_input_hook
Not currently set by |
| public ConsoleReader | reader
Main interface to JLine. |
| protected PyObject | startup_hook
Callable object set by |
| private static final List | SUSPENDED_STRERRORS
Errno strerrors possibly caused by a SIGSTP (ctrl-z). |
| private boolean | windows
Whether reader is a WindowsTerminal. |
| Access | Constructor and Description |
|---|---|
| public | JLineConsole(String
name of a supported encoding or encoding)null for
Charset.defaultCharset()Construct an instance of the console class specifying the character encoding. |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| public ConsoleReader | |
| public PyObject | |
| public void | install()
Overrides org. Implements org. Complete initialization and (optionally) install a stream object with line-editing as the
replacement for |
| private boolean | |
| private String | Returns: line of text read into display prompt)Wrapper on reader.readLine(prompt) that deals with retries (on Unix) when the user enters ctrl-Z to background Jython, then brings it back to the foreground. |
| public void |
| CTRL_Z | back to summary |
|---|---|
| protected static final String CTRL_Z The ctrl-z character String. | |
| outWrapper | back to summary |
|---|---|
| private ConsoleOutputStream outWrapper Stream wrapping System.out in order to capture the last prompt. | |
| pre_input_hook | back to summary |
|---|---|
| protected PyObject pre_input_hook Not currently set by | |
| reader | back to summary |
|---|---|
| public ConsoleReader reader Main interface to JLine. | |
| startup_hook | back to summary |
|---|---|
| protected PyObject startup_hook Callable object set by | |
| SUSPENDED_STRERRORS | back to summary |
|---|---|
| private static final List<String> SUSPENDED_STRERRORS Errno strerrors possibly caused by a SIGSTP (ctrl-z). They may propagate up to IOException messages. | |
| windows | back to summary |
|---|---|
| private boolean windows Whether reader is a WindowsTerminal. | |
| JLineConsole | back to summary |
|---|---|
| public JLineConsole(String encoding) Construct an instance of the console class specifying the character encoding. This encoding must be one supported by the JVM.
Most of the initialisation is deferred to the
| |
| fromSuspend | back to summary |
|---|---|
| private boolean fromSuspend(IOException ioe) Determine if the IOException was likely caused by a SIGSTP (ctrl-z). Seems only applicable to BSD platforms. | |
| getReader | back to summary |
|---|---|
public ConsoleReader getReader()
| |
| getStartupHook | back to summary |
|---|---|
public PyObject getStartupHook()
| |
| install | back to summary |
|---|---|
| public void install() Overrides org. Implements org. Doc from org. Complete initialization and (optionally) install a stream object with line-editing as the
replacement for
This implementation overrides that by setting
| |
| isEOF | back to summary |
|---|---|
| private boolean isEOF(String line) Determine if line denotes an EOF. | |
| readerReadLine | back to summary |
|---|---|
| private String readerReadLine(String prompt) throws IOException, EOFException Wrapper on reader.readLine(prompt) that deals with retries (on Unix) when the user enters ctrl-Z to background Jython, then brings it back to the foreground. The inherited implementation says this is necessary and effective on BSD Unix.
| |
| setStartupHook | back to summary |
|---|---|
| public void setStartupHook(PyObject hook) Sets the startup hook (called prior to each readline) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv FileHistory |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| history | back to summary |
|---|---|
| pack-priv FileHistory history | |
| HistoryCloser | back to summary |
|---|---|
| public HistoryCloser(FileHistory history) | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected CharSequence | getLine()
Implements abstract org. Get one line of input from the console. |
| Stream | back to summary |
|---|---|
| pack-priv Stream() Create a System.in replacement with JLine that adds system-specific line endings | |
| getLine | back to summary |
|---|---|
| protected CharSequence getLine() throws IOException, EOFException Implements abstract org. Doc from org. Get one line of input from the console. Override this method with the actions specific to the library in use.
| |