com.holonplatform.vaadin.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.vaadin.components.Input

      `Input.InputFieldPropertyRenderer<T,F extends com.vaadin.data.HasValue<T> & com.vaadin.ui.Component>, Input.InputPropertyRenderer<T>`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin.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
    --- | ---
    `com.vaadin.shared.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 <F extends com.vaadin.data.HasValue<T> & com.vaadin.ui.Component,T> ValidatableInput<T>` | `from(F field)` Create a `ValidatableInput` component type from given `HasValue` component.
    `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.vaadin.components.Input

      `focus, isReadOnly, isRequired, setReadOnly, setRequired`

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

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

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

      `getComponent, getValue`

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

      `isValid, validate`

- - ### Method Detail

    - #### addValidator

          com.vaadin.shared.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.
      Specified by:
        `from` in interface `Input<V>`
      Type Parameters:
        `T` - Value type
      Parameters:
        `input` - The `Input` instance (not null)
      Returns:
        A new `ValidatableInput` component which wraps the given `input`

    - #### from

          static <F extends com.vaadin.data.HasValue<T> & com.vaadin.ui.Component,T> ValidatableInput<T> from(F field)

      Create a `ValidatableInput` component type from given `HasValue` component.
      Specified by:
        `from` in interface `Input<V>`
      Type Parameters:
        `T` - Value type
        `F` - `HasValue` component type
      Parameters:
        `field` - The field instance (not null)
      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 © 2017 The Holon Platform. All rights reserved.