Class CmdLine

java.lang.Object
org.jline.console.CmdLine

public class CmdLine extends Object
Represents a command line with its parsed components. This class stores information about a command line, including the original line, the part before and after the cursor, the parsed arguments, and the type of description that should be displayed for the command.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enumeration specifying the type of description that should be displayed for the command.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final List<String>
    The parsed command line arguments
    The type of description that should be displayed for the command
    private final String
    The part of the command line before the cursor, with method parameters and opening parenthesis removed
    private final String
    The original command line
    private final String
    The part of the command line after the cursor, with method parameters and closing parenthesis removed
  • Constructor Summary

    Constructors
    Constructor
    Description
    CmdLine(String line, String head, String tail, List<String> args, CmdLine.DescriptionType descType)
    Creates a new command line with the specified components.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the parsed command line arguments.
    Returns the type of description that should be displayed for the command.
    Returns the part of the command line before the cursor, with method parameters and opening parenthesis removed.
    Returns the original command line.
    Returns the part of the command line after the cursor, with method parameters and closing parenthesis removed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • line

      private final String line
      The original command line
    • tail

      private final String tail
      The part of the command line after the cursor, with method parameters and closing parenthesis removed
    • args

      private final List<String> args
      The parsed command line arguments
    • descType

      private final CmdLine.DescriptionType descType
      The type of description that should be displayed for the command
  • Constructor Details

    • CmdLine

      public CmdLine(String line, String head, String tail, List<String> args, CmdLine.DescriptionType descType)
      Creates a new command line with the specified components.
      Parameters:
      line - The original command line
      head - The part of the command line before the cursor, with method parameters and opening parenthesis removed
      tail - The part of the command line after the cursor, with method parameters and closing parenthesis removed
      args - The parsed command line arguments
      descType - The type of description that should be displayed for the command
  • Method Details

    • getLine

      public String getLine()
      Returns the original command line.
      Returns:
      the original command line
    • getHead

      public String getHead()
      Returns the part of the command line before the cursor, with method parameters and opening parenthesis removed.
      Returns:
      the part of the command line before the cursor
    • getTail

      public String getTail()
      Returns the part of the command line after the cursor, with method parameters and closing parenthesis removed.
      Returns:
      the part of the command line after the cursor
    • getArgs

      public List<String> getArgs()
      Returns the parsed command line arguments.
      Returns:
      the parsed command line arguments
    • getDescriptionType

      public CmdLine.DescriptionType getDescriptionType()
      Returns the type of description that should be displayed for the command.
      Returns:
      the type of description