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 newFormItemNumberusing the specified XML element. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the maximum value which is allowed as input.intReturns the maximum number of allowed digits.longReturns the minimum value which is allowed as input.getValue()Returns the current value.booleanisNumber()Returnstrueif this form item is a number field.booleanisValid()Tests if the current value a valid input for this field.voidSets 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 newFormItemNumberusing the specified XML element.- Parameters:
numberElement- XML element
-
-
Method Details
-
isNumber
public boolean isNumber()Description copied from interface:IFormItemReturnstrueif this form item is a number field. A cast toFormItemNumbercan be done if this method returnstrue.- Specified by:
isNumberin interfaceIFormItem- Overrides:
isNumberin 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:IFormItemSets 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:IFormItemReturns 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:IFormItemTests if the current value a valid input for this field.- Specified by:
isValidin interfaceIFormItem- Overrides:
isValidin classAbstractFormItem- Returns:
- Boolean indicating if this
IFormItemis valid.
-