public abstract class AbstractCondition extends Object implements Condition
AbstractCondition
is an abstract implementation of an
Condition
providing the boiler plate when implementing the
Condition
interface.Constructor and Description |
---|
AbstractCondition(Syntaxable... aElements)
Instantiates a new abstract condition.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addChild(Syntaxable aArgumentizer)
Adds the child.
|
<V> V |
get(String aAlias)
Searches for a value being set for the given for given alias in the
syntax tree parsing the command line arguments; if a node in the syntax
tree has a value for the given alias, then this value is returned.
|
protected List<Syntaxable> |
getChildren()
Gets the children.
|
void |
reset() |
List<? extends Operand<?>> |
toOperands()
|
String |
toString() |
String |
toSyntax(SyntaxNotation aSyntaxNotation)
This method is to be called from inside the
Syntaxable hierarchy;
use the method SyntaxUsage.toUsage(SyntaxNotation) in case you invoke
syntax retrieval from the root Syntaxable . |
String |
toUsage(SyntaxNotation aSyntaxNotation)
Returns the human readable (verbose) syntax of implementing class
ATTENTION: As of different parenthesis settings for some notations
regarding the root
Syntaxable and the child Syntaxable s,
the method Syntaxable.toSyntax(SyntaxNotation) is called from
inside a Syntaxable hierarchy. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
parseArgs, toState
toUsage, toUsage
public AbstractCondition(Syntaxable... aElements)
aElements
- the elementspublic String toSyntax(SyntaxNotation aSyntaxNotation)
Syntaxable
hierarchy;
use the method SyntaxUsage.toUsage(SyntaxNotation)
in case you invoke
syntax retrieval from the root Syntaxable
.
Returns the human readable (verbose) syntax of this Syntaxable
instance including, in case of being a node in the syntax tree (such as a
Condition
, the syntax of the child Syntaxable
instances.
ATTENTION: As of different parenthesis settings for some notations
regarding the root Syntaxable
and the child Syntaxable
s,
the method Syntaxable.toSyntax(SyntaxNotation)
is called from inside the
Syntaxable
hierarchy. In case the syntax is to be retrieved from
the root Syntaxable
, then the applicable method to be called is
SyntaxUsage.toUsage(SyntaxNotation)
, as for some notations it will for
example not create the most outer braces.toSyntax
in interface Syntaxable
aSyntaxNotation
- The syntax notation used for generating the
command line arguments syntax.public void reset()
reset
in interface org.refcodes.component.Resetable
public List<? extends Operand<?>> toOperands()
Condition
s and collects all therein
found Operand
s and sub-types such as the Switch
or the
Option
. This is most useful when creating a list of
Option
s, Switch
es and Operand
s when printing out
detailed help.toOperands
in interface Condition
Operand
elements.protected List<Syntaxable> getChildren()
protected void addChild(Syntaxable aArgumentizer)
aArgumentizer
- the argumentizerpublic <V> V get(String aAlias)
get
in interface Syntaxable
V
- The type of the value being expected.aAlias
- The alias for which to seek for a value being set.public String toUsage(SyntaxNotation aSyntaxNotation)
SyntaxUsage
Syntaxable
and the child Syntaxable
s,
the method Syntaxable.toSyntax(SyntaxNotation)
is called from
inside a Syntaxable
hierarchy. In case the syntax is to be
retrieved from the root Syntaxable
or an encapsulating and
different type, then the applicable method to be called is
SyntaxUsage.toUsage(SyntaxNotation)
, as for some notations it will for
example not create the most outer braces.toUsage
in interface SyntaxUsage
aSyntaxNotation
- The syntax notation used for generating the
command line arguments syntax.Copyright © 2018. All rights reserved.