Class SyntaxMetricsImpl
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 ClassesNested classes/interfaces inherited from interface ArgumentPrefixAccessor
ArgumentPrefixAccessor.ArgumentPrefixBuilder<B>, ArgumentPrefixAccessor.ArgumentPrefixMutator, ArgumentPrefixAccessor.ArgumentPrefixPropertyNested classes/interfaces inherited from interface ArgumentSuffixAccessor
ArgumentSuffixAccessor.ArgumentSuffixBuilder<B>, ArgumentSuffixAccessor.ArgumentSuffixMutator, ArgumentSuffixAccessor.ArgumentSuffixPropertyNested classes/interfaces inherited from interface LongOptionPrefixAccessor
LongOptionPrefixAccessor.LongOptionPrefixBuilder<B>, LongOptionPrefixAccessor.LongOptionPrefixMutator, LongOptionPrefixAccessor.LongOptionPrefixPropertyNested classes/interfaces inherited from interface ShortOptionPrefixAccessor
ShortOptionPrefixAccessor.ShortOptionPrefixBuilder<B>, ShortOptionPrefixAccessor.ShortOptionPrefixMutator, ShortOptionPrefixAccessor.ShortOptionPrefixProperty -
Constructor Summary
ConstructorsConstructorDescriptionSyntaxMetricsImpl(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 configuredSyntaxMetricsImplinstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic SyntaxMetricsImpl.Builderbuilder()Creates aSyntaxMetricsImpl.Builderused to fluently constructSyntaxMetricsinstances.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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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 configuredSyntaxMetricsImplinstance.- 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:
getAllSymbolin interfaceSyntaxMetrics- Returns:
- The according ALL symbol.
-
getAndSymbol
Retrieves the symbol for representing an AND condition.- Specified by:
getAndSymbolin interfaceSyntaxMetrics- Returns:
- The according AND symbol.
-
getAnySymbol
Retrieves the symbol for representing an OPTIONAL condition.- Specified by:
getAnySymbolin interfaceSyntaxMetrics- Returns:
- The according OPTIONAL symbol.
-
getArgumentPrefix
Retrieves the argument prefix from the argument prefix property.- Specified by:
getArgumentPrefixin interfaceArgumentPrefixAccessor- Returns:
- The argument prefix stored by the argument prefix property.
-
getArgumentSuffix
Retrieves the argument suffix from the argument suffix property.- Specified by:
getArgumentSuffixin 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:
getBeginArraySymbolin 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:
getBeginListSymbolin 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:
getBeginOptionalSymbolin 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:
getBeginRangeSymbolin interfaceSyntaxMetrics- Returns:
- The symbol representing the beginning of a range.
-
getEmptySymbol
Retrieves the symbol for representing an EMPTY condition (no args).- Specified by:
getEmptySymbolin interfaceSyntaxMetrics- Returns:
- The according EMPTY symbol.
-
getEndArraySymbol
Retrieves the symbol representing the end of an array, e.g. a closing square brace.- Specified by:
getEndArraySymbolin 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:
getEndListSymbolin 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:
getEndOptionalSymbolin 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:
getEndRangeSymbolin interfaceSyntaxMetrics- Returns:
- The symbol representing the end of a range.
-
getIntervalSymbol
Retrieves the symbol representing an interval, e.g. "..." or "-".- Specified by:
getIntervalSymbolin interfaceSyntaxMetrics- Returns:
- The symbol representing an interval.
-
getLongOptionPrefix
Retrieves the long option prefix from the long option prefix property.- Specified by:
getLongOptionPrefixin interfaceLongOptionPrefixAccessor- Returns:
- The long option prefix stored by the long option prefix property.
-
getOrSymbol
Retrieves the symbol for representing an OR condition.- Specified by:
getOrSymbolin interfaceSyntaxMetrics- Returns:
- The according OR symbol.
-
getShortOptionPrefix
Retrieves the short option prefix from the short option prefix property.- Specified by:
getShortOptionPrefixin interfaceShortOptionPrefixAccessor- Returns:
- The short option prefix stored by the short option prefix property.
-
getXorSymbol
Retrieves the symbol for representing an XOR condition.- Specified by:
getXorSymbolin interfaceSyntaxMetrics- Returns:
- The according XOR symbol.
-
builder
Creates aSyntaxMetricsImpl.Builderused to fluently constructSyntaxMetricsinstances.- Returns:
- The
SyntaxMetricsImpl.Builderfor constructingSyntaxMetricsinstances.
-