Interface ExceptionMapping<T extends java.lang.Throwable>
-
- Type Parameters:
T
- the mapped exception type
- All Known Implementing Classes:
ApplicationExceptionFactory.ApplicationErrors
,EcmsExceptionMapping
,RuntimeExceptionFactory.RuntimeErrors
,SystemExceptionFactory.SystemErrors
public interface ExceptionMapping<T extends java.lang.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:
ExceptionFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
createException(com.lexmark.saperion.exceptions.ErrorType error, java.lang.Throwable cause)
Creates a new exception for the given server fault.T
createException(java.lang.String message)
Creates a new exception for the given server fault.T
createException(java.lang.String message, java.lang.Throwable cause)
Creates a new exception for the given server fault.T
createException(java.lang.Throwable cause)
Creates a new exception for the given server fault.com.lexmark.saperion.exceptions.ErrorCodeType
getErrorCode()
Returns the error code this exception mapping applies to.boolean
validate()
Validates the integrity of the exception mapping.
-
-
-
Method Detail
-
createException
T createException(com.lexmark.saperion.exceptions.ErrorType error, java.lang.Throwable cause)
Creates a new exception for the given server fault.- Parameters:
error
- the server errorcause
- the exception cause- Returns:
- the new exception
-
createException
T createException(java.lang.String message)
Creates a new exception for the given server fault.- Parameters:
message
- the error message- Returns:
- the new exception
-
createException
T createException(java.lang.String message, java.lang.Throwable cause)
Creates a new exception for the given server fault.- Parameters:
message
- the error messagecause
- the exception cause- Returns:
- the new exception
-
createException
T createException(java.lang.Throwable cause)
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
-
-