Interface ConfiguredValidator
- All Superinterfaces:
jakarta.validation.Validator
Configured validator for Jersey validation purposes.
- Author:
- Michal Gajdos
-
Method Summary
Modifier and TypeMethodDescriptionvoid
validateResourceAndInputParams
(Object resource, Invocable resourceMethod, Object[] args) Validates resource class instance and input parameters of themethod
.void
validateResult
(Object resource, Invocable resourceMethod, Object result) Validates response instance / response entity of themethod
.Methods inherited from interface jakarta.validation.Validator
forExecutables, getConstraintsForClass, unwrap, validate, validateProperty, validateValue
-
Method Details
-
validateResourceAndInputParams
void validateResourceAndInputParams(Object resource, Invocable resourceMethod, Object[] args) throws jakarta.validation.ConstraintViolationException Validates resource class instance and input parameters of themethod
.ConstraintViolationException
raised from this method should be mapped to HTTP 400 status.- Parameters:
resource
- resource class instance.resourceMethod
- invocable containing handling and validation methods.args
- input method parameters.- Throws:
jakarta.validation.ConstraintViolationException
- ifConstraintViolation
occurs (should be mapped to HTTP 400 status).
-
validateResult
void validateResult(Object resource, Invocable resourceMethod, Object result) throws jakarta.validation.ConstraintViolationException Validates response instance / response entity of themethod
.ConstraintViolationException
raised from this method should be mapped to HTTP 500 status.- Parameters:
resource
- resource class instance.resourceMethod
- invocable containing handling and validation methods.result
- response entity.- Throws:
jakarta.validation.ConstraintViolationException
- ifConstraintViolation
occurs (should be mapped to HTTP 500 status).
-