java.lang.Object
java.lang.Throwable
java.lang.Exception
org.refcodes.exception.AbstractException
- All Implemented Interfaces:
Serializable
,ErrorCodeAccessor
,Trap
- Direct Known Subclasses:
LockedException
,MarshalException
,UnmarshalException
,VetoException
Base exception for unpredictable / checked (untestable states) exceptions,
providing functionality for exception specific multi-language messages.
Unpredictable exceptions must be declared or explicitly caught. You as a
programmer cannot take care to prevent such exceptions by according
(business) logic. Such exceptions may be network connection loss or external
peripheral failure.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.exception.ErrorCodeAccessor
ErrorCodeAccessor.ErrorCodeBuilder<B extends ErrorCodeAccessor.ErrorCodeBuilder<B>>, ErrorCodeAccessor.ErrorCodeMutator, ErrorCodeAccessor.ErrorCodeProperty
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractException
(String aMessage) Instantiates a new abstract exception.AbstractException
(String aMessage, String aErrorCode) AbstractException
(String aMessage, Throwable aCause) Instantiates a new abstract exception.AbstractException
(String aMessage, Throwable aCause, String aErrorCode) AbstractException
(Throwable aCause) Instantiates a new abstract exception.AbstractException
(Throwable aCause, String aErrorCode) -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.refcodes.exception.Trap
toLocalizedMessage, toMessage, toShortLocalizedMessage, toShortMessage
-
Constructor Details
-
AbstractException
Instantiates a new abstract exception. -
AbstractException
Instantiates a new abstract exception.- Parameters:
aMessage
- The aMessage describing this exception.
-
AbstractException
Instantiates a new abstract exception. -
AbstractException
- Parameters:
aMessage
- - the detail aMessage (which is saved for later retrieval by the Throwable.getMessage() method).aCause
- - the aCause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the aCause is nonexistent or unknown.)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.
-
AbstractException
- Parameters:
aMessage
- - the detail aMessage (which is saved for later retrieval by the Throwable.getMessage() method).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.
-
AbstractException
- Parameters:
aCause
- - the aCause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the aCause is nonexistent or unknown.)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.
-
-
Method Details
-
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:
getErrorCode
in interfaceErrorCodeAccessor
- Returns:
- The exception code in question.
-