- All Superinterfaces:
org.refcodes.mixin.ChildrenAccessor<Term[]>,org.refcodes.mixin.DescriptionAccessor,org.refcodes.exception.ExceptionAccessor<ArgsSyntaxException>,MatchCountAccessor,org.refcodes.mixin.Resetable,org.refcodes.mixin.Schemable,Synopsisable,Term
- All Known Implementing Classes:
AbstractCondition,AllCondition,AndCondition,AnyCondition,CasesCondition,OrCondition,XorCondition
The
Condition interface represents a node (and therewith the syntax
for the arguments) in the command line arguments syntax tree; simply
extending the Term interface and adding the functionality of
providing access to the added Operands (leafs). In future extensions,
a Condition might provide access to the child Term 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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.ChildrenAccessor
org.refcodes.mixin.ChildrenAccessor.ChildrenBuilder<T extends Object,B extends org.refcodes.mixin.ChildrenAccessor.ChildrenBuilder<T, B>>, org.refcodes.mixin.ChildrenAccessor.ChildrenMutator<T extends Object>, org.refcodes.mixin.ChildrenAccessor.ChildrenProperty<T extends Object> Nested classes/interfaces inherited from interface org.refcodes.mixin.DescriptionAccessor
org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<B extends org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<B>>, org.refcodes.mixin.DescriptionAccessor.DescriptionMutator, org.refcodes.mixin.DescriptionAccessor.DescriptionPropertyNested classes/interfaces inherited from interface org.refcodes.exception.ExceptionAccessor
org.refcodes.exception.ExceptionAccessor.ExceptionBuilder<EXC extends Throwable,B extends org.refcodes.exception.ExceptionAccessor.ExceptionBuilder<EXC, B>>, org.refcodes.exception.ExceptionAccessor.ExceptionMutator<EXC extends Throwable>, org.refcodes.exception.ExceptionAccessor.ExceptionProperty<EXC extends Throwable> Nested classes/interfaces inherited from interface org.refcodes.cli.MatchCountAccessor
MatchCountAccessor.MatchCountBuilder<B extends MatchCountAccessor.MatchCountBuilder<B>>, MatchCountAccessor.MatchCountMutator, MatchCountAccessor.MatchCountProperty -
Method Summary
Modifier and TypeMethodDescriptiondefault booleandefault booleandefault Condition[]toConditions(String[] aArgs) default <T extends Operand<?>>
TTraverses the hierarchy ofConditiontree and returns the (first) operand matching the given type.default Operand<?>Traverses the hierarchy ofConditiontree and returns the (first) operand matching the given alias.<T extends Operand<?>>
TTraverses the hierarchy ofConditiontree and returns the (first) operand matching the given alias and type.Operand<?>[]default Operand<?>[]toOperands(String[] aArgs) Methods inherited from interface org.refcodes.mixin.ChildrenAccessor
getChildrenMethods inherited from interface org.refcodes.mixin.DescriptionAccessor
getDescriptionMethods inherited from interface org.refcodes.mixin.Resetable
resetMethods inherited from interface org.refcodes.cli.Synopsisable
toSynopsis, toSynopsis, toSynopsis, toSynopsisMethods inherited from interface org.refcodes.cli.Term
getException, getMatchCount, parseArgs, parseArgs, toSchema, toSynopsis, toSyntax, toSyntax, toSyntax, toSyntax, toSyntax, toValue
-
Method Details
-
toOperand
Traverses the hierarchy ofConditiontree 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
Operandelement or null if none matching was found
-
toOperand
Traverses the hierarchy ofConditiontree and returns the (first) operand matching the given alias.- Parameters:
aAlias- The alias for which to seek for.- Returns:
- The according
Operandelement or null if none matching was found.
-
toOperand
Traverses the hierarchy ofConditiontree 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
Operandelement or null if none matching was found
-
toOperands
Operand<?>[] toOperands()Traverses the hierarchy ofConditions and collects all therein foundOperands and sub-types such as theFlagor theOption. This is most useful when creating a list ofOptions,Flages andOperands when printing out detailed help.- Returns:
- The according
Operandelements.
-
toOperands
-
toConditions
-
isChild
- Parameters:
aTerm- TheTermfor which to determine if it is a direct child.- Returns:
- True in case it is a direct child, else false,
-
hasChild
- Parameters:
aTerm- TheTermfor which to determine if it is a child (or a child's child).- Returns:
- True in case it is a child (or a child's child), else false,
-