java.lang.Object
java.lang.Throwable
java.lang.Exception
org.refcodes.exception.AbstractException
org.refcodes.cli.CliException
org.refcodes.cli.CliException.ConsoleArgsException
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.ConsoleArgsException
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.ConsoleArgsException, CliException.ConsoleCliExceptionNested 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.MatchCountProperty -
Constructor Summary
ConstructorsConstructorDescriptionArgsSyntaxException(String[] aArgs, String aMessage) Instantiates a newArgsSyntaxExceptionexception.ArgsSyntaxException(String[] aArgs, String aMessage, String aErrorCode) Instantiates a newArgsSyntaxExceptionexception.ArgsSyntaxException(String[] aArgs, String aMessage, String aErrorCode, Term aSource) Instantiates a newArgsSyntaxExceptionexception.ArgsSyntaxException(String[] aArgs, String aMessage, Throwable aCause) Instantiates a newArgsSyntaxExceptionexception.ArgsSyntaxException(String[] aArgs, String aMessage, Throwable aCause, String aErrorCode) Instantiates a newArgsSyntaxExceptionexception.ArgsSyntaxException(String[] aArgs, String aMessage, Throwable aCause, String aErrorCode, Term aSource) Instantiates a newArgsSyntaxExceptionexception.ArgsSyntaxException(String[] aArgs, String aMessage, Throwable aCause, Term aSource) Instantiates a newArgsSyntaxExceptionexception.ArgsSyntaxException(String[] aArgs, String aMessage, Term aSource) Instantiates a newArgsSyntaxExceptionexception.ArgsSyntaxException(String[] aArgs, Throwable aCause) Instantiates a newArgsSyntaxExceptionexception.ArgsSyntaxException(String[] aArgs, Throwable aCause, String aErrorCode) Instantiates a newArgsSyntaxExceptionexception.ArgsSyntaxException(String[] aArgs, Throwable aCause, String aErrorCode, Term aSource) Instantiates a newArgsSyntaxExceptionexception.ArgsSyntaxException(String[] aArgs, Throwable aCause, Term aSource) Instantiates a newArgsSyntaxExceptionexception. -
Method Summary
Modifier and TypeMethodDescriptionintDetermines the number of args being matched upon encountering this exception.Returns theTermresponsible for this exception.Tries to determine the most likely cause 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.ConsoleArgsException
getArgsMethods inherited from class org.refcodes.exception.AbstractException
getErrorCodeMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, 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, toShortLocalizedMessage, toShortMessage
-
Constructor Details
-
ArgsSyntaxException
Instantiates a newArgsSyntaxExceptionexception.- Parameters:
aArgs- The arguments participating in the exception.aMessage- The aMessage describing this exception.aSource- TheTermresponsible for this exception (source).
-
ArgsSyntaxException
Instantiates a newArgsSyntaxExceptionexception.- Parameters:
aArgs- The arguments participating in the exception.aMessage- The aMessage describing this exception.aErrorCode- The error code identifying this exception.aSource- TheTermresponsible for this exception (source).
-
ArgsSyntaxException
Instantiates a newArgsSyntaxExceptionexception. -
ArgsSyntaxException
public ArgsSyntaxException(String[] aArgs, String aMessage, Throwable aCause, String aErrorCode, Term aSource) Instantiates a newArgsSyntaxExceptionexception. -
ArgsSyntaxException
Instantiates a newArgsSyntaxExceptionexception. -
ArgsSyntaxException
Instantiates a newArgsSyntaxExceptionexception. -
ArgsSyntaxException
Instantiates a newArgsSyntaxExceptionexception.- Parameters:
aArgs- The arguments participating in the exception.aMessage- The aMessage describing this exception.
-
ArgsSyntaxException
Instantiates a newArgsSyntaxExceptionexception.- Parameters:
aArgs- The arguments participating in the exception.aMessage- The aMessage describing this exception.aErrorCode- The error code identifying this exception.
-
ArgsSyntaxException
Instantiates a newArgsSyntaxExceptionexception. -
ArgsSyntaxException
Instantiates a newArgsSyntaxExceptionexception. -
ArgsSyntaxException
Instantiates a newArgsSyntaxExceptionexception. -
ArgsSyntaxException
Instantiates a newArgsSyntaxExceptionexception.
-
-
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
Returns theTermresponsible for this exception. -
toHeuristicMessage
Tries to determine the most likely cause of this exception by crawling the exception tree down the causes and suppressed exceptions and evaluating theirTermsource'sTerm.getMatchCount()argument match counts.Throwable.getSuppressed()exceptions, the causeThrowable.getCause()is at a CHILD level of THIS exception, the cause's suppressed exceptions are at the SAME level as the cause itself. A wrong idea of the hierarchy of exceptions has erroneously been implemented, this implementation got to corrected as described.- Returns:
- The heuristic 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.
-