-
- All Superinterfaces:
org.refcodes.component.Resetable
,Synopsis
,Syntaxable
- All Known Subinterfaces:
Condition
- All Known Implementing Classes:
AbstractCondition
,AllCondition
,AndCondition
,AnyCondition
,CasesCondition
,OptionCondition
,OrCondition
,XorCondition
public interface ArgsSyntax extends Syntaxable
TheArgsSyntax
interface represents a node (and therewith the syntax for the arguments) in the command line arguments syntax tree; simply extending theSyntaxable
interface and adding the functionality of providing access to the addedOperand
s (leafs). In future extensions, aArgsSyntax
might provide access to the childSyntaxable
elements contained in aArgsSyntax
instance. As of the current findings, access to the children of theArgsSyntax
node is not required and would make the interface unnecessarily complicated.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T extends Operand<?>>
TtoOperand(Class<T> aType)
Traverses the hierarchy ofArgsSyntax
tree and returns the (first) operand matching the given type.default Operand<?>
toOperand(String aAlias)
Traverses the hierarchy ofArgsSyntax
tree and returns the (first) operand matching the given alias.<T extends Operand<?>>
TtoOperand(String aAlias, Class<T> aType)
Traverses the hierarchy ofArgsSyntax
tree and returns the (first) operand matching the given alias and type.List<? extends Operand<?>>
toOperands()
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.cli.Synopsis
toSynopsis, toSynopsis, toSynopsis, toSynopsis
-
-
-
-
Method Detail
-
toOperands
List<? extends Operand<?>> 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
default Operand<?> toOperand(String aAlias)
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
default <T extends Operand<?>> T toOperand(Class<T> aType)
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
<T extends Operand<?>> T toOperand(String aAlias, Class<T> aType)
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
-
-