java.lang.Object
org.refcodes.cli.SyntaxMetricsImpl
- All Implemented Interfaces:
ArgumentPrefixAccessor
,ArgumentSuffixAccessor
,LongOptionPrefixAccessor
,ShortOptionPrefixAccessor
,SyntaxMetrics
The
SyntaxMetricsImpl
class implements the SyntaxMetrics
interface for building custom SyntaxMetrics
instances.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.cli.ArgumentPrefixAccessor
ArgumentPrefixAccessor.ArgumentPrefixBuilder<B extends ArgumentPrefixAccessor.ArgumentPrefixBuilder<B>>, ArgumentPrefixAccessor.ArgumentPrefixMutator, ArgumentPrefixAccessor.ArgumentPrefixProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.ArgumentSuffixAccessor
ArgumentSuffixAccessor.ArgumentSuffixBuilder<B extends ArgumentSuffixAccessor.ArgumentSuffixBuilder<B>>, ArgumentSuffixAccessor.ArgumentSuffixMutator, ArgumentSuffixAccessor.ArgumentSuffixProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.LongOptionPrefixAccessor
LongOptionPrefixAccessor.LongOptionPrefixBuilder<B extends LongOptionPrefixAccessor.LongOptionPrefixBuilder<B>>, LongOptionPrefixAccessor.LongOptionPrefixMutator, LongOptionPrefixAccessor.LongOptionPrefixProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.ShortOptionPrefixAccessor
ShortOptionPrefixAccessor.ShortOptionPrefixBuilder<B extends ShortOptionPrefixAccessor.ShortOptionPrefixBuilder<B>>, ShortOptionPrefixAccessor.ShortOptionPrefixMutator, ShortOptionPrefixAccessor.ShortOptionPrefixProperty
-
Constructor Summary
ConstructorDescriptionSyntaxMetricsImpl
(Character aShortOptionPrefix, String aLongOptionPrefix, String aArgumentPrefix, String aArgumentSuffix, String aBeginListSymbol, String aEndListSymbol, String aBeginArraySymbol, String aEndArraySymbol, String aBeginOptionalSymbol, String aEndOptionalSymbol, String aBeginRangeSymbol, String aEndRangeSymbol, String aIntervalSymbol, String aEmptySymbol, String aAllSymbol, String aAnySymbol, String aAndSymbol, String aOrSymbol, String aXorSymbol) Constructs an accordingly configuredSyntaxMetricsImpl
instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic SyntaxMetricsImpl.Builder
builder()
Creates aSyntaxMetricsImpl.Builder
used to fluently constructSyntaxMetrics
instances.Retrieves the symbol for representing an ALL condition.Retrieves the symbol for representing an AND condition.Retrieves the symbol for representing an OPTIONAL condition.Retrieves the argument prefix from the argument prefix property.Retrieves the argument suffix from the argument suffix property.Retrieves the symbol representing the beginning of an array, e.g. an opening square brace.Retrieves the symbol representing the beginning of a list, e.g. an opening brace.Retrieves the symbol representing the beginning of optional elements, e.g. an opening square brace.Retrieves the symbol representing the beginning of a range, e.g. an opening curly brace.Retrieves the symbol for representing an EMPTY condition (no args).Retrieves the symbol representing the end of an array, e.g. a closing square brace.Retrieves the symbol representing the end of a list, e.g. a closing brace.Retrieves the symbol representing the end of optional elements, e.g. a closing square brace.Retrieves the symbol representing the end of a range, e.g. a closing curly brace.Retrieves the symbol representing an interval, e.g. "..." or "-".Retrieves the long option prefix from the long option prefix property.Retrieves the symbol for representing an OR condition.Retrieves the short option prefix from the short option prefix property.Retrieves the symbol for representing an XOR condition.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.cli.SyntaxMetrics
toOptionPrefixes
-
Constructor Details
-
SyntaxMetricsImpl
public SyntaxMetricsImpl(Character aShortOptionPrefix, String aLongOptionPrefix, String aArgumentPrefix, String aArgumentSuffix, String aBeginListSymbol, String aEndListSymbol, String aBeginArraySymbol, String aEndArraySymbol, String aBeginOptionalSymbol, String aEndOptionalSymbol, String aBeginRangeSymbol, String aEndRangeSymbol, String aIntervalSymbol, String aEmptySymbol, String aAllSymbol, String aAnySymbol, String aAndSymbol, String aOrSymbol, String aXorSymbol) Constructs an accordingly configuredSyntaxMetricsImpl
instance.- Parameters:
aShortOptionPrefix
- The short option prefix.aLongOptionPrefix
- The long option prefix.aArgumentPrefix
- The argument notation prefix.aArgumentSuffix
- The argument notation suffix.aBeginListSymbol
- The symbol representing the beginning of a list.aEndListSymbol
- The symbol representing the end of a list.aBeginArraySymbol
- The symbol representing the beginning of an array.aEndArraySymbol
- The symbol representing the end of an array.aBeginOptionalSymbol
- The symbol representing the beginning of a optional elements.aEndOptionalSymbol
- The symbol representing the end of a optional elements.aBeginRangeSymbol
- The symbol representing the beginning of a range.aEndRangeSymbol
- The symbol representing the end of a range.aIntervalSymbol
- The symbol representing an interval.aEmptySymbol
- the EMPTY symbol to be used.aAllSymbol
- the ALL symbol to be used.aAnySymbol
- the ANY symbol to be used.aAndSymbol
- the AND symbol to be used.aOrSymbol
- the OR symbol to be used.aXorSymbol
- the XOR symbol to be used.
-
-
Method Details
-
getAllSymbol
Retrieves the symbol for representing an ALL condition.- Specified by:
getAllSymbol
in interfaceSyntaxMetrics
- Returns:
- The according ALL symbol.
-
getAndSymbol
Retrieves the symbol for representing an AND condition.- Specified by:
getAndSymbol
in interfaceSyntaxMetrics
- Returns:
- The according AND symbol.
-
getEmptySymbol
Retrieves the symbol for representing an EMPTY condition (no args).- Specified by:
getEmptySymbol
in interfaceSyntaxMetrics
- Returns:
- The according EMPTY symbol.
-
getAnySymbol
Retrieves the symbol for representing an OPTIONAL condition.- Specified by:
getAnySymbol
in interfaceSyntaxMetrics
- Returns:
- The according OPTIONAL symbol.
-
getOrSymbol
Retrieves the symbol for representing an OR condition.- Specified by:
getOrSymbol
in interfaceSyntaxMetrics
- Returns:
- The according OR symbol.
-
getArgumentPrefix
Retrieves the argument prefix from the argument prefix property.- Specified by:
getArgumentPrefix
in interfaceArgumentPrefixAccessor
- Returns:
- The argument prefix stored by the argument prefix property.
-
getArgumentSuffix
Retrieves the argument suffix from the argument suffix property.- Specified by:
getArgumentSuffix
in interfaceArgumentSuffixAccessor
- Returns:
- The argument suffix stored by the argument suffix property.
-
getBeginArraySymbol
Retrieves the symbol representing the beginning of an array, e.g. an opening square brace.- Specified by:
getBeginArraySymbol
in interfaceSyntaxMetrics
- Returns:
- The symbol representing the beginning of an array.
-
getBeginListSymbol
Retrieves the symbol representing the beginning of a list, e.g. an opening brace.- Specified by:
getBeginListSymbol
in interfaceSyntaxMetrics
- Returns:
- The symbol representing the beginning of a list.
-
getBeginOptionalSymbol
Retrieves the symbol representing the beginning of optional elements, e.g. an opening square brace.- Specified by:
getBeginOptionalSymbol
in interfaceSyntaxMetrics
- Returns:
- The symbol representing the beginning of optional elements.
-
getBeginRangeSymbol
Retrieves the symbol representing the beginning of a range, e.g. an opening curly brace.- Specified by:
getBeginRangeSymbol
in interfaceSyntaxMetrics
- Returns:
- The symbol representing the beginning of a range.
-
getEndArraySymbol
Retrieves the symbol representing the end of an array, e.g. a closing square brace.- Specified by:
getEndArraySymbol
in interfaceSyntaxMetrics
- Returns:
- The symbol representing the end of an array.
-
getEndListSymbol
Retrieves the symbol representing the end of a list, e.g. a closing brace.- Specified by:
getEndListSymbol
in interfaceSyntaxMetrics
- Returns:
- The symbol representing the end of a list.
-
getEndOptionalSymbol
Retrieves the symbol representing the end of optional elements, e.g. a closing square brace.- Specified by:
getEndOptionalSymbol
in interfaceSyntaxMetrics
- Returns:
- The symbol representing the end of a optional elements.
-
getEndRangeSymbol
Retrieves the symbol representing the end of a range, e.g. a closing curly brace.- Specified by:
getEndRangeSymbol
in interfaceSyntaxMetrics
- Returns:
- The symbol representing the end of a range.
-
getIntervalSymbol
Retrieves the symbol representing an interval, e.g. "..." or "-".- Specified by:
getIntervalSymbol
in interfaceSyntaxMetrics
- Returns:
- The symbol representing an interval.
-
getLongOptionPrefix
Retrieves the long option prefix from the long option prefix property.- Specified by:
getLongOptionPrefix
in interfaceLongOptionPrefixAccessor
- Returns:
- The long option prefix stored by the long option prefix property.
-
getShortOptionPrefix
Retrieves the short option prefix from the short option prefix property.- Specified by:
getShortOptionPrefix
in interfaceShortOptionPrefixAccessor
- Returns:
- The short option prefix stored by the short option prefix property.
-
getXorSymbol
Retrieves the symbol for representing an XOR condition.- Specified by:
getXorSymbol
in interfaceSyntaxMetrics
- Returns:
- The according XOR symbol.
-
builder
Creates aSyntaxMetricsImpl.Builder
used to fluently constructSyntaxMetrics
instances.- Returns:
- The
SyntaxMetricsImpl.Builder
for constructingSyntaxMetrics
instances.
-