Package de.dlr.proseo.ui.cli.parser
Klasse CLISyntax
java.lang.Object
de.dlr.proseo.ui.cli.parser.CLISyntax
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
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungAllowed type names in syntax file(Package privat) static CLISyntax
The syntax used in this program run (the last one parsed) -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic CLISyntax
fromSyntaxFile
(String syntaxFileName) Load the CLI syntax file from the given file pathGets the available commands as a lookup map by command nameGets the available commandsGets the syntax descriptionGets the options valid for all commands as a map by full nameGets the options valid for all commandsGets the options valid for all commands as a map by short formGets the top-level optionsgetTitle()
Gets the title of the syntax fileGets the top-level options as a map by full nameGets the syntax file versionvoid
printHelp
(PrintStream out) Print help information for this command on the given print streamGenerates 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.void
setCommandMap
(Map<String, CLICommand> commandMap) Sets the command lookup mapvoid
setCommands
(List<CLICommand> commands) Sets the available commandsvoid
setDescription
(String description) Sets the syntax descriptionvoid
setGlobalOptionMap
(Map<String, CLIOption> globalOptionMap) Sets the global option map (full name)void
setGlobalOptions
(List<CLIOption> globalOptions) Sets the options valid for all commandsvoid
setGlobalOptionsShortForm
(Map<String, CLIOption> globalOptionsShortForm) Sets the global option map (short form)void
setOptions
(List<CLIOption> options) Sets the top-level optionsvoid
Gets the title of the syntax filevoid
setTopLevelOptions
(Map<String, CLIOption> topLevelOptions) Sets the top-level option map (full name)void
setVersion
(String version) sets the syntax file versiontoString()
Returns a String representation of the syntax
-
Felddetails
-
inputSyntax
The syntax used in this program run (the last one parsed) -
allowedTypes
Allowed type names in syntax file
-
-
Konstruktordetails
-
CLISyntax
public CLISyntax()
-
-
Methodendetails
-
getTitle
Gets the title of the syntax file- Gibt zurück:
- the title
-
setTitle
Gets the title of the syntax file- Parameter:
title
- the title to set
-
getVersion
Gets the syntax file version- Gibt zurück:
- the version
-
setVersion
sets the syntax file version- Parameter:
version
- the version to set
-
getDescription
Gets the syntax description- Gibt zurück:
- the description
-
setDescription
Sets the syntax description- Parameter:
description
- the description to set
-
getGlobalOptions
Gets the options valid for all commands- Gibt zurück:
- the globalOptions
-
setGlobalOptions
Sets the options valid for all commands- Parameter:
globalOptions
- the globalOptions to set
-
getOptions
Gets the top-level options- Gibt zurück:
- the options
-
setOptions
Sets the top-level options- Parameter:
options
- the options to set
-
getCommands
Gets the available commands- Gibt zurück:
- the commands
-
setCommands
Sets the available commands- Parameter:
commands
- the commands to set
-
getGlobalOptionMap
Gets the options valid for all commands as a map by full name- Gibt zurück:
- the globalOptionMap
-
setGlobalOptionMap
Sets the global option map (full name)- Parameter:
globalOptionMap
- the globalOptionMap to set
-
getGlobalOptionsShortForm
Gets the options valid for all commands as a map by short form- Gibt zurück:
- the globalOptionsShortForm
-
setGlobalOptionsShortForm
Sets the global option map (short form)- Parameter:
globalOptionsShortForm
- the globalOptionsShortForm to set
-
getTopLevelOptions
Gets the top-level options as a map by full name- Gibt zurück:
- the topLevelOptions
-
setTopLevelOptions
Sets the top-level option map (full name)- Parameter:
topLevelOptions
- the topLevelOptions to set
-
getCommandMap
Gets the available commands as a lookup map by command name- Gibt zurück:
- the commandMap
-
setCommandMap
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 readorg.yaml.snakeyaml.error.YAMLException
- if the given file could not be parsed
-
printHelp
Print help information for this command on the given print stream- Parameter:
out
- the print stream to write to
-
toString
Returns a String representation of the syntax -
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
-