Class ArgsSyntaxException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.refcodes.exception.AbstractException
org.refcodes.cli.CliException
org.refcodes.cli.CliException.CliArgsException
org.refcodes.cli.ArgsSyntaxException
- All Implemented Interfaces:
Serializable,ArgsAccessor,MatchCountAccessor,org.refcodes.exception.ErrorCodeAccessor,org.refcodes.exception.Trap,org.refcodes.mixin.SourceAccessor<Term>
- Direct Known Subclasses:
AmbiguousArgsException,ParseArgsException,SuperfluousArgsException,UnknownArgsException
public class ArgsSyntaxException
extends CliException.CliArgsException
implements org.refcodes.mixin.SourceAccessor<Term>, MatchCountAccessor
Thrown in case of a command line arguments mismatch regarding provided and
expected args.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.refcodes.cli.CliException
CliException.CliArgsExceptionNested classes/interfaces inherited from interface org.refcodes.cli.ArgsAccessor
ArgsAccessor.ArgsMutator, ArgsAccessor.ArgsPropertyNested classes/interfaces inherited from interface org.refcodes.exception.ErrorCodeAccessor
org.refcodes.exception.ErrorCodeAccessor.ErrorCodeBuilder<B extends org.refcodes.exception.ErrorCodeAccessor.ErrorCodeBuilder<B>>, org.refcodes.exception.ErrorCodeAccessor.ErrorCodeMutator, org.refcodes.exception.ErrorCodeAccessor.ErrorCodePropertyNested classes/interfaces inherited from interface org.refcodes.cli.MatchCountAccessor
MatchCountAccessor.MatchCountBuilder<B extends MatchCountAccessor.MatchCountBuilder<B>>, MatchCountAccessor.MatchCountMutator, MatchCountAccessor.MatchCountPropertyNested classes/interfaces inherited from interface org.refcodes.mixin.SourceAccessor
org.refcodes.mixin.SourceAccessor.SourceBuilder<SRC,B extends org.refcodes.mixin.SourceAccessor.SourceBuilder<SRC, B>>, org.refcodes.mixin.SourceAccessor.SourceMutator<SRC>, org.refcodes.mixin.SourceAccessor.SourceProperty<SRC> -
Field Summary
FieldsFields inherited from class org.refcodes.cli.CliException.CliArgsException
_args -
Constructor Summary
ConstructorsConstructorDescriptionArgsSyntaxException(String[] aArgs, Throwable aCause) Instantiates the classArgsSyntaxException.ArgsSyntaxException(String[] aArgs, Throwable aCause, String aErrorCode) Instantiates the classArgsSyntaxException.ArgsSyntaxException(String[] aArgs, Term aSource, Throwable aCause) Instantiates the classArgsSyntaxException.ArgsSyntaxException(String[] aArgs, Term aSource, Throwable aCause, String aErrorCode) Instantiates the classArgsSyntaxException.ArgsSyntaxException(String aMessage, String[] aArgs) Instantiates the classArgsSyntaxException.ArgsSyntaxException(String aMessage, String[] aArgs, String aErrorCode) Instantiates the classArgsSyntaxException.ArgsSyntaxException(String aMessage, String[] aArgs, Throwable aCause) Instantiates the classArgsSyntaxException.ArgsSyntaxException(String aMessage, String[] aArgs, Throwable aCause, String aErrorCode) Instantiates the classArgsSyntaxException.ArgsSyntaxException(String aMessage, String[] aArgs, Term aSource) Instantiates the classArgsSyntaxException.ArgsSyntaxException(String aMessage, String[] aArgs, Term aSource, String aErrorCode) Instantiates the classArgsSyntaxException.ArgsSyntaxException(String aMessage, String[] aArgs, Term aSource, Throwable aCause) Instantiates the classArgsSyntaxException.ArgsSyntaxException(String aMessage, String[] aArgs, Term aSource, Throwable aCause, String aErrorCode) Instantiates the classArgsSyntaxException. -
Method Summary
Modifier and TypeMethodDescriptionintDetermines the number of args being matched upon encountering this exception.Object[]Returns theTermresponsible for this exception.Tries to determine the most verbose description of this exception by crawling the exception tree down the causes and suppressed exceptions and evaluating theirTermsource'sTerm.getMatchCount()argument match counts.Determines the root cause of this exception with the same match count (getMatchCount()) as this exception.Methods inherited from class org.refcodes.cli.CliException.CliArgsException
getArgsMethods inherited from class org.refcodes.exception.AbstractException
getErrorCode, getMessageMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.refcodes.exception.Trap
toLocalizedMessage, toMessage, toMessage, toMessage, toShortLocalizedMessage, toShortMessage
-
Field Details
-
_source
-
_matchCount
protected int _matchCount
-
-
Constructor Details
-
ArgsSyntaxException
Instantiates the classArgsSyntaxException.- Parameters:
aSource- TheTermresponsible for this exception (source).- See Also:
-
ArgsSyntaxException
-
ArgsSyntaxException
-
ArgsSyntaxException
-
ArgsSyntaxException
Instantiates the classArgsSyntaxException.- Parameters:
aSource- TheTermresponsible for this exception (source).- See Also:
-
ArgsSyntaxException
-
ArgsSyntaxException
Instantiates the classArgsSyntaxException.- See Also:
-
ArgsSyntaxException
Instantiates the classArgsSyntaxException.- See Also:
-
ArgsSyntaxException
Instantiates the classArgsSyntaxException.- See Also:
-
ArgsSyntaxException
Instantiates the classArgsSyntaxException.- See Also:
-
ArgsSyntaxException
Instantiates the classArgsSyntaxException.- See Also:
-
ArgsSyntaxException
Instantiates the classArgsSyntaxException.- See Also:
-
-
Method Details
-
getMatchCount
public int getMatchCount()Determines the number of args being matched upon encountering this exception.- Specified by:
getMatchCountin interfaceMatchCountAccessor- Returns:
- The number of args matching till this exception occurred.
-
getSource
-
toHeuristicMessage
Tries to determine the most verbose description of this exception by crawling the exception tree down the causes and suppressed exceptions and evaluating theirTermsource'sTerm.getMatchCount()argument match counts.- Returns:
- The heuristic and verbose cause of this exception.
-
toRootMatchCause
Determines the root cause of this exception with the same match count (getMatchCount()) as this exception.- Returns:
- The actual root cause of this exception or this exception if no (more specific) root cause was determined.
-
getPatternArguments
- Specified by:
getPatternArgumentsin interfaceorg.refcodes.exception.Trap- Overrides:
getPatternArgumentsin classCliException.CliArgsException
-