Package org.keycloak.validate
Class Validators
java.lang.Object
org.keycloak.validate.Validators
Facade for Validation functions with support for
Validator
implementation lookup by id.-
Constructor Summary
ConstructorDescriptionValidators
(KeycloakSession session) Creates a newValidators
instance with the givenKeycloakSession
. -
Method Summary
Modifier and TypeMethodDescriptionstatic LocalDateValidator
static DoubleValidator
static EmailValidator
static Validator
static ValidatorFactory
static IntegerValidator
static LengthValidator
static NotBlankValidator
static NotEmptyValidator
static OptionsValidator
static PatternValidator
static UriValidator
validateConfig
(String id, ValidatorConfig config) static ValidationResult
validateConfig
(KeycloakSession session, String id, ValidatorConfig config) Look-up for a built-in or registeredValidator
with the given providerid
.static Validator
validator
(KeycloakSession session, String id) Look-up up for a built-in or registeredValidator
with the given validatorId.static ValidatorConfigValidator
Look-up for a built-in or registeredValidatorFactory
with the given providerid
.static ValidatorFactory
validatorFactory
(KeycloakSession session, String id) Look-up for a built-in or registeredValidatorFactory
with the given validatorId.
-
Constructor Details
-
Validators
Creates a newValidators
instance with the givenKeycloakSession
.- Parameters:
session
-
-
-
Method Details
-
validator
Look-up for a built-in or registeredValidator
with the given providerid
.- Parameters:
id
-- Returns:
- See Also:
-
validatorFactory
Look-up for a built-in or registeredValidatorFactory
with the given providerid
.- Parameters:
id
-- Returns:
- See Also:
-
validateConfig
- Parameters:
id
-config
-- Returns:
- See Also:
-
getInternalValidatorById
-
getInternalValidatorFactoryById
-
getInternalValidators
-
notBlankValidator
-
notEmptyValidator
-
lengthValidator
-
uriValidator
-
emailValidator
-
patternValidator
-
doubleValidator
-
integerValidator
-
dateValidator
-
optionsValidator
-
validatorConfigValidator
-
validator
Look-up up for a built-in or registeredValidator
with the given validatorId.- Parameters:
session
- theKeycloakSession
id
- the id of the validator- Returns:
- the
Validator
or null
-
validatorFactory
Look-up for a built-in or registeredValidatorFactory
with the given validatorId.This is intended for users who want to dynamically create new
Validator
instances, validateValidatorConfig
configurations or create default configurations for aValidator
.- Parameters:
session
- theKeycloakSession
id
- the id of the validator- Returns:
- the
Validator
or null
-
validateConfig
public static ValidationResult validateConfig(KeycloakSession session, String id, ValidatorConfig config) - Parameters:
session
-id
- of the validatorconfig
- to be validated- Returns:
-