Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 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
    • 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