- All Superinterfaces:
org.refcodes.mixin.Resetable
,org.refcodes.mixin.Schemable<CliSchema>
,Synopsisable
,Syntaxable
- All Known Subinterfaces:
Condition
- All Known Implementing Classes:
AbstractCondition
,AllCondition
,AndCondition
,AnyCondition
,CasesCondition
,OptionCondition
,OrCondition
,XorCondition
The
ArgsSyntax
interface represents a node (and therewith the syntax
for the arguments) in the command line arguments syntax tree; simply
extending the Syntaxable
interface and adding the functionality of
providing access to the added Operand
s (leafs). In future extensions,
a ArgsSyntax
might provide access to the child Syntaxable
elements contained in a ArgsSyntax
instance. As of the current
findings, access to the children of the ArgsSyntax
node is not
required and would make the interface unnecessarily complicated.-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends Operand<?>>
TTraverses the hierarchy ofArgsSyntax
tree and returns the (first) operand matching the given type.default Operand<?>
Traverses the hierarchy ofArgsSyntax
tree and returns the (first) operand matching the given alias.<T extends Operand<?>>
TTraverses the hierarchy ofArgsSyntax
tree and returns the (first) operand matching the given alias and type.Traverses the hierarchy ofArgsSyntax
s and collects all therein foundOperand
s and sub-types such as theFlag
or theOption
.Methods inherited from interface org.refcodes.mixin.Resetable
reset
Methods inherited from interface org.refcodes.mixin.Schemable
toSchema
Methods inherited from interface org.refcodes.cli.Synopsisable
toSynopsis, toSynopsis, toSynopsis, toSynopsis
-
Method Details
-
toOperands
Traverses the hierarchy ofArgsSyntax
s and collects all therein foundOperand
s and sub-types such as theFlag
or theOption
. This is most useful when creating a list ofOption
s,Flag
es andOperand
s when printing out detailed help.- Returns:
- The according
Operand
elements.
-
toOperand
Traverses the hierarchy ofArgsSyntax
tree and returns the (first) operand matching the given alias.- Parameters:
aAlias
- The alias for which to seek for.- Returns:
- The according
Operand
element or null if none matching was found.
-
toOperand
Traverses the hierarchy ofArgsSyntax
tree and returns the (first) operand matching the given type.- Type Parameters:
T
- the generic type- Parameters:
aType
- The type for which to seek for.- Returns:
- The according
Operand
element or null if none matching was found
-
toOperand
Traverses the hierarchy ofArgsSyntax
tree and returns the (first) operand matching the given alias and type.- Type Parameters:
T
- the generic type- Parameters:
aAlias
- The alias for which to seek for.aType
- The type for which to seek for.- Returns:
- The according
Operand
element or null if none matching was found
-