Class ParseOptionArgsException

All Implemented Interfaces:
Serializable, ArgsAccessor, LongOptionAccessor, MatchCountAccessor, ShortOptionAccessor, org.refcodes.exception.ErrorCodeAccessor, org.refcodes.exception.Trap, org.refcodes.mixin.SourceAccessor<Term>

public class ParseOptionArgsException extends ParseArgsException implements ShortOptionAccessor, LongOptionAccessor
Thrown in case the provided command line arguments do not respect the required semantics or cannot be converted to the required type by an Option (having a short- and/or a long-option), e.g. the arguments were rejected as them did not work for the according syntax.
See Also:
  • Constructor Details

    • ParseOptionArgsException

      public ParseOptionArgsException(String aMessage, String[] aArgs, String aShortOption, String aLongOption, Term aSource)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
    • ParseOptionArgsException

      public ParseOptionArgsException(String aMessage, String[] aArgs, String aShortOption, String aLongOption, Term aSource, String aErrorCode)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
    • ParseOptionArgsException

      public ParseOptionArgsException(String aMessage, String[] aArgs, String aShortOption, String aLongOption, Throwable aCause, Term aSource)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
    • ParseOptionArgsException

      public ParseOptionArgsException(String aMessage, String[] aArgs, String aShortOption, String aLongOption, Throwable aCause, Term aSource, String aErrorCode)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
    • ParseOptionArgsException

      public ParseOptionArgsException(String[] aArgs, String aShortOption, String aLongOption, Throwable aCause, Term aSource)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
    • ParseOptionArgsException

      public ParseOptionArgsException(String[] aArgs, String aShortOption, String aLongOption, Throwable aCause, Term aSource, String aErrorCode)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
    • ParseOptionArgsException

      public ParseOptionArgsException(String aMessage, String[] aArgs, String aShortOption, String aLongOption)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
    • ParseOptionArgsException

      public ParseOptionArgsException(String aMessage, String[] aArgs, String aShortOption, String aLongOption, String aErrorCode)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
    • ParseOptionArgsException

      public ParseOptionArgsException(String aMessage, String[] aArgs, String aShortOption, String aLongOption, Throwable aCause)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
    • ParseOptionArgsException

      public ParseOptionArgsException(String aMessage, String[] aArgs, String aShortOption, String aLongOption, Throwable aCause, String aErrorCode)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
    • ParseOptionArgsException

      public ParseOptionArgsException(String[] aArgs, String aShortOption, String aLongOption, Throwable aCause)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
    • ParseOptionArgsException

      public ParseOptionArgsException(String[] aArgs, String aShortOption, String aLongOption, Throwable aCause, String aErrorCode)
      Parameters:
      aShortOption - The full short option (prefix + suffix) for which the arguments did not apply.
      aLongOption - The full long option (prefix + suffix) for which the arguments did not apply.
  • Method Details

    • getLongOption

      public String getLongOption()
      Retrieves the long option from the long option property.
      Specified by:
      getLongOption in interface LongOptionAccessor
      Returns:
      The long option stored by the long option property.
    • getShortOption

      public String getShortOption()
      Retrieves the short option from the short option property.
      Specified by:
      getShortOption in interface ShortOptionAccessor
      Returns:
      The short option stored by the short option property.
    • getPatternArguments

      public Object[] getPatternArguments()
      Specified by:
      getPatternArguments in interface org.refcodes.exception.Trap
      Overrides:
      getPatternArguments in class ArgsSyntaxException