@Provider public class ValidationExceptionMapper extends Object implements javax.ws.rs.ext.ExceptionMapper<javax.validation.ValidationException>
Constructor and Description |
---|
ValidationExceptionMapper() |
Modifier and Type | Method and Description |
---|---|
protected String |
buildErrorMessage(javax.validation.ConstraintViolation<?> violation) |
protected javax.ws.rs.core.Response |
buildResponse(javax.ws.rs.core.Response.Status errorStatus,
String responseText) |
void |
setAddMessageToResponse(boolean addMessageToResponse)
Controls whether to add a constraint validation message to Response or not
|
javax.ws.rs.core.Response |
toResponse(javax.validation.ValidationException exception) |
public javax.ws.rs.core.Response toResponse(javax.validation.ValidationException exception)
toResponse
in interface javax.ws.rs.ext.ExceptionMapper<javax.validation.ValidationException>
protected String buildErrorMessage(javax.validation.ConstraintViolation<?> violation)
protected javax.ws.rs.core.Response buildResponse(javax.ws.rs.core.Response.Status errorStatus, String responseText)
public void setAddMessageToResponse(boolean addMessageToResponse)
addMessageToResponse
- add a constraint validation message to ResponseApache CXF