Skip navigation links

Package org.refcodes.console

Syntaxable: Syntaxable defines the methods at least required when building a command line arguments syntax tree for traversing the syntax tree; either for parsing command line arguments or for constructing the command line arguments syntax.

See: Description

Package org.refcodes.console Description

Syntaxable: Syntaxable defines the methods at least required when building a command line arguments syntax tree for traversing the syntax tree; either for parsing command line arguments or for constructing the command line arguments syntax. By providing various implementations of the Syntaxable's subclasses such as Operand, Option or Condition, a command line arguments syntax tree can be constructed. This syntax tree can be use to create a human readable (verbose) command line arguments syntax and to parse an array of command line arguments for determining the Operands', the Switches' or the Options' values. Operand: An Operand represents a value parsed from command line arguments.An Operand has a state which changes with each invocation of the #parseArgs(String[]) method. It is recommended to put your Operand instance(s) at the end of your top Condition to enforce it to be the last Syntaxable(s) when parsing the command line arguments - this makes sure that any Options pick their option arguments so that the Operand(s) will correctly be left over for parsing command line argument(s); the Operand will not pick by mistake an option argument. Option: An Option represents a command line option with the according option's value. An Option can be seen as a key / value(s) pair defined in the command line arguments parsed via the #parseArgs(String[]) method. An Option has a state which changes with each invocation of the #parseArgs(String[]) method. Switch: A Switch is an Option with a Boolean state. Usually switches are just set or omitted in the command line arguments with no value provided; former representing a true status and latter representing a false status. Condition: The Condition interface represents a node in the command line arguments syntax tree; simply extending the Syntaxable interface and adding the functionality of providing access to the added Operands (leafs). In future extensions, a Condition might provide access to the child Syntaxable elements contained in a Condition instance. As of the current findings, access to the children of the Condition node is not required and would make the interface unnecessarily complicated.
See Also:
StringOptionImpl, SwitchImpl, StringOperandImpl, XorConditionImpl, AndConditionImpl, OptionalImpl
Skip navigation links

Copyright © 2015. All rights reserved.