Interface ExceptionMapping<T extends java.lang.Throwable>

    • 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 error
        cause - 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 message
        cause - 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 an ErrorType and a Throwable.
        Returns:
        true if the mapping is valid and the mapped exception fits the design rules, otherwise false