Class EcmsExceptionFactory
- java.lang.Object
-
- com.lexmark.saperion.exceptions.mappings.EcmsExceptionFactory
-
public class EcmsExceptionFactory extends java.lang.Object
Global exception factory. This factory implementation serves as single point of entry to all exception factories in the system.- Author:
- owaeldrich
-
-
Constructor Summary
Constructors Constructor Description EcmsExceptionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Exception
createException(com.lexmark.saperion.exceptions.ErrorType error, java.lang.Throwable cause)
Creates a new exception for the given service fault.boolean
validate(com.lexmark.saperion.exceptions.ErrorCodeType errorCode)
Checks that the error code is supported by exactly one registered exception factory.
-
-
-
Method Detail
-
createException
public java.lang.Exception createException(com.lexmark.saperion.exceptions.ErrorType error, java.lang.Throwable cause)
Creates a new exception for the given service fault. If no appropriate exception mapping can be found this method returnsnull
.- Parameters:
error
- the service errorcause
- the exception cause- Returns:
- the new exception for the given service fault
-
validate
public boolean validate(com.lexmark.saperion.exceptions.ErrorCodeType errorCode) throws InconsistentExceptionFactoryRegistryException
Checks that the error code is supported by exactly one registered exception factory. If the code is supported by exactly one factory the method returnstrue
. If the code is not supported by any registered factory the method returnsfalse
. If the code is supported by more than one registered factory an exception is raised.- Parameters:
errorCode
- the error code to validate- Returns:
true
if exactly one registered factory supports this error code, otherwise false.- Throws:
java.lang.Exception
- raised if multiple factories support the given error codeInconsistentExceptionFactoryRegistryException
-
-