Package io.dropwizard.jersey.validation
Class ConstraintMessage
- java.lang.Object
-
- io.dropwizard.jersey.validation.ConstraintMessage
-
public class ConstraintMessage extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends javax.validation.ConstraintViolation<?>>
intdetermineStatus(Set<T> violations, org.glassfish.jersey.server.model.Invocable invocable)
Given a set of constraint violations and a JerseyInvocable
where the constraint occurred, determine the HTTP Status code for the response.static String
getMessage(javax.validation.ConstraintViolation<?> v, org.glassfish.jersey.server.model.Invocable invocable)
Gets the human friendly location of where the violation was raised.static Optional<String>
isRequestEntity(javax.validation.ConstraintViolation<?> violation, org.glassfish.jersey.server.model.Invocable invocable)
Determines if constraint violation occurred in the request entity.
-
-
-
Method Detail
-
getMessage
public static String getMessage(javax.validation.ConstraintViolation<?> v, org.glassfish.jersey.server.model.Invocable invocable)
Gets the human friendly location of where the violation was raised.
-
isRequestEntity
public static Optional<String> isRequestEntity(javax.validation.ConstraintViolation<?> violation, org.glassfish.jersey.server.model.Invocable invocable)
Determines if constraint violation occurred in the request entity. If it did, return a client friendly string representation of where the error occurred (eg. "patient.name")
-
determineStatus
public static <T extends javax.validation.ConstraintViolation<?>> int determineStatus(Set<T> violations, org.glassfish.jersey.server.model.Invocable invocable)
Given a set of constraint violations and a JerseyInvocable
where the constraint occurred, determine the HTTP Status code for the response. A return value violation is an internal server error, an invalid request body is unprocessable entity, and any params that are invalid means a bad request
-
-