Class BlankAttributeValidator
java.lang.Object
org.keycloak.userprofile.validator.BlankAttributeValidator
- All Implemented Interfaces:
Provider,ProviderFactory<Validator>,SimpleValidator,Validator,ValidatorFactory
Validator to check that User Profile attribute value is not blank (null value is OK!). Expects List of Strings as
input.
- Author:
- Vlastimil Elias <velias@redhat.com>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ValidatorConfigcreateConfig(String errorMessage, boolean failOnNull) Create config for this validator to get customized error messagegetId()validate(Object input, String inputHint, ValidationContext context, ValidatorConfig config) Validates the giveninputwith an additionalinputHintandconfig.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.provider.ProviderFactory
dependsOn, getConfigMetadata, orderMethods inherited from interface org.keycloak.validate.SimpleValidator
close, create, init, postInitMethods inherited from interface org.keycloak.validate.Validator
validate, validate, validate, validate, validateMethods inherited from interface org.keycloak.validate.ValidatorFactory
validateConfig
-
Field Details
-
ID
- See Also:
-
CFG_ERROR_MESSAGE
- See Also:
-
CFG_FAIL_ON_NULL
- See Also:
-
-
Constructor Details
-
BlankAttributeValidator
public BlankAttributeValidator()
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceProviderFactory<Validator>
-
validate
public ValidationContext validate(Object input, String inputHint, ValidationContext context, ValidatorConfig config) Description copied from interface:ValidatorValidates the giveninputwith an additionalinputHintandconfig. -
createConfig
Create config for this validator to get customized error message- Parameters:
errorMessage- to be used if validation failsfailOnNull- makes validator fail on null values also (not on empty string only as is the default behavior)- Returns:
- config
-