Package com.uc4.api
Class FormItemNumber
java.lang.Object
com.uc4.api.AbstractFormItem
com.uc4.api.FormItemNumber
- All Implemented Interfaces:
IFormItem
This class is used for fields which can only contain numbers.
-
Constructor Summary
ConstructorsConstructorDescriptionFormItemNumber
(Element numberElement) Constructs a newFormItemNumber
using the specified XML element. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the maximum value which is allowed as input.int
Returns the maximum number of allowed digits.long
Returns the minimum value which is allowed as input.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
Sets a new value for this field.Methods inherited from class com.uc4.api.AbstractFormItem
getId, getLabel, isFixed, isLabel, isList, isNewLine, isRequired, isText, isUppercase
-
Constructor Details
-
FormItemNumber
Constructs a newFormItemNumber
using the specified XML element.- Parameters:
numberElement
- XML element
-
-
Method Details
-
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
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
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.
-