Class CLIParser

java.lang.Object
de.dlr.proseo.ui.cli.parser.CLIParser

@Component public class CLIParser extends Object
Parser for the prosEO Command Line Interface Command line syntax is based on a YAML specification. The general command syntax is: "proseo" command [subcommand...] [option...] [parameter...]
Author:
Dr. Thomas Bassler
  • Field Details

    • TOP_LEVEL_COMMAND_NAME

      public static final String TOP_LEVEL_COMMAND_NAME
      The name of the top-level command
      See Also:
  • Constructor Details

    • CLIParser

      public CLIParser()
  • Method Details

    • loadSyntax

      public void loadSyntax() throws FileNotFoundException, org.yaml.snakeyaml.error.YAMLException
      Load the command line syntax from the configured syntax file
      Throws:
      FileNotFoundException - if the given file could not be read
      org.yaml.snakeyaml.error.YAMLException - if the given file could not be parsed
    • getSyntax

      public CLISyntax getSyntax()
      Return the currently applicable syntax
      Returns:
      the syntax
    • parse

      public ParsedCommand parse(String commandString) throws ParseException, IOException
      Parse a command string using the given syntax structure
      Parameters:
      commandString - the command string to parse
      Returns:
      a command structure for execution
      Throws:
      ParseException - if an error is detected in the command syntax
      IOException - if an I/O error occurs during input tokenizing