Package com.uc4.api
Class FormItemNumber
- java.lang.Object
-
- com.uc4.api.AbstractFormItem
-
- com.uc4.api.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 newFormItemNumber
using the specified XML element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getMaximum()
Returns the maximum value which is allowed as input.int
getMaxLength()
Returns the maximum number of allowed digits.long
getMinimum()
Returns the minimum value which is allowed as input.java.lang.String
getValue()
Returns the current value.boolean
isNumber()
Returnstrue
if this form item is a number field.boolean
isValid()
Tests if the current value a valid input for this field.void
setValue(java.lang.String value)
Sets a new value for this field.-
Methods inherited from class com.uc4.api.AbstractFormItem
getId, getLabel, isFixed, isLabel, isList, isNewLine, isRequired, isText, isUppercase
-
-
-
-
Method Detail
-
isNumber
public boolean isNumber()
Description copied from interface:IFormItem
Returnstrue
if this form item is a number field. A cast toFormItemNumber
can be done if this method returnstrue
.- Specified by:
isNumber
in interfaceIFormItem
- Overrides:
isNumber
in classAbstractFormItem
- 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 interfaceIFormItem
- Overrides:
isValid
in classAbstractFormItem
- Returns:
- Boolean indicating if this
IFormItem
is valid.
-
-