Top Description Constructors Methods
org.hibernate.validator.internal.constraintvalidators.bv

public Class NotBlankValidator

extends Object
implements ConstraintValidator<NotBlank, CharSequence>
Class Inheritance
All Implemented Interfaces
jakarta.validation.ConstraintValidator
Imports
jakarta.validation.ConstraintValidator, .ConstraintValidatorContext, jakarta.validation.constraints.NotBlank

Check that a character sequence is not null nor empty after removing any leading or trailing whitespace.
Author
Guillaume Smet

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

returns true if the string is not null and the length of the trimmed charSequence is strictly superior to 0, false otherwise
isValid
(CharSequence
the character sequence to validate
charSequence
,
ConstraintValidatorContext
context in which the constraint is evaluated
constraintValidatorContext
)

Implements jakarta.validation.ConstraintValidator.isValid.

Checks that the character sequence is not null nor empty after removing any leading or trailing whitespace.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NotBlankValidatorback to summary
public NotBlankValidator()

Method Detail

isValidback to summary
public boolean isValid(CharSequence charSequence, ConstraintValidatorContext constraintValidatorContext)

Implements jakarta.validation.ConstraintValidator.isValid.

Checks that the character sequence is not null nor empty after removing any leading or trailing whitespace.

Parameters
charSequence:CharSequence

the character sequence to validate

constraintValidatorContext:ConstraintValidatorContext

context in which the constraint is evaluated

Returns:boolean

returns true if the string is not null and the length of the trimmed charSequence is strictly superior to 0, false otherwise

Annotations
@Override