Package com.uc4.api
Class FormItemText
- java.lang.Object
-
- com.uc4.api.AbstractFormItem
-
- com.uc4.api.FormItemText
-
- All Implemented Interfaces:
IFormItem
public class FormItemText extends AbstractFormItem
This class is used for text input fields and date fields.
-
-
Constructor Summary
Constructors Constructor Description FormItemText(org.w3c.dom.Element textElement)Constructs a newFormItemTextusing the specified XML element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetInputCheck()Returns aStringcontaining the term that determines how the user input should be checked.intgetMaxLength()Returns the maximum number of allowed characters.java.lang.StringgetValue()Returns the current value.booleanisDate()Returnstrueif this input field is a date field.booleanisPassword()Returnstrueif this input field is a password field.booleanisText()Returnstrueif this form item is a text input field.booleanisValid()Tests if the current value a valid input for this field.booleanisValid(java.lang.String test)Tests if the parametertestis a valid input.voidsetValue(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, isNumber, isRequired, isUppercase
-
-
-
-
Method Detail
-
isText
public boolean isText()
Description copied from interface:IFormItemReturnstrueif this form item is a text input field. A cast toFormItemTextcan be done if this method returnstrue.- Specified by:
isTextin interfaceIFormItem- Overrides:
isTextin classAbstractFormItem- Returns:
- Boolean indicating if this item is a text input field
-
isPassword
public boolean isPassword()
Returnstrueif this input field is a password field. The entered value is not visible in the report if this input field is a password field- Returns:
- Boolean which is set to true
-
isDate
public boolean isDate()
Returnstrueif this input field is a date field.- Returns:
- Boolean indicating whether this field is a date
-
getInputCheck
public java.lang.String getInputCheck()
Returns aStringcontaining the term that determines how the user input should be checked.- Returns:
- Input Check
-
getMaxLength
public int getMaxLength()
Returns the maximum number of allowed characters.- Returns:
- max length for value
-
isValid
public boolean isValid(java.lang.String test)
Tests if the parametertestis a valid input.- Parameters:
test- Value which should be tested- Returns:
- True if test is a valid
-
setValue
public void setValue(java.lang.String value)
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
public java.lang.String 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.
-
-