public class FormField
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FormField.Option
Represents the available option of a given FormField.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TYPE_BOOLEAN |
static java.lang.String |
TYPE_FIXED |
static java.lang.String |
TYPE_HIDDEN |
static java.lang.String |
TYPE_JID_MULTI |
static java.lang.String |
TYPE_JID_SINGLE |
static java.lang.String |
TYPE_LIST_MULTI |
static java.lang.String |
TYPE_LIST_SINGLE |
static java.lang.String |
TYPE_TEXT_MULTI |
static java.lang.String |
TYPE_TEXT_PRIVATE |
static java.lang.String |
TYPE_TEXT_SINGLE |
Constructor and Description |
---|
FormField()
Creates a new FormField of type FIXED.
|
FormField(java.lang.String variable)
Creates a new FormField with the variable name that uniquely identifies the field
in the context of the form.
|
Modifier and Type | Method and Description |
---|---|
void |
addOption(FormField.Option option)
Adss an available options to the question that the user has in order to answer
the question.
|
void |
addValue(java.lang.String value)
Adds a default value to the question if the question is part of a form to fill out.
|
void |
addValues(java.util.List newValues)
Adds a default values to the question if the question is part of a form to fill out.
|
java.lang.String |
getDescription()
Returns a description that provides extra clarification about the question.
|
java.lang.String |
getLabel()
Returns the label of the question which should give enough information to the user to
fill out the form.
|
java.util.Iterator |
getOptions()
Returns an Iterator for the available options that the user has in order to answer
the question.
|
java.lang.String |
getType()
Returns an indicative of the format for the data to answer.
|
java.util.Iterator |
getValues()
Returns an Iterator for the default values of the question if the question is part
of a form to fill out.
|
java.lang.String |
getVariable()
Returns the variable name that the question is filling out.
|
boolean |
isRequired()
Returns true if the question must be answered in order to complete the questionnaire.
|
protected void |
resetValues()
Removes all the values of the field.
|
void |
setDescription(java.lang.String description)
Sets a description that provides extra clarification about the question.
|
void |
setLabel(java.lang.String label)
Sets the label of the question which should give enough information to the user to
fill out the form.
|
void |
setRequired(boolean required)
Sets if the question must be answered in order to complete the questionnaire.
|
void |
setType(java.lang.String type)
Sets an indicative of the format for the data to answer.
|
java.lang.String |
toXML() |
public static final java.lang.String TYPE_BOOLEAN
public static final java.lang.String TYPE_FIXED
public static final java.lang.String TYPE_HIDDEN
public static final java.lang.String TYPE_JID_MULTI
public static final java.lang.String TYPE_JID_SINGLE
public static final java.lang.String TYPE_LIST_MULTI
public static final java.lang.String TYPE_LIST_SINGLE
public static final java.lang.String TYPE_TEXT_MULTI
public static final java.lang.String TYPE_TEXT_PRIVATE
public static final java.lang.String TYPE_TEXT_SINGLE
public FormField(java.lang.String variable)
variable
- the variable name of the question.public FormField()
public java.lang.String getDescription()
If the question is of type FIXED then the description should remain empty.
public java.lang.String getLabel()
public java.util.Iterator getOptions()
public boolean isRequired()
public java.lang.String getType()
public java.util.Iterator getValues()
public java.lang.String getVariable()
public void setDescription(java.lang.String description)
If the question is of type FIXED then the description should remain empty.
description
- provides extra clarification about the question.public void setLabel(java.lang.String label)
label
- the label of the question.public void setRequired(boolean required)
required
- if the question must be answered in order to complete the questionnaire.public void setType(java.lang.String type)
type
- an indicative of the format for the data to answer.public void addValue(java.lang.String value)
value
- a default value or an answered value of the question.public void addValues(java.util.List newValues)
newValues
- default values or an answered values of the question.protected void resetValues()
public void addOption(FormField.Option option)
option
- a new available option for the question.public java.lang.String toXML()
Copyright © 2003 Jive Software.