public class NotBlankValidator
extends java.lang.Object
implements javax.validation.ConstraintValidator<javax.validation.constraints.NotBlank,java.lang.CharSequence>
null
nor empty after removing any leading or trailing whitespace.Constructor and Description |
---|
NotBlankValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
isValid(java.lang.CharSequence charSequence,
javax.validation.ConstraintValidatorContext constraintValidatorContext)
Checks that the character sequence is not
null nor empty after removing any leading or trailing
whitespace. |
public boolean isValid(java.lang.CharSequence charSequence, javax.validation.ConstraintValidatorContext constraintValidatorContext)
null
nor empty after removing any leading or trailing
whitespace.isValid
in interface javax.validation.ConstraintValidator<javax.validation.constraints.NotBlank,java.lang.CharSequence>
charSequence
- the character sequence to validateconstraintValidatorContext
- context in which the constraint is evaluatedtrue
if the string is not null
and the length of the trimmed
charSequence
is strictly superior to 0, false
otherwiseCopyright © 2007-2022 Red Hat, Inc. All Rights Reserved