Class ExceptionMapper
java.lang.Object
de.bund.bva.isyfact.serviceapi.common.exception.ExceptionMapper
Deprecated.
This module is deprecated and will be removed in a future release.
It is recommended to use REST according to IsyFacts REST Concept instead.
This class provides methods for transferring the contents of application exceptions to interfaces or transport exceptions.
It also provides the ability to throw an interface exception using an exception ID and a FehlertextProvider.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends de.bund.bva.pliscommon.exception.service.PlisToException>
TcreateToException(String ausnahmeId, FehlertextProvider fehlertextProvider, Class<T> transportExceptionClass, String... parameter) Deprecated.creates a transport exception from the passed values.static <T extends de.bund.bva.pliscommon.exception.service.PlisToException>
TmapException(BaseException exception, Class<T> transportExceptionClass) Deprecated.creates and populates a TransportExcpetion class of the passed type with the values from the passed ApplicationException.static <T extends de.bund.bva.pliscommon.exception.service.PlisToException>
TmapException(TechnicalRuntimeException technicalRuntimeException, Class<T> transportExceptionClass) Deprecated.creates and populates a TransportExcpetion class of the passed type with the values from the passed ApplicationException.
-
Constructor Details
-
ExceptionMapper
public ExceptionMapper()Deprecated.
-
-
Method Details
-
mapException
public static <T extends de.bund.bva.pliscommon.exception.service.PlisToException> T mapException(BaseException exception, Class<T> transportExceptionClass) Deprecated.creates and populates a TransportExcpetion class of the passed type with the values from the passed ApplicationException.- Type Parameters:
T- Type of the TransportExcpetion to be created- Parameters:
exception- The original BaseExceptiontransportExceptionClass- the business or technical TransportException- Returns:
- The TransportException.
- Throws:
IllegalArgumentException- ifnullwas passed as value for the parametertransportExceptionClass.
-
mapException
public static <T extends de.bund.bva.pliscommon.exception.service.PlisToException> T mapException(TechnicalRuntimeException technicalRuntimeException, Class<T> transportExceptionClass) Deprecated.creates and populates a TransportExcpetion class of the passed type with the values from the passed ApplicationException.- Type Parameters:
T- Type of the TransportExcpetion to be created- Parameters:
technicalRuntimeException- The original TechnicalRuntimeExceptiontransportExceptionClass- the business or technical TransportException- Returns:
- The TransportException.
- Throws:
IllegalArgumentException- ifnullwas passed as value for the parametertransportExceptionClassor the transportException does not have a constructor with the parameters (String.class, String.class, String.class).
-
createToException
public static <T extends de.bund.bva.pliscommon.exception.service.PlisToException> T createToException(String ausnahmeId, FehlertextProvider fehlertextProvider, Class<T> transportExceptionClass, String... parameter) Deprecated.creates a transport exception from the passed values.- Type Parameters:
T- Type of the exception to be created- Parameters:
ausnahmeId- The exception IDfehlertextProvider- The Error Text ProvidertransportExceptionClass- The business or technical TransportExceptionparameter- Variable number of parameter values. Parameter value for the possible variable in an error message.- Returns:
- The TransportException.
- Throws:
IllegalArgumentException- In exceptional cases this exception can occur if one of the following conditions is met:nullwas passed as the value for the parametertransportExceptionClass.fehlertextProvider- the TransportException has no constructor with the parameters (String.class, String.class, String.class).
- the TransportException is an interface or an abstract implementation.
- access to the TransportException violates the Java security policy.
- an exception occurs within the constructor of the TransportException to be created.
-