org.hibernate.validator.internal.constraintvalidators
Class NotBlankValidator
java.lang.Object
org.hibernate.validator.internal.constraintvalidators.NotBlankValidator
- All Implemented Interfaces:
- ConstraintValidator<NotBlank,CharSequence>
public class NotBlankValidator
- extends Object
- implements ConstraintValidator<NotBlank,CharSequence>
Check that a character sequence's (e.g. string) trimmed length is not empty.
- Author:
- Hardy Ferentschik
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NotBlankValidator
public NotBlankValidator()
initialize
public void initialize(NotBlank annotation)
- Specified by:
initialize in interface ConstraintValidator<NotBlank,CharSequence>
isValid
public boolean isValid(CharSequence charSequence,
ConstraintValidatorContext constraintValidatorContext)
- Checks that the trimmed string is not empty.
- Specified by:
isValid in interface ConstraintValidator<NotBlank,CharSequence>
- Parameters:
charSequence - The character sequence to validate.constraintValidatorContext - context in which the constraint is evaluated.
- Returns:
- Returns
true if the string is null or the length of charSequence between the specified
min and max values (inclusive), false otherwise.
Copyright © 2007-2013 Red Hat Middleware, LLC. All Rights Reserved