Class MainExceptionMapper

java.lang.Object
ch.tocco.nice2.rest.core.impl.exception.MainExceptionMapper
All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<Exception>, org.glassfish.jersey.spi.ExtendedExceptionMapper<Exception>

public class MainExceptionMapper extends Object implements org.glassfish.jersey.spi.ExtendedExceptionMapper<Exception>
This is the only ExceptionMapper which is registered in the Jersey config directly. All other mappers are registered in the exceptionMappers Map and will be called by this mapper. The reason for this delegation is, that Jersey extracts the exception class to map the mapper onto from the generic parameter of the interface. Because of the Spring proxy mechanism this parameter is not available on the interface, when Jersey tries to read it.
  • Constructor Details

  • Method Details

    • isMappable

      public boolean isMappable(Exception exception)
      Specified by:
      isMappable in interface org.glassfish.jersey.spi.ExtendedExceptionMapper<Exception>
    • toResponse

      public jakarta.ws.rs.core.Response toResponse(Exception exception)
      Specified by:
      toResponse in interface jakarta.ws.rs.ext.ExceptionMapper<Exception>