public class ValidatorConstraintResolver extends Object implements ConstraintResolver
ConstraintResolver
that uses a Bean Validation Validator
to resolve
constraints. The name of the constraint is the fully-qualified class name of the
constraint annotation. For example, a NotNull
constraint will be named
javax.validation.constraints.NotNull
.Constructor and Description |
---|
ValidatorConstraintResolver()
Creates a new
ValidatorConstraintResolver that will use a Validator
in its default configurationto resolve constraints. |
ValidatorConstraintResolver(Validator validator)
Creates a new
ValidatorConstraintResolver that will use the given
Validator to resolve constraints. |
Modifier and Type | Method and Description |
---|---|
List<Constraint> |
resolveForProperty(String property,
Class<?> clazz)
Resolves and returns the constraints for the given
property on the given
clazz . |
public ValidatorConstraintResolver()
ValidatorConstraintResolver
that will use a Validator
in its default configurationto resolve constraints.public ValidatorConstraintResolver(Validator validator)
ValidatorConstraintResolver
that will use the given
Validator
to resolve constraints.validator
- the validatorpublic List<Constraint> resolveForProperty(String property, Class<?> clazz)
ConstraintResolver
property
on the given
clazz
. If there are no constraints, an empty list is returned.resolveForProperty
in interface ConstraintResolver
property
- the propertyclazz
- the classnull