com.holonplatform.vaadin.flow.components

## Interface Validatable

- All Known Subinterfaces:
    PropertyInputForm, PropertyInputGroup, ValidatableInput<T>, ValidatableMultiSelect<T>, ValidatableSingleSelect<T>

      public interface Validatable

  Interface to provide value validation support for a component, using the current component value as the value to validate.
  Since:
    5.0.0

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> com.holonplatform.core.Validator<T>` | `adapt(com.vaadin.flow.data.binder.Validator<T> validator)` Adapt given `Validator` to be used as a `Validator`.
    `static <T> com.vaadin.flow.data.binder.Validator<T>` | `adapt(com.holonplatform.core.Validator<T> validator)` Adapt given `Validator` to be used as a `Validator`.
    `static <T> com.holonplatform.core.Validator<T>` | `adapt(com.vaadin.flow.data.binder.Validator<T> validator, com.vaadin.flow.component.Component component)` Adapt given `Validator` to be used as a `Validator`.
    `static <T> com.holonplatform.core.Validator<T>` | `adapt(com.vaadin.flow.data.binder.Validator<T> validator, Input<T> input)` Adapt given `Validator` to be used as a `Validator`.
    `static <T> com.holonplatform.core.Validator<T>` | `adapt(com.vaadin.flow.data.binder.Validator<T> validator, Supplier<com.vaadin.flow.data.binder.ValueContext> contextSupplier)` Adapt given `Validator` to be used as a `Validator`.
    `default boolean` | `isValid()` Check if the current value is valid, swallowing any validation exception.
    `void` | `validate()` Checks the validity of the current component value against every registered validator, if any.

- - ### Method Detail

    - #### validate

          void validate()
                 throws com.holonplatform.core.Validator.ValidationException

      Checks the validity of the current component value against every registered validator, if any. If the value is not valid, an `Validator.ValidationException` is thrown.

      The `Validator.ValidationException` is `Localizable`, providing optional message code and arguments for validation message localization.

      Throws:
        `com.holonplatform.core.Validator.ValidationException` - If the value is not valid

    - #### isValid

          default boolean isValid()

      Check if the current value is valid, swallowing any validation exception.
      Returns:
        `true` if the current value is valid, `false` otherwise
      See Also:
        `validate()`

    - #### adapt

          static <T> com.holonplatform.core.Validator<T> adapt(com.vaadin.flow.data.binder.Validator<T> validator)

      Adapt given `Validator` to be used as a `Validator`.
      Type Parameters:
        `T` - Validator value type
      Parameters:
        `validator` - The validator to adapt (not null)
      Returns:
        Adapted validator

    - #### adapt

          static <T> com.holonplatform.core.Validator<T> adapt(com.vaadin.flow.data.binder.Validator<T> validator,
                                                               Input<T> input)

      Adapt given `Validator` to be used as a `Validator`.
      Type Parameters:
        `T` - Validator value type
      Parameters:
        `validator` - The validator to adapt (not null)
        `input` - The input to validate
      Returns:
        Adapted validator

    - #### adapt

          static <T> com.holonplatform.core.Validator<T> adapt(com.vaadin.flow.data.binder.Validator<T> validator,
                                                               com.vaadin.flow.component.Component component)

      Adapt given `Validator` to be used as a `Validator`.
      Type Parameters:
        `T` - Validator value type
      Parameters:
        `validator` - The validator to adapt (not null)
        `component` - The component to validate
      Returns:
        Adapted validator

    - #### adapt

          static <T> com.holonplatform.core.Validator<T> adapt(com.vaadin.flow.data.binder.Validator<T> validator,
                                                               Supplier<com.vaadin.flow.data.binder.ValueContext> contextSupplier)

      Adapt given `Validator` to be used as a `Validator`.
      Type Parameters:
        `T` - Validator value type
      Parameters:
        `validator` - The validator to adapt (not null)
        `contextSupplier` - Value context supplier (not null)
      Returns:
        Adapted validator

    - #### adapt

          static <T> com.vaadin.flow.data.binder.Validator<T> adapt(com.holonplatform.core.Validator<T> validator)

      Adapt given `Validator` to be used as a `Validator`.
      Type Parameters:
        `T` - Validator value type
      Parameters:
        `validator` - The validator to adapt (not null)
      Returns:
        Adapted validator

Copyright © 2019 The Holon Platform. All rights reserved.