com.holonplatform.vaadin7.components

## Interface ValidatableInput<V>

- Type Parameters:
    `V` - Value type
  All Superinterfaces:
    Input<V>, Serializable, Validatable, ValueComponent<V>, ValueHolder<V>

      public interface ValidatableInput<V>
      extends Input<V>, Validatable

  An `Input` component with validation support using `Validator`s.
  Since:
    5.0.0

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin7.components.Input

      `Input.InputFieldPropertyRenderer<T>, Input.InputPropertyRenderer<T>`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin7.components.ValueHolder

      `ValueHolder.ValueChangeEvent<V>, ValueHolder.ValueChangeListener<V>`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `Registration` | `addValidator(com.holonplatform.core.Validator<V> validator)` Adds a `Validator` to validate the input value.
    `static <T> ValidatableInputBuilder<T,ValidatableInput<T>>` | `builder(Input<T> input)` Get a fluent builder to create and setup a `ValidatableInput` from given `Input`.
    `static <T> ValidatableInput<T>` | `from(com.vaadin.ui.Field<T> field)` Create a `ValidatableInput` component type from given `Field` instance.
    `static <T> ValidatableInput<T>` | `from(com.vaadin.ui.Field<T> field, boolean inheritValidators)` Create a `ValidatableInput` component type from given `Field` instance.
    `static <T> ValidatableInput<T>` | `from(Input<T> input)` Create a `ValidatableInput` from given `Input` instance.
    `Optional<ValidationStatusHandler>` | `getValidationStatusHandler()` Get the `ValidationStatusHandler` to use to track validation status changes, if available.
    `boolean` | `isValidateOnValueChange()` Gets whether to validate the value, using registered `Validator`s, every time the `Input` value changes.
    `void` | `setValidateOnValueChange(boolean validateOnValueChange)` Sets whether to validate the value, using registered `Validator`s, every time the `Input` value changes.
    `void` | `setValidationStatusHandler(ValidationStatusHandler validationStatusHandler)` Set the `ValidationStatusHandler` to use to track validation status changes.

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.Input

      `focus, isReadOnly, isRequired, setReadOnly, setRequired`

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.ValueHolder

      `addValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, setValue`

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.ValueComponent

      `getComponent, getValue`

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.Validatable

      `isValid, validate`

- - ### Method Detail

    - #### addValidator

          Registration addValidator(com.holonplatform.core.Validator<V> validator)

      Adds a `Validator` to validate the input value.
      Parameters:
        `validator` - The validator to add (not null)
      Returns:
        The validator registration reference

    - #### setValidateOnValueChange

          void setValidateOnValueChange(boolean validateOnValueChange)

      Sets whether to validate the value, using registered `Validator`s, every time the `Input` value changes.
      Parameters:
        `validateOnValueChange` - `true` to perform value validation every time the `Input` value changes, `false` if not

    - #### isValidateOnValueChange

          boolean isValidateOnValueChange()

      Gets whether to validate the value, using registered `Validator`s, every time the `Input` value changes.

      Default is `true`.

      Returns:
        `true` if the value validation must be performed every time the `Input` value changes

    - #### setValidationStatusHandler

          void setValidationStatusHandler(ValidationStatusHandler validationStatusHandler)

      Set the `ValidationStatusHandler` to use to track validation status changes.
      Parameters:
        `validationStatusHandler` - the `ValidationStatusHandler` to set

    - #### getValidationStatusHandler

          Optional<ValidationStatusHandler> getValidationStatusHandler()

      Get the `ValidationStatusHandler` to use to track validation status changes, if available.
      Returns:
        the optional `ValidationStatusHandler`

    - #### from

          static <T> ValidatableInput<T> from(Input<T> input)

      Create a `ValidatableInput` from given `Input` instance.
      Type Parameters:
        `T` - Value type
      Parameters:
        `input` - The `Input` instance (not null)
      Returns:
        A new `ValidatableInput` component which wraps the given `input`

    - #### from

          static <T> ValidatableInput<T> from(com.vaadin.ui.Field<T> field)

      Create a `ValidatableInput` component type from given `Field` instance.

      Any `Field` validator will be inherited from the returned `ValidatableInput` instance.

      Specified by:
        `from` in interface `Input<V>`
      Type Parameters:
        `T` - Value type
      Parameters:
        `field` - The field instance (not null)
      Returns:
        A new `ValidatableInput` component which wraps the given `field`

    - #### from

          static <T> ValidatableInput<T> from(com.vaadin.ui.Field<T> field,
                                              boolean inheritValidators)

      Create a `ValidatableInput` component type from given `Field` instance.
      Type Parameters:
        `T` - Value type
      Parameters:
        `field` - The field instance (not null)
        `inheritValidators` - Whether to inherit `Field` validators, if any
      Returns:
        A new `ValidatableInput` component which wraps the given `field`

    - #### builder

          static <T> ValidatableInputBuilder<T,ValidatableInput<T>> builder(Input<T> input)

      Get a fluent builder to create and setup a `ValidatableInput` from given `Input`.
      Type Parameters:
        `T` - Value type
      Parameters:
        `input` - Concrete input component (not null)
      Returns:
        `ValidatableInput` builder

Copyright © 2019 The Holon Platform. All rights reserved.