Class DataForm.Builder
- java.lang.Object
-
- org.jivesoftware.smackx.xdata.packet.DataForm.Builder
-
- Enclosing class:
- DataForm
public static final class DataForm.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataForm.Builder
addExtensionElement(Element element)
DataForm.Builder
addField(FormField field)
Adds a new field as part of the form.DataForm.Builder
addFields(Collection<? extends FormField> fieldsToAdd)
Add the given fields to this form.DataForm.Builder
addInstruction(String instruction)
Adds a new instruction to the list of instructions that explain how to fill out the form and what the form is about.DataForm.Builder
addItem(DataForm.Item item)
Adds a new item returned from a search.DataForm
build()
DataForm.Builder
removeField(String fieldName)
DataForm.Builder
setFormType(String formType)
DataForm.Builder
setInstructions(String instructions)
DataForm.Builder
setInstructions(List<String> instructions)
Sets the list of instructions that explain how to fill out the form and what the form is about.DataForm.Builder
setReportedData(DataForm.ReportedData reportedData)
Sets the fields that will be returned from a search.DataForm.Builder
setTitle(String title)
Sets the description of the data.DataForm.Builder
setType(DataForm.Type type)
-
-
-
Method Detail
-
setType
public DataForm.Builder setType(DataForm.Type type)
-
setTitle
public DataForm.Builder setTitle(String title)
Sets the description of the data. It is similar to the title on a web page or an X window. You can put a <title/> on either a form to fill out, or a set of data results.- Parameters:
title
- description of the data.- Returns:
- a reference to this builder.
-
addField
public DataForm.Builder addField(FormField field)
Adds a new field as part of the form.- Parameters:
field
- the field to add to the form.- Returns:
- a reference to this builder.
-
addFields
public DataForm.Builder addFields(Collection<? extends FormField> fieldsToAdd)
Add the given fields to this form.- Parameters:
fieldsToAdd
- TODO javadoc me please- Returns:
- a reference to this builder.
-
removeField
public DataForm.Builder removeField(String fieldName)
-
setFormType
public DataForm.Builder setFormType(String formType)
-
setInstructions
public DataForm.Builder setInstructions(String instructions)
-
setInstructions
public DataForm.Builder setInstructions(List<String> instructions)
Sets the list of instructions that explain how to fill out the form and what the form is about. The dataform could include multiple instructions since each instruction could not contain newlines characters.- Parameters:
instructions
- list of instructions that explain how to fill out the form.- Returns:
- a reference to this builder.
-
addInstruction
public DataForm.Builder addInstruction(String instruction)
Adds a new instruction to the list of instructions that explain how to fill out the form and what the form is about. The dataform could include multiple instructions since each instruction could not contain newlines characters.- Parameters:
instruction
- the new instruction that explain how to fill out the form.- Returns:
- a reference to this builder.
-
addItem
public DataForm.Builder addItem(DataForm.Item item)
Adds a new item returned from a search.- Parameters:
item
- the item returned from a search.- Returns:
- a reference to this builder.
-
setReportedData
public DataForm.Builder setReportedData(DataForm.ReportedData reportedData)
Sets the fields that will be returned from a search.- Parameters:
reportedData
- the fields that will be returned from a search.- Returns:
- a reference to this builder.
-
addExtensionElement
public DataForm.Builder addExtensionElement(Element element)
-
-