org.keycloak.validate

## Class Validators

- java.lang.Object
- - org.keycloak.validate.Validators

-     public class Validators
      extends Object

  Facade for Validation functions with support for `Validator` implementation lookup by id.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Validators(KeycloakSession session)` Creates a new `Validators` instance with the given `KeycloakSession`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static LocalDateValidator` | `dateValidator()`
    `static DoubleValidator` | `doubleValidator()`
    `static EmailValidator` | `emailValidator()`
    `static Validator` | `getInternalValidatorById(String id)`
    `static ValidatorFactory` | `getInternalValidatorFactoryById(String id)`
    `static Map<String,Validator>` | `getInternalValidators()`
    `static IntegerValidator` | `integerValidator()`
    `static LengthValidator` | `lengthValidator()`
    `static NotBlankValidator` | `notBlankValidator()`
    `static NotEmptyValidator` | `notEmptyValidator()`
    `static PatternValidator` | `patternValidator()`
    `static UriValidator` | `uriValidator()`
    `static ValidationResult` | `validateConfig(KeycloakSession session, String id, ValidatorConfig config)` Validates the `ValidatorConfig` of `Validator` referenced by the given provider `id`.
    `ValidationResult` | `validateConfig(String id, ValidatorConfig config)` Validates the `ValidatorConfig` of `Validator` referenced by the given provider `id`.
    `static Validator` | `validator(KeycloakSession session, String id)` Look-up up for a built-in or registered `Validator` with the given validatorId.
    `Validator` | `validator(String id)` Look-up for a built-in or registered `Validator` with the given provider `id`.
    `static ValidatorConfigValidator` | `validatorConfigValidator()`
    `static ValidatorFactory` | `validatorFactory(KeycloakSession session, String id)` Look-up for a built-in or registered `ValidatorFactory` with the given validatorId.
    `ValidatorFactory` | `validatorFactory(String id)` Look-up for a built-in or registered `ValidatorFactory` with the given provider `id`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Validators

          public Validators(KeycloakSession session)

      Creates a new `Validators` instance with the given `KeycloakSession`.
      Parameters:
        `session` -

  - ### Method Detail

    - #### validator

          public Validator validator(String id)

      Look-up for a built-in or registered `Validator` with the given provider `id`.
      Parameters:
        `id` -
      Returns:
      See Also:
        `validator(KeycloakSession, String)`

    - #### validatorFactory

          public ValidatorFactory validatorFactory(String id)

      Look-up for a built-in or registered `ValidatorFactory` with the given provider `id`.
      Parameters:
        `id` -
      Returns:
      See Also:
        `validatorFactory(KeycloakSession, String)`

    - #### validateConfig

          public ValidationResult validateConfig(String id,
                                                 ValidatorConfig config)

      Validates the `ValidatorConfig` of `Validator` referenced by the given provider `id`.
      Parameters:
        `id` -
        `config` -
      Returns:
      See Also:
        `validateConfig(KeycloakSession, String, ValidatorConfig)`

    - #### getInternalValidatorById

          public static Validator getInternalValidatorById(String id)

    - #### getInternalValidatorFactoryById

          public static ValidatorFactory getInternalValidatorFactoryById(String id)

    - #### getInternalValidators

          public static Map<String,Validator> getInternalValidators()

    - #### notBlankValidator

          public static NotBlankValidator notBlankValidator()

    - #### notEmptyValidator

          public static NotEmptyValidator notEmptyValidator()

    - #### lengthValidator

          public static LengthValidator lengthValidator()

    - #### uriValidator

          public static UriValidator uriValidator()

    - #### emailValidator

          public static EmailValidator emailValidator()

    - #### patternValidator

          public static PatternValidator patternValidator()

    - #### doubleValidator

          public static DoubleValidator doubleValidator()

    - #### integerValidator

          public static IntegerValidator integerValidator()

    - #### dateValidator

          public static LocalDateValidator dateValidator()

    - #### validatorConfigValidator

          public static ValidatorConfigValidator validatorConfigValidator()

    - #### validator

          public static Validator validator(KeycloakSession session,
                                            String id)

      Look-up up for a built-in or registered `Validator` with the given validatorId.
      Parameters:
        `session` - the `KeycloakSession`
        `id` - the id of the validator
      Returns:
        the `Validator` or null

    - #### validatorFactory

          public static ValidatorFactory validatorFactory(KeycloakSession session,
                                                          String id)

      Look-up for a built-in or registered `ValidatorFactory` with the given validatorId.

      This is intended for users who want to dynamically create new `Validator` instances, validate `ValidatorConfig` configurations or create default configurations for a `Validator`.

      Parameters:
        `session` - the `KeycloakSession`
        `id` - the id of the validator
      Returns:
        the `Validator` or null

    - #### validateConfig

          public static ValidationResult validateConfig(KeycloakSession session,
                                                        String id,
                                                        ValidatorConfig config)

      Validates the `ValidatorConfig` of `Validator` referenced by the given provider `id`.
      Parameters:
        `session` -
        `id` - of the validator
        `config` - to be validated
      Returns:

Copyright © 2021 JBoss by Red Hat. All rights reserved.