Package com.uc4.api

Class FormItemNumber

All Implemented Interfaces:
IFormItem

public class FormItemNumber extends AbstractFormItem
This class is used for fields which can only contain numbers.
  • Constructor Details

    • FormItemNumber

      public FormItemNumber(Element numberElement)
      Constructs a new FormItemNumber using the specified XML element.
      Parameters:
      numberElement - XML element
  • Method Details

    • isNumber

      public boolean isNumber()
      Description copied from interface: IFormItem
      Returns true if this form item is a number field. A cast to FormItemNumber can be done if this method returns true.
      Specified by:
      isNumber in interface IFormItem
      Overrides:
      isNumber in class AbstractFormItem
      Returns:
      Boolean indicating if this item is a number field
    • getMaximum

      public long getMaximum()
      Returns the maximum value which is allowed as input.
      Returns:
      Maximum value
    • getMinimum

      public long getMinimum()
      Returns the minimum value which is allowed as input.
      Returns:
      Minimum value
    • getMaxLength

      public int getMaxLength()
      Returns the maximum number of allowed digits.
      Returns:
      max length for value
    • setValue

      public void setValue(String value)
      Description copied from interface: IFormItem
      Sets a new value for this field. This method can throw an exception if the input is not valid.
      Parameters:
      value - New value
    • getValue

      public String getValue()
      Description copied from interface: IFormItem
      Returns the current value. If a default value is set this method can be used to read the default value.
      Returns:
      Value of this field
    • isValid

      public boolean isValid()
      Description copied from interface: IFormItem
      Tests if the current value a valid input for this field.
      Specified by:
      isValid in interface IFormItem
      Overrides:
      isValid in class AbstractFormItem
      Returns:
      Boolean indicating if this IFormItem is valid.