Klasse CLISyntax

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

public class CLISyntax extends Object
Representation of the prosEO Command Line Interface syntax The command line syntax is based on a YAML specification, which is used to initialize a CLISyntax object. This can be referenced by the CLIParser when parsing CLI commands.
Autor:
Dr. Thomas Bassler
  • Felddetails

    • inputSyntax

      static CLISyntax inputSyntax
      The syntax used in this program run (the last one parsed)
    • allowedTypes

      static final Set<String> allowedTypes
      Allowed type names in syntax file
  • Konstruktordetails

    • CLISyntax

      public CLISyntax()
  • Methodendetails

    • getTitle

      public String getTitle()
      Gets the title of the syntax file
      Gibt zurück:
      the title
    • setTitle

      public void setTitle(String title)
      Gets the title of the syntax file
      Parameter:
      title - the title to set
    • getVersion

      public String getVersion()
      Gets the syntax file version
      Gibt zurück:
      the version
    • setVersion

      public void setVersion(String version)
      sets the syntax file version
      Parameter:
      version - the version to set
    • getDescription

      public String getDescription()
      Gets the syntax description
      Gibt zurück:
      the description
    • setDescription

      public void setDescription(String description)
      Sets the syntax description
      Parameter:
      description - the description to set
    • getGlobalOptions

      public List<CLIOption> getGlobalOptions()
      Gets the options valid for all commands
      Gibt zurück:
      the globalOptions
    • setGlobalOptions

      public void setGlobalOptions(List<CLIOption> globalOptions)
      Sets the options valid for all commands
      Parameter:
      globalOptions - the globalOptions to set
    • getOptions

      public List<CLIOption> getOptions()
      Gets the top-level options
      Gibt zurück:
      the options
    • setOptions

      public void setOptions(List<CLIOption> options)
      Sets the top-level options
      Parameter:
      options - the options to set
    • getCommands

      public List<CLICommand> getCommands()
      Gets the available commands
      Gibt zurück:
      the commands
    • setCommands

      public void setCommands(List<CLICommand> commands)
      Sets the available commands
      Parameter:
      commands - the commands to set
    • getGlobalOptionMap

      public Map<String,CLIOption> getGlobalOptionMap()
      Gets the options valid for all commands as a map by full name
      Gibt zurück:
      the globalOptionMap
    • setGlobalOptionMap

      public void setGlobalOptionMap(Map<String,CLIOption> globalOptionMap)
      Sets the global option map (full name)
      Parameter:
      globalOptionMap - the globalOptionMap to set
    • getGlobalOptionsShortForm

      public Map<String,CLIOption> getGlobalOptionsShortForm()
      Gets the options valid for all commands as a map by short form
      Gibt zurück:
      the globalOptionsShortForm
    • setGlobalOptionsShortForm

      public void setGlobalOptionsShortForm(Map<String,CLIOption> globalOptionsShortForm)
      Sets the global option map (short form)
      Parameter:
      globalOptionsShortForm - the globalOptionsShortForm to set
    • getTopLevelOptions

      public Map<String,CLIOption> getTopLevelOptions()
      Gets the top-level options as a map by full name
      Gibt zurück:
      the topLevelOptions
    • setTopLevelOptions

      public void setTopLevelOptions(Map<String,CLIOption> topLevelOptions)
      Sets the top-level option map (full name)
      Parameter:
      topLevelOptions - the topLevelOptions to set
    • getCommandMap

      public Map<String,CLICommand> getCommandMap()
      Gets the available commands as a lookup map by command name
      Gibt zurück:
      the commandMap
    • setCommandMap

      public void setCommandMap(Map<String,CLICommand> commandMap)
      Sets the command lookup map
      Parameter:
      commandMap - the commandMap to set
    • fromSyntaxFile

      public static CLISyntax fromSyntaxFile(String syntaxFileName) throws FileNotFoundException, org.yaml.snakeyaml.error.YAMLException
      Load the CLI syntax file from the given file path
      Parameter:
      syntaxFileName - the path to a YAML format syntax file
      Gibt zurück:
      a CLISyntax object construct from the YAML specification
      Löst aus:
      FileNotFoundException - if the given file could not be read
      org.yaml.snakeyaml.error.YAMLException - if the given file could not be parsed
    • printHelp

      public void printHelp(PrintStream out)
      Print help information for this command on the given print stream
      Parameter:
      out - the print stream to write to
    • toString

      public String toString()
      Returns a String representation of the syntax
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      a String representation of the syntax
    • printHTML

      public StringBuilder printHTML()
      Generates a StringBuilder, appends it with HTML code that prints a title and description, calls the respective printHTML() methods for all global options, options and commands from the respective Documentation class fields.
      Gibt zurück:
      StringBuilder