Interface ExceptionMapping<T extends Throwable>
- Type Parameters:
T
- the mapped exception type
- All Known Implementing Classes:
ApplicationExceptionFactory.ApplicationErrors
,EcmsExceptionMapping
,RuntimeExceptionFactory.RuntimeErrors
,SystemExceptionFactory.SystemErrors
public interface ExceptionMapping<T extends Throwable>
An exception mapping associates an error code with a specific exception class. Error mappings are used by exception
factories in order to build up the factories internal mapping registries.
- Author:
- owaeldrich
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateException
(com.lexmark.saperion.exceptions.ErrorType error, Throwable cause) Creates a new exception for the given server fault.createException
(String message) Creates a new exception for the given server fault.createException
(String message, Throwable cause) Creates a new exception for the given server fault.createException
(Throwable cause) Creates a new exception for the given server fault.com.lexmark.saperion.exceptions.ErrorCodeType
Returns the error code this exception mapping applies to.boolean
validate()
Validates the integrity of the exception mapping.
-
Method Details
-
createException
Creates a new exception for the given server fault.- Parameters:
error
- the server errorcause
- the exception cause- Returns:
- the new exception
-
createException
Creates a new exception for the given server fault.- Parameters:
message
- the error message- Returns:
- the new exception
-
createException
Creates a new exception for the given server fault.- Parameters:
message
- the error messagecause
- the exception cause- Returns:
- the new exception
-
createException
Creates a new exception for the given server fault.- Parameters:
cause
- the exception cause- Returns:
- the new exception
-
getErrorCode
com.lexmark.saperion.exceptions.ErrorCodeType getErrorCode()Returns the error code this exception mapping applies to.- Returns:
- the exception mapping's error code
-
validate
boolean validate()Validates the integrity of the exception mapping. An exception mapping is valid if the mapped exception class can be instantiated and an appropriate factory constructor exists. Appropriate exception implementations must provide a factory constructors that consume anErrorType
and aThrowable
.- Returns:
true
if the mapping is valid and the mapped exception fits the design rules, otherwisefalse
-