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 Summary

      Constructors 
      Constructor Description
      FormItemNumber​(org.w3c.dom.Element numberElement)
      Constructs a new FormItemNumber using the specified XML element.
    • Constructor Detail

      • FormItemNumber

        public FormItemNumber​(org.w3c.dom.Element numberElement)
        Constructs a new FormItemNumber using the specified XML element.
        Parameters:
        numberElement - XML element
    • Method Detail

      • 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​(java.lang.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 java.lang.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.