Package org.jline.console
Class CommandRegistry.CommandSession
java.lang.Object
org.jline.console.CommandRegistry.CommandSession
- Enclosing interface:
CommandRegistry
Class representing a command execution session.
A CommandSession encapsulates the terminal and I/O streams used for command execution. It provides access to the terminal, input stream, output stream, and error stream for the command being executed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PrintStreamThe error stream for the command sessionprivate final InputStreamThe input stream for the command sessionprivate final PrintStreamThe output stream for the command sessionprivate final TerminalThe terminal for the command session -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new command session with the system's standard I/O streams.CommandSession(Terminal terminal) Creates a new command session with the specified terminal.CommandSession(Terminal terminal, InputStream in, PrintStream out, PrintStream err) Creates a new command session with the specified terminal and I/O streams. -
Method Summary
-
Field Details
-
terminal
The terminal for the command session -
in
The input stream for the command session -
out
The output stream for the command session -
err
The error stream for the command session
-
-
Constructor Details
-
CommandSession
public CommandSession()Creates a new command session with the system's standard I/O streams. The terminal will be null in this case. -
CommandSession
Creates a new command session with the specified terminal. The I/O streams will be derived from the terminal.- Parameters:
terminal- the terminal for the command session
-
CommandSession
Creates a new command session with the specified terminal and I/O streams.- Parameters:
terminal- the terminal for the command sessionin- the input stream for the command sessionout- the output stream for the command sessionerr- the error stream for the command session
-
-
Method Details
-
terminal
Returns the terminal for the command session.- Returns:
- the terminal, or null if no terminal is associated with this session
-
in
Returns the input stream for the command session.- Returns:
- the input stream
-
out
Returns the output stream for the command session.- Returns:
- the output stream
-
err
Returns the error stream for the command session.- Returns:
- the error stream
-