public class NotBlankValidator extends Object implements ConstraintValidator<NotBlank,String>
| Constructor and Description |
|---|
NotBlankValidator() |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(NotBlank annotation)
Initialize the validator in preparation for isValid calls.
|
boolean |
isValid(String s,
ConstraintValidatorContext constraintValidatorContext)
Checks that the trimmed string is not empty.
|
public void initialize(NotBlank annotation)
ConstraintValidatorinitialize in interface ConstraintValidator<NotBlank,String>annotation - annotation instance for a given constraint declarationpublic boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext)
isValid in interface ConstraintValidator<NotBlank,String>s - The string to validate.constraintValidatorContext - context in which the constraint is evaluated.true if the string is null or the length of s between the specified
min and max values (inclusive), false otherwise.Copyright © 2012 JBoss by Red Hat. All Rights Reserved.