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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NotBlankValidator()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `initialize(NotBlank annotation)`
    `boolean` | `isValid(CharSequence charSequence, ConstraintValidatorContext constraintValidatorContext)` Checks that the trimmed string is not empty.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NotBlankValidator

          public NotBlankValidator()

  - ### Method Detail

    - #### 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-2014 Red Hat, Inc. All Rights Reserved