@Produces @Singleton @Requires(classes={javax.validation.ConstraintViolationException.class,ExceptionHandler.class}) public class ConstraintExceptionHandler extends java.lang.Object implements ExceptionHandler<javax.validation.ConstraintViolationException,HttpResponse<?>>
ExceptionHandler for ConstraintViolationException.| Constructor and Description |
|---|
ConstraintExceptionHandler()
Deprecated.
Use
ConstraintExceptionHandler(ErrorResponseProcessor) instead. |
ConstraintExceptionHandler(ErrorResponseProcessor<?> responseProcessor)
Constructor.
|
ConstraintExceptionHandler(JacksonConfiguration jacksonConfiguration)
Deprecated.
Use
ConstraintExceptionHandler(ErrorResponseProcessor) instead. |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
buildMessage(javax.validation.ConstraintViolation violation)
Builds a message based on the provided violation.
|
HttpResponse<?> |
handle(HttpRequest request,
javax.validation.ConstraintViolationException exception)
Handles an exception and returns the result.
|
@Deprecated public ConstraintExceptionHandler()
ConstraintExceptionHandler(ErrorResponseProcessor) instead.@Deprecated public ConstraintExceptionHandler(JacksonConfiguration jacksonConfiguration)
ConstraintExceptionHandler(ErrorResponseProcessor) instead.jacksonConfiguration - Jackson configuration@Inject public ConstraintExceptionHandler(ErrorResponseProcessor<?> responseProcessor)
responseProcessor - Error Response Processorpublic HttpResponse<?> handle(HttpRequest request, javax.validation.ConstraintViolationException exception)
ExceptionHandlerhandle in interface ExceptionHandler<javax.validation.ConstraintViolationException,HttpResponse<?>>request - The requestexception - The exception typeprotected java.lang.String buildMessage(javax.validation.ConstraintViolation violation)
violation - The constraint violation