Interface FormField<T>

Type Parameters:
T - Type of value, see get(), getType(), and validate(Object).

public interface FormField<T>
Language specific property container of a form's field.
Since:
4.2.404
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Provides the current value of the field.
    Returns the name of the field.
    Get the type of the field's value.
    boolean
    Indicates that the field represents a default value.
    boolean
    Indicates that the value of this field is empty.
    boolean
    Indicates that the value of this field is set.
    void
    set(Object value)
    Set the value of this field.
    void
    Set the field to its default value.
    void
    validate(T value)
    Validate the given value.
  • Method Details

    • getName

      String getName()
      Returns the name of the field.
      Returns:
      The field's name.
      Since:
      4.2.404
    • getType

      Class<T> getType()
      Get the type of the field's value.
      Returns:
      The field's type.
      Since:
      4.2.404
    • isSet

      boolean isSet()
      Indicates that the value of this field is set.
      Returns:
      true, iff field is set.
      Since:
      4.2.404
    • isEmpty

      boolean isEmpty()
      Indicates that the value of this field is empty.
      Returns:
      true, iff field evaluates to empty.
      Since:
      4.2.404
    • isDefault

      boolean isDefault()
      Indicates that the field represents a default value.
      Returns:
      true, iff field represents a default.
      Since:
      4.2.404
    • get

      @Nullable T get()
      Provides the current value of the field.
      Returns:
      The field's value.
      Since:
      4.2.404
    • set

      Set the value of this field. Appropriate values are those understood by the underlying gadget component not necessarily restricted to the defined value type. For a specific gagdet, see the assimilation note of the corresponding interface's documentation giving the list of supported types.
      Parameters:
      value - The value to be set.
      Throws:
      InappropriateValueException - If the given value is not appropriate for this field.
      UnsupportedOperationException - If the field does not support setting its value.
      Since:
      4.2.404
      See Also:
    • setToDefault

      void setToDefault() throws UnsupportedOperationException
      Set the field to its default value.
      Throws:
      UnsupportedOperationException - If the field does not support setting its value.
      Since:
      4.2.404
    • validate

      void validate(T value) throws InappropriateValueException
      Validate the given value.
      Parameters:
      value - The value to validate.
      Throws:
      InappropriateValueException - If the value is not valid.
      Since:
      4.2.404