Enum Class SyntaxNotation

java.lang.Object
java.lang.Enum<SyntaxNotation>
org.refcodes.cli.SyntaxNotation
All Implemented Interfaces:
Serializable, Comparable<SyntaxNotation>, Constable, ArgumentPrefixAccessor, ArgumentSuffixAccessor, LongOptionPrefixAccessor, ShortOptionPrefixAccessor, SyntaxMetrics

public enum SyntaxNotation extends Enum<SyntaxNotation> implements SyntaxMetrics
The SyntaxNotation is used by a the Constituent.toSyntax(CliContext) method to determine which notation to be used for the generated syntax.
  • Enum Constant Details

    • LOGICAL

      public static final SyntaxNotation LOGICAL
      A notation which the author of this code believes to unambiguously describe a command line utility's argument syntax; as defined by the means of this refcodes-cli artifact.
    • GNU_POSIX

      public static final SyntaxNotation GNU_POSIX
      A syntax notation derived from GNU and POSIX utility conventions and utility argument syntax.
      See Also:
      • "http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html"
      • "http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html"
    • WINDOWS

      public static final SyntaxNotation WINDOWS
      A notation which tries to mimic CMD's notation and in case of lack of CMD notation conventions, the GNU_POSIX equivalent is used.
    • VERBOSE

      public static final SyntaxNotation VERBOSE
      A verbose notation using words instead of single character symbols.
  • Method Details

    • values

      public static SyntaxNotation[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SyntaxNotation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • getXorSymbol

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

      public String getOrSymbol()
      Retrieves the symbol for representing an OR condition.
      Specified by:
      getOrSymbol in interface SyntaxMetrics
      Returns:
      The according OR 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.
    • getAllSymbol

      public String getAllSymbol()
      Retrieves the symbol for representing an ALL condition.
      Specified by:
      getAllSymbol in interface SyntaxMetrics
      Returns:
      The according ALL symbol.
    • 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.
    • 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.
    • getAnySymbol

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

      public static SyntaxNotation toSyntaxNotation(String aValue)
      Retrieves a SyntaxNotation depending on the given string, ignoring the case as well as being graceful regarding "-" and "_",.
      Parameters:
      aValue - The name of the SyntaxNotation to be interpreted graceful.
      Returns:
      The SyntaxNotation being determined or null if none was found.