public class DomainValidator extends java.lang.Object implements Validator
To use this validator, just annotate the annotation with the constraints like the example bellow:
@NotNull
@NotEmpty
@SomeConstraint
@ValidatorClass(DomainValidator.class)
@Retention(RetentionPolicy.RUNTIME)
public @interface MyConstraint {
}
This validator is useful to create domain constraints and simplify coding.Constructor and Description |
---|
DomainValidator(ValidatorFactory factory,
java.lang.annotation.Annotation annotation,
java.lang.Object target,
Element element,
ValidationEngine engine) |
Modifier and Type | Method and Description |
---|---|
boolean |
isValid(java.lang.Object value)
Validates the value according to the constraints defined by this validator.
|
public DomainValidator(ValidatorFactory factory, java.lang.annotation.Annotation annotation, @TargetObject java.lang.Object target, Element element, ValidationEngine engine)
public boolean isValid(java.lang.Object value)
Validator