Class NotBlankValidator
- java.lang.Object
-
- org.apache.logging.log4j.core.config.plugins.validation.validators.NotBlankValidator
-
- All Implemented Interfaces:
ConstraintValidator<NotBlank>
public class NotBlankValidator extends java.lang.Object implements ConstraintValidator<NotBlank>
Validator that checks if aCharSequence
is not entirely composed of whitespace.- Since:
- 2.18.0
-
-
Field Summary
Fields Modifier and Type Field Description private NotBlank
annotation
private static Logger
LOGGER
-
Constructor Summary
Constructors Constructor Description NotBlankValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
err(java.lang.String name)
void
initialize(NotBlank anAnnotation)
Called before this validator is used with the constraint annotation value.boolean
isValid(java.lang.String name, java.lang.Object value)
Indicates if the given value is valid.
-
-
-
Method Detail
-
initialize
public void initialize(NotBlank anAnnotation)
Description copied from interface:ConstraintValidator
Called before this validator is used with the constraint annotation value.- Specified by:
initialize
in interfaceConstraintValidator<NotBlank>
- Parameters:
anAnnotation
- the annotation value this validator will be validating.
-
isValid
public boolean isValid(java.lang.String name, java.lang.Object value)
Description copied from interface:ConstraintValidator
Indicates if the given value is valid.- Specified by:
isValid
in interfaceConstraintValidator<NotBlank>
- Parameters:
name
- the name to use for error reportingvalue
- the value to validate.- Returns:
true
if the given value is valid.
-
err
private boolean err(java.lang.String name)
-
-