public static final class FormField.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
FormField.Builder |
addFormFieldChildElement(FormFieldChildElement formFieldChildElement) |
FormField.Builder |
addOption(FormField.Option option)
Adds an available options to the question that the user has in order to answer
the question.
|
FormField.Builder |
addOption(java.lang.String option) |
FormField.Builder |
addValue(java.lang.CharSequence value)
Adds a default value to the question if the question is part of a form to fill out.
|
FormField.Builder |
addValue(java.util.Date date)
Adds the given Date as XEP-0082 formated string by invoking
addValue(CharSequence) after the date
instance was formated. |
FormField.Builder |
addValues(java.util.Collection<? extends java.lang.CharSequence> values)
Adds a default values to the question if the question is part of a form to fill out.
|
FormField |
build() |
FormField.Type |
getType() |
FormField.Builder |
resetValues() |
FormField.Builder |
setDescription(java.lang.String description)
Sets a description that provides extra clarification about the question.
|
FormField.Builder |
setFieldName(java.lang.String fieldName) |
FormField.Builder |
setLabel(java.lang.String label)
Sets the label of the question which should give enough information to the user to
fill out the form.
|
FormField.Builder |
setRequired(boolean required)
Sets if the question must be answered in order to complete the questionnaire.
|
FormField.Builder |
setType(FormField.Type type)
Sets an indicative of the format for the data to answer.
|
FormField.Builder |
setVariable(java.lang.String variable) |
public FormField.Builder setFieldName(java.lang.String fieldName)
public FormField.Builder setVariable(java.lang.String variable)
public FormField.Builder setType(FormField.Type type)
type
- an indicative of the format for the data to answer.FormField.Type
public FormField.Builder 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 FormField.Builder setLabel(java.lang.String label)
label
- the label of the question.public FormField.Builder setRequired(boolean required)
required
- if the question must be answered in order to complete the questionnaire.public FormField.Builder addValue(java.lang.CharSequence value)
value
- a default value or an answered value of the question.public FormField.Builder addValue(java.util.Date date)
addValue(CharSequence)
after the date
instance was formated.date
- the date instance to add as XEP-0082 formated string.public FormField.Builder addValues(java.util.Collection<? extends java.lang.CharSequence> values)
values
- default values or an answered values of the question.public FormField.Builder addOption(java.lang.String option)
public FormField.Builder addOption(FormField.Option option)
option
- a new available option for the question.public FormField.Builder addFormFieldChildElement(FormFieldChildElement formFieldChildElement)
public FormField.Builder resetValues()
public FormField build()
public FormField.Type getType()