java.lang.Object
org.hibernate.validator.internal.constraintvalidators.hv.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
  • Constructor Details

    • NotBlankValidator

      public NotBlankValidator()
  • Method Details

    • 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 the trimmed charSequence is strictly superior to 0, false otherwise