Package org.jline.console
Class CommandRegistry.CommandSession
- java.lang.Object
-
- org.jline.console.CommandRegistry.CommandSession
-
- Enclosing interface:
- CommandRegistry
public static class CommandRegistry.CommandSession extends java.lang.Object
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.
-
-
Constructor Summary
Constructors Constructor Description CommandSession()
Creates a new command session with the system's standard I/O streams.CommandSession(org.jline.terminal.Terminal terminal)
Creates a new command session with the specified terminal.CommandSession(org.jline.terminal.Terminal terminal, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
Creates a new command session with the specified terminal and I/O streams.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.PrintStream
err()
Returns the error stream for the command session.java.io.InputStream
in()
Returns the input stream for the command session.java.io.PrintStream
out()
Returns the output stream for the command session.org.jline.terminal.Terminal
terminal()
Returns the terminal for the command session.
-
-
-
Constructor Detail
-
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
public CommandSession(org.jline.terminal.Terminal terminal)
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
public CommandSession(org.jline.terminal.Terminal terminal, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
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 Detail
-
terminal
public org.jline.terminal.Terminal terminal()
Returns the terminal for the command session.- Returns:
- the terminal, or null if no terminal is associated with this session
-
in
public java.io.InputStream in()
Returns the input stream for the command session.- Returns:
- the input stream
-
out
public java.io.PrintStream out()
Returns the output stream for the command session.- Returns:
- the output stream
-
err
public java.io.PrintStream err()
Returns the error stream for the command session.- Returns:
- the error stream
-
-