public class ExceptionMapperFactory extends Object implements ExceptionMappers
Exception mappersimplementation that aggregates exception mappers and server as the main entry point for exception mapper instance lookup.
|Modifier and Type||Class and Description|
|Constructor and Description|
Create new exception mapper factory initialized with
|Modifier and Type||Method and Description|
Get an exception mapping provider for a particular class of exception.
Get an exception mapping provider for a particular exception instance.
public ExceptionMapperFactory(org.glassfish.jersey.internal.inject.InjectionManager injectionManager)
injection managerinstance that will be used to look up all providers implementing
injectionManager- injection manager.
public <T extends Throwable> jakarta.ws.rs.ext.ExceptionMapper<T> findMapping(T exceptionInstance)
This method is similar to method
ExceptionMappers.find(Class). In addition it takes
into an account the result of the
of any mapper that implements Jersey
If an extended exception mapper returns
the mapper is disregarded from the search.
Exception mapping providers are checked one by one until a first provider returns
true from the
isMappable(Throwable) method or until a first provider
is found which best supports the exception type and does not implement
API (i.e. it is a standard JAX-RS
ExceptionMapper). The order in which the providers are
checked is determined by the distance of the declared exception mapper type and the actual exception
Note that if an exception mapping provider does not implement
it is always considered applicable for a given exception instance.
T- type of the exception handled by the exception mapping provider.
exceptionInstance- exception to be handled by the exception mapping provider.
ExceptionMapperfor the supplied exception instance type or
nullif none is found.
Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.