Package org.jline.console
Class CommandInput
- java.lang.Object
-
- org.jline.console.CommandInput
-
public class CommandInput extends java.lang.ObjectEncapsulates the input and output streams for a command execution. This class provides access to the command name, arguments, terminal, and I/O streams needed for command execution in the console environment.
-
-
Constructor Summary
Constructors Constructor Description CommandInput(java.lang.String command, java.lang.Object[] xargs, CommandRegistry.CommandSession session)Creates a new CommandInput with the specified command, arguments, and session.CommandInput(java.lang.String command, java.lang.Object[] args, Terminal terminal, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)Creates a new CommandInput with the specified command, arguments, terminal, and I/O streams.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]args()Returns the command arguments as strings.java.lang.Stringcommand()Returns the command name.java.io.PrintStreamerr()Returns the error stream for this command.java.io.InputStreamin()Returns the input stream for this command.java.io.PrintStreamout()Returns the output stream for this command.CommandRegistry.CommandSessionsession()Creates and returns a new CommandSession using this command's terminal and I/O streams.Terminalterminal()Returns the terminal instance for this command.java.lang.Object[]xargs()Returns the original command arguments as objects.
-
-
-
Constructor Detail
-
CommandInput
public CommandInput(java.lang.String command, java.lang.Object[] xargs, CommandRegistry.CommandSession session)Creates a new CommandInput with the specified command, arguments, and session.- Parameters:
command- the command namexargs- the command arguments as objectssession- the command session containing terminal and I/O streams
-
CommandInput
public CommandInput(java.lang.String command, java.lang.Object[] args, Terminal terminal, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)Creates a new CommandInput with the specified command, arguments, terminal, and I/O streams.- Parameters:
command- the command nameargs- the command arguments as objectsterminal- the terminal instancein- the input streamout- the output streamerr- the error stream
-
-
Method Detail
-
command
public java.lang.String command()
Returns the command name.- Returns:
- the command name
-
args
public java.lang.String[] args()
Returns the command arguments as strings.- Returns:
- the command arguments as strings
-
xargs
public java.lang.Object[] xargs()
Returns the original command arguments as objects.- Returns:
- the command arguments as objects
-
terminal
public Terminal terminal()
Returns the terminal instance for this command.- Returns:
- the terminal instance
-
in
public java.io.InputStream in()
Returns the input stream for this command.- Returns:
- the input stream
-
out
public java.io.PrintStream out()
Returns the output stream for this command.- Returns:
- the output stream
-
err
public java.io.PrintStream err()
Returns the error stream for this command.- Returns:
- the error stream
-
session
public CommandRegistry.CommandSession session()
Creates and returns a new CommandSession using this command's terminal and I/O streams.- Returns:
- a new command session
-
-