Class SyntaxMetricsImpl

java.lang.Object
org.refcodes.cli.SyntaxMetricsImpl
All Implemented Interfaces:
ArgumentPrefixAccessor, ArgumentSuffixAccessor, LongOptionPrefixAccessor, ShortOptionPrefixAccessor, SyntaxMetrics

public class SyntaxMetricsImpl extends Object implements SyntaxMetrics
The SyntaxMetricsImpl class implements the SyntaxMetrics interface for building custom SyntaxMetrics instances.
  • 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 configured SyntaxMetricsImpl 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

      public String getAllSymbol()
      Retrieves the symbol for representing an ALL condition.
      Specified by:
      getAllSymbol in interface SyntaxMetrics
      Returns:
      The according ALL symbol.
    • getAndSymbol

      public String getAndSymbol()
      Retrieves the symbol for representing an AND condition.
      Specified by:
      getAndSymbol in interface SyntaxMetrics
      Returns:
      The according AND symbol.
    • getEmptySymbol

      public String getEmptySymbol()
      Retrieves the symbol for representing an EMPTY condition (no args).
      Specified by:
      getEmptySymbol in interface SyntaxMetrics
      Returns:
      The according EMPTY symbol.
    • getAnySymbol

      public String getAnySymbol()
      Retrieves the symbol for representing an OPTIONAL condition.
      Specified by:
      getAnySymbol in interface SyntaxMetrics
      Returns:
      The according OPTIONAL symbol.
    • getOrSymbol

      public String getOrSymbol()
      Retrieves the symbol for representing an OR condition.
      Specified by:
      getOrSymbol in interface SyntaxMetrics
      Returns:
      The according OR symbol.
    • getArgumentPrefix

      public String getArgumentPrefix()
      Retrieves the argument prefix from the argument prefix property.
      Specified by:
      getArgumentPrefix in interface ArgumentPrefixAccessor
      Returns:
      The argument prefix stored by the argument prefix property.
    • getArgumentSuffix

      public String getArgumentSuffix()
      Retrieves the argument suffix from the argument suffix property.
      Specified by:
      getArgumentSuffix in interface ArgumentSuffixAccessor
      Returns:
      The argument suffix stored by the argument suffix property.
    • getBeginArraySymbol

      public String getBeginArraySymbol()
      Retrieves the symbol representing the beginning of an array, e.g. an opening square brace.
      Specified by:
      getBeginArraySymbol in interface SyntaxMetrics
      Returns:
      The symbol representing the beginning of an array.
    • getBeginListSymbol

      public String getBeginListSymbol()
      Retrieves the symbol representing the beginning of a list, e.g. an opening brace.
      Specified by:
      getBeginListSymbol in interface SyntaxMetrics
      Returns:
      The symbol representing the beginning of a list.
    • getBeginOptionalSymbol

      public String getBeginOptionalSymbol()
      Retrieves the symbol representing the beginning of optional elements, e.g. an opening square brace.
      Specified by:
      getBeginOptionalSymbol in interface SyntaxMetrics
      Returns:
      The symbol representing the beginning of optional elements.
    • getBeginRangeSymbol

      public String getBeginRangeSymbol()
      Retrieves the symbol representing the beginning of a range, e.g. an opening curly brace.
      Specified by:
      getBeginRangeSymbol in interface SyntaxMetrics
      Returns:
      The symbol representing the beginning of a range.
    • getEndArraySymbol

      public String getEndArraySymbol()
      Retrieves the symbol representing the end of an array, e.g. a closing square brace.
      Specified by:
      getEndArraySymbol in interface SyntaxMetrics
      Returns:
      The symbol representing the end of an array.
    • getEndListSymbol

      public String getEndListSymbol()
      Retrieves the symbol representing the end of a list, e.g. a closing brace.
      Specified by:
      getEndListSymbol in interface SyntaxMetrics
      Returns:
      The symbol representing the end of a list.
    • getEndOptionalSymbol

      public String getEndOptionalSymbol()
      Retrieves the symbol representing the end of optional elements, e.g. a closing square brace.
      Specified by:
      getEndOptionalSymbol in interface SyntaxMetrics
      Returns:
      The symbol representing the end of a optional elements.
    • getEndRangeSymbol

      public String getEndRangeSymbol()
      Retrieves the symbol representing the end of a range, e.g. a closing curly brace.
      Specified by:
      getEndRangeSymbol in interface SyntaxMetrics
      Returns:
      The symbol representing the end of a range.
    • getIntervalSymbol

      public String getIntervalSymbol()
      Retrieves the symbol representing an interval, e.g. "..." or "-".
      Specified by:
      getIntervalSymbol in interface SyntaxMetrics
      Returns:
      The symbol representing an interval.
    • getLongOptionPrefix

      public String getLongOptionPrefix()
      Retrieves the long option prefix from the long option prefix property.
      Specified by:
      getLongOptionPrefix in interface LongOptionPrefixAccessor
      Returns:
      The long option prefix stored by the long option prefix property.
    • getShortOptionPrefix

      public Character getShortOptionPrefix()
      Retrieves the short option prefix from the short option prefix property.
      Specified by:
      getShortOptionPrefix in interface ShortOptionPrefixAccessor
      Returns:
      The short option prefix stored by the short option prefix property.
    • getXorSymbol

      public String getXorSymbol()
      Retrieves the symbol for representing an XOR condition.
      Specified by:
      getXorSymbol in interface SyntaxMetrics
      Returns:
      The according XOR symbol.
    • builder

      public static SyntaxMetricsImpl.Builder builder()
      Creates a SyntaxMetricsImpl.Builder used to fluently construct SyntaxMetrics instances.
      Returns:
      The SyntaxMetricsImpl.Builder for constructing SyntaxMetrics instances.