Package org.keycloak.validate.validators
Class NotBlankValidator
java.lang.Object
org.keycloak.validate.validators.NotBlankValidator
- All Implemented Interfaces:
Provider
,ProviderFactory<Validator>
,SimpleValidator
,Validator
,ValidatorFactory
Validate that value exists and is not empty nor blank. Supports String and collection of Strings as input. For
collection of Strings input has to contain at least one element and it have to be non-blank to satisfy this
validation. If collection contains something else than String, or if even one String in it is blank, then this
validation fails.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final NotBlankValidator
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetId()
validate
(Object input, String inputHint, ValidationContext context, ValidatorConfig config) Validates the giveninput
with an additionalinputHint
andconfig
.protected boolean
validateStringValue
(String value, String inputHint, ValidationContext context, ValidatorConfig config) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.provider.ProviderFactory
getConfigMetadata, order
Methods inherited from interface org.keycloak.validate.SimpleValidator
close, create, init, postInit
Methods inherited from interface org.keycloak.validate.Validator
validate, validate, validate, validate, validate, validate
Methods inherited from interface org.keycloak.validate.ValidatorFactory
validateConfig
-
Field Details
-
ID
- See Also:
-
MESSAGE_BLANK
- See Also:
-
INSTANCE
-
-
Constructor Details
-
NotBlankValidator
public NotBlankValidator()
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceProviderFactory<Validator>
-
validate
public ValidationContext validate(Object input, String inputHint, ValidationContext context, ValidatorConfig config) Description copied from interface:Validator
Validates the giveninput
with an additionalinputHint
andconfig
. -
validateStringValue
protected boolean validateStringValue(String value, String inputHint, ValidationContext context, ValidatorConfig config)
-