public interface ConcreteExceptionResolver<T extends Throwable> extends ExceptionResolver<T>
COMPOSITE_EXCEPTION_RESOLVER
Modifier and Type | Method and Description |
---|---|
default Optional<org.springframework.http.HttpHeaders> |
createHeaders(org.springframework.web.context.request.RequestAttributes request,
T throwable) |
default Optional<ExceptionTranslator.Location> |
find(T throwable) |
default <A> A |
getAttribute(org.springframework.web.context.request.RequestAttributes requestAttributes,
String name)
find a request attribute.
|
Class<T> |
getExceptionClass() |
ExceptionTranslator |
getExceptionTranslator() |
default Optional<String> |
localizedMessage(org.springframework.web.context.request.RequestAttributes request,
ExceptionTranslator.Location location,
T throwable)
Translate exception and generates localizedMessage.
|
default <E extends Throwable> |
message(org.springframework.web.context.request.RequestAttributes requestAttributes,
E throwable,
Optional<List<ValidationError>> validationErrorsOptional) |
void |
setConversionService(org.springframework.core.convert.ConversionService conversionService)
set conversionService.
|
void |
setExceptionTranslator(ExceptionTranslator exceptionTranslator) |
void |
setStackTraceIndicator(StackTraceIndicator stackTraceIndicator) |
default Optional<Integer> |
status(org.springframework.web.context.request.RequestAttributes requestAttributes,
ExceptionTranslator.Location location,
T throwable) |
default Optional<List<ValidationError>> |
validationErrors(T throwable)
validation errors.
|
resolve, resolve
void setConversionService(org.springframework.core.convert.ConversionService conversionService)
conversionService
- convert value in validation error into stringExceptionTranslator getExceptionTranslator()
void setExceptionTranslator(ExceptionTranslator exceptionTranslator)
void setStackTraceIndicator(StackTraceIndicator stackTraceIndicator)
default Optional<org.springframework.http.HttpHeaders> createHeaders(org.springframework.web.context.request.RequestAttributes request, T throwable)
default <A> A getAttribute(org.springframework.web.context.request.RequestAttributes requestAttributes, String name)
A
- attributeTyperequestAttributes
- requestAttributesname
- namedefault <E extends Throwable> String message(org.springframework.web.context.request.RequestAttributes requestAttributes, E throwable, Optional<List<ValidationError>> validationErrorsOptional)
default Optional<ExceptionTranslator.Location> find(T throwable)
default Optional<Integer> status(org.springframework.web.context.request.RequestAttributes requestAttributes, ExceptionTranslator.Location location, T throwable)
default Optional<String> localizedMessage(org.springframework.web.context.request.RequestAttributes request, ExceptionTranslator.Location location, T throwable)
request
- The current request.location
- The location get data from.throwable
- throwabledefault Optional<List<ValidationError>> validationErrors(T throwable)
throwable
- ConstraintViolationException
, MethodArgumentNotValidException
Copyright © 2017. All rights reserved.