Package org.jivesoftware.smackx.xdata
Class FormField.Builder<F extends FormField,B extends FormField.Builder<?,?>>
- java.lang.Object
-
- org.jivesoftware.smackx.xdata.FormField.Builder<F,B>
-
- Direct Known Subclasses:
AbstractMultiFormField.Builder
,AbstractSingleStringValueFormField.Builder
,BooleanFormField.Builder
,JidMultiFormField.Builder
,JidSingleFormField.Builder
- Enclosing class:
- FormField
public abstract static class FormField.Builder<F extends FormField,B extends FormField.Builder<?,?>> extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder(String fieldName, FormField.Type type)
protected
Builder(FormField formField)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description B
addFormFieldChildElement(FormFieldChildElement newFormFieldChildElement)
B
addFormFieldChildElements(Collection<? extends FormFieldChildElement> formFieldChildElements)
abstract F
build()
abstract B
getThis()
FormField.Type
getType()
B
reset()
protected abstract void
resetInternal()
B
setDescription(String description)
Sets a description that provides extra clarification about the question.B
setLabel(String label)
Sets the label of the question which should give enough information to the user to fill out the form.B
setRequired()
Sets if the question must be answered in order to complete the questionnaire.B
setRequired(boolean required)
Sets if the question must be answered in order to complete the questionnaire.
-
-
-
Constructor Detail
-
Builder
protected Builder(String fieldName, FormField.Type type)
-
-
Method Detail
-
setDescription
public B setDescription(String description)
Sets a description that provides extra clarification about the question. This information could be presented to the user either in tool-tip, help button, or as a section of text before the question.If the question is of type FIXED then the description should remain empty.
- Parameters:
description
- provides extra clarification about the question.- Returns:
- a reference to this builder.
-
setLabel
public B setLabel(String label)
Sets the label of the question which should give enough information to the user to fill out the form.- Parameters:
label
- the label of the question.- Returns:
- a reference to this builder.
-
setRequired
public B setRequired()
Sets if the question must be answered in order to complete the questionnaire.- Returns:
- a reference to this builder.
-
setRequired
public B setRequired(boolean required)
Sets if the question must be answered in order to complete the questionnaire.- Parameters:
required
- if the question must be answered in order to complete the questionnaire.- Returns:
- a reference to this builder.
-
addFormFieldChildElements
public B addFormFieldChildElements(Collection<? extends FormFieldChildElement> formFieldChildElements)
-
addFormFieldChildElement
public B addFormFieldChildElement(FormFieldChildElement newFormFieldChildElement)
-
resetInternal
protected abstract void resetInternal()
-
getType
public FormField.Type getType()
-
-