|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IValidator
An interface implemented by Validator for easier mocking.
Method Summary | |
---|---|
void |
assertValid(Object validatedObject)
validates the field and getter constrains of the given object and throws an ConstraintsViolatedException if any constraint violations are detected |
void |
assertValidFieldValue(Object validatedObject,
Field validatedField,
Object fieldValueToValidate)
Validates the give value against the defined field constraints and throws an ConstraintsViolatedException if any constraint violations are detected. |
List<ConstraintViolation> |
validate(Object validatedObject)
validates the field and getter constrains of the given object |
List<ConstraintViolation> |
validate(Object validatedObject,
String... profiles)
validates the field and getter constrains of the given object |
List<ConstraintViolation> |
validateFieldValue(Object validatedObject,
Field validatedField,
Object fieldValueToValidate)
Validates the give value against the defined field constraints. |
Method Detail |
---|
void assertValid(Object validatedObject) throws IllegalArgumentException, ValidationFailedException, ConstraintsViolatedException
validatedObject
- the object to validate, cannot be null
ConstraintsViolatedException
ValidationFailedException
IllegalArgumentException
- if validatedObject == null
void assertValidFieldValue(Object validatedObject, Field validatedField, Object fieldValueToValidate) throws IllegalArgumentException, ValidationFailedException, ConstraintsViolatedException
validatedObject
- the object to validate, cannot be nullvalidatedField
- the field to validate, cannot be null
IllegalArgumentException
- if validatedObject == null
or field == null
ConstraintsViolatedException
ValidationFailedException
List<ConstraintViolation> validate(Object validatedObject) throws IllegalArgumentException, ValidationFailedException
validatedObject
- the object to validate, cannot be null
ValidationFailedException
IllegalArgumentException
- if validatedObject == null
List<ConstraintViolation> validate(Object validatedObject, String... profiles) throws IllegalArgumentException, ValidationFailedException
validatedObject
- the object to validate, cannot be nullprofiles
- constraint profiles to validate against, by default the globally enabled profiles are used that.
ValidationFailedException
IllegalArgumentException
- if validatedObject == null
List<ConstraintViolation> validateFieldValue(Object validatedObject, Field validatedField, Object fieldValueToValidate) throws IllegalArgumentException, ValidationFailedException
IllegalArgumentException
- if validatedObject == null
or validatedField == null
ValidationFailedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |