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 and Description
    --- | ---
    `static String` | `ID`
    `static NotBlankValidator` | `INSTANCE`
    `static String` | `MESSAGE_BLANK`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NotBlankValidator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getId()`
    `ValidationContext` | `validate(Object input, String inputHint, ValidationContext context, ValidatorConfig config)` Validates the given `input` with an additional `inputHint` and `config`.
    `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.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`

    - ### Methods inherited from interface org.keycloak.provider.ProviderFactory

      `order`

- - ### 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

  - ### Constructor Detail

    - #### NotBlankValidator

          public NotBlankValidator()

  - ### Method Detail

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `ProviderFactory<Validator>`

    - #### validate

          public ValidationContext validate(Object input,
                                            String inputHint,
                                            ValidationContext context,
                                            ValidatorConfig config)

      Description copied from interface: `Validator`
      Validates the given `input` with an additional `inputHint` and `config`.
      Specified by:
        `validate` in interface `Validator`
      Parameters:
        `input` - the value to validate
        `inputHint` - an optional input hint to guide the validation
        `context` - the validation context
        `config` - parameterization for the current validation
      Returns:
        the validation context with the outcome of the validation

    - #### validateStringValue

          protected boolean validateStringValue(String value,
                                                String inputHint,
                                                ValidationContext context,
                                                ValidatorConfig config)

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