Package org.keycloak.validate.validators
Class NotBlankValidator
- java.lang.Object
-
- org.keycloak.validate.validators.NotBlankValidator
-
- All Implemented Interfaces:
Provider
,ProviderFactory<Validator>
,SimpleValidator
,Validator
,ValidatorFactory
public class NotBlankValidator extends Object implements SimpleValidator
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:
NotEmptyValidator
-
-
Field Summary
Fields Modifier and Type Field Description static String
ID
static NotBlankValidator
INSTANCE
static String
MESSAGE_BLANK
-
Constructor Summary
Constructors Constructor Description NotBlankValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getId()
ValidationContext
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 Detail
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
MESSAGE_BLANK
public static final String MESSAGE_BLANK
- See Also:
- Constant Field Values
-
INSTANCE
public static final NotBlankValidator INSTANCE
-
-
Method Detail
-
getId
public String 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)
-
-