Class AbstractRuntimeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.refcodes.exception.AbstractRuntimeException
- All Implemented Interfaces:
Serializable, ErrorCodeAccessor, Trap
- Direct Known Subclasses:
BugException, DisposedException, IntegrityException, LockedException.LockedRuntimeException, VerifyRuntimeException, VetoException.VetoRuntimeException
Base exception for runtime (unchecked) / predictable (testable states)
exceptions, providing functionality for exception specific multi-language
messages. Regarding unchecked exception, "The Java Programming Language", by
Gosling, Arnold, and Holmes says "... Unchecked runtime exceptions represent
conditions that, generally speaking, reflect errors in your program's logic
and cannot be reasonably recovered from at run time ...". Though you as a
programmer can take care by according (business) logic to prevent such
exception. Such exceptions may be accessing disposed components or any other
aCause where you can test a state beforehand.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface ErrorCodeAccessor
ErrorCodeAccessor.ErrorCodeBuilder<B>, ErrorCodeAccessor.ErrorCodeMutator, ErrorCodeAccessor.ErrorCodeProperty -
Constructor Summary
ConstructorsConstructorDescriptionAbstractRuntimeException(String aMessage) Instantiates the classAbstractRuntimeException.AbstractRuntimeException(String aMessage, String aErrorCode) Instantiates the classAbstractRuntimeException.AbstractRuntimeException(String aMessage, Throwable aCause) Instantiates the classAbstractRuntimeException.AbstractRuntimeException(String aMessage, Throwable aCause, String aErrorCode) Instantiates the classAbstractRuntimeException.AbstractRuntimeException(Throwable aCause) Instantiates the classAbstractRuntimeException.AbstractRuntimeException(Throwable aCause, String aErrorCode) Instantiates the classAbstractRuntimeException. -
Method Summary
Modifier and TypeMethodDescriptionProvides the according exception code.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Trap
getPatternArguments, toLocalizedMessage, toMessage, toMessage, toMessage, toShortLocalizedMessage, toShortMessage
-
Constructor Details
-
AbstractRuntimeException
Instantiates the classAbstractRuntimeException.- See Also:
-
AbstractRuntimeException
Instantiates the classAbstractRuntimeException.- See Also:
-
AbstractRuntimeException
Instantiates the classAbstractRuntimeException.- See Also:
-
AbstractRuntimeException
Instantiates the classAbstractRuntimeException.- Parameters:
aErrorCode- The exception code to be assigned to the exception. An exception code can be provided when creating an exception and it can be used by the business logic to retrieve a language depended exception aMessage (multi-language support) from a language pack instead of just providing the single language aMessage as being stored by the default exceptions.- See Also:
-
AbstractRuntimeException
Instantiates the classAbstractRuntimeException.- Parameters:
aErrorCode- The exception code to be assigned to the exception. An exception code can be provided when creating an exception and it can be used by the business logic to retrieve a language depended exception aMessage (multi-language support) from a language pack instead of just providing the single language aMessage as being stored by the default exceptions.- See Also:
-
AbstractRuntimeException
Instantiates the classAbstractRuntimeException.- Parameters:
aErrorCode- The exception code to be assigned to the exception. An exception code can be provided when creating an exception and it can be used by the business logic to retrieve a language depended exception aMessage (multi-language support) from a language pack instead of just providing the single language aMessage as being stored by the default exceptions.- See Also:
-
-
Method Details
-
getMessage
- Overrides:
getMessagein classThrowable
-
getErrorCode
Provides the according exception code. An exception code can be provided when creating an exception and it can be used by the business logic to retrieve a language depended exception aMessage (multi-language support) from a language pack instead of just providing the single language aMessage as being stored by the default exceptions.- Specified by:
getErrorCodein interfaceErrorCodeAccessor- Returns:
- The exception code in question.
-