Class Field<Type>

java.lang.Object
pt.tecnico.uilib.forms.Field<Type>
Type Parameters:
Type - is the type of the data to be read in the field.
Direct Known Subclasses:
FieldNone

public abstract class Field<Type> extends Object
This class represents an input field in a form.
  • Field Details

    • _value

      protected Type _value
      value to be read
  • Constructor Details

    • Field

      protected Field()
      Build an Input without a title
    • Field

      protected Field(String prompt)
      Parameters:
      prompt - the prompt for the requested value
      regex - the regular expression to be matched
  • Method Details

    • prompt

      public String prompt()
      Returns:
      the description of the request
    • set

      public void set(Type value)
      Parameters:
      value - the new value
    • value

      public Type value()
      Returns:
      the value
    • clear

      public void clear()
      Mark the Input as unread
    • dirty

      protected void dirty()
      Mark the Input as read
    • cleared

      public boolean cleared()
      Returns:
      true if the Input is cleared
    • isReadOnly

      public boolean isReadOnly()
      Is the input field read-only.
    • parse

      public abstract boolean parse(String in)
      Each Input must parse its own specific type of value, written in accordance with the specific regular expression.
      Parameters:
      in - the string to be parsed
      Returns:
      the status of parsing success
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: