public class RequiredValidator extends java.lang.Object implements ConstraintValidator<Required>
null
CharSequence
with length 0Collection
Map
Modifier and Type | Field and Description |
---|---|
private Required |
annotation |
private static Logger |
LOGGER |
Constructor and Description |
---|
RequiredValidator() |
Modifier and Type | Method and Description |
---|---|
private boolean |
err(java.lang.String name) |
void |
initialize(Required anAnnotation)
Called before this validator is used with the constraint annotation value.
|
boolean |
isValid(java.lang.String name,
java.lang.Object value)
Indicates if the given value is valid.
|
public void initialize(Required anAnnotation)
ConstraintValidator
initialize
in interface ConstraintValidator<Required>
anAnnotation
- the annotation value this validator will be validating.public boolean isValid(java.lang.String name, java.lang.Object value)
ConstraintValidator
isValid
in interface ConstraintValidator<Required>
name
- the name to use for error reportingvalue
- the value to validate.true
if the given value is valid.private boolean err(java.lang.String name)