Class DataForm.Builder
java.lang.Object
org.jivesoftware.smackx.xdata.packet.DataForm.Builder
- Enclosing class:
- DataForm
-
Method Summary
Modifier and TypeMethodDescriptionaddExtensionElement
(Element element) Adds a new field as part of the form.addFields
(Collection<? extends FormField> fieldsToAdd) Add the given fields to this form.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.addItem
(DataForm.Item item) Adds a new item returned from a search.build()
removeField
(String fieldName) setFormType
(String formType) setInstructions
(String instructions) setInstructions
(List<String> instructions) Sets the list of instructions that explain how to fill out the form and what the form is about.setReportedData
(DataForm.ReportedData reportedData) Sets the fields that will be returned from a search.Sets the description of the data.
-
Method Details
-
setTitle
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
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
Add the given fields to this form.- Parameters:
fieldsToAdd
- TODO javadoc me please- Returns:
- a reference to this builder.
-
removeField
-
setFormType
-
setInstructions
-
setInstructions
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
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
Adds a new item returned from a search.- Parameters:
item
- the item returned from a search.- Returns:
- a reference to this builder.
-
setReportedData
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
-
build
-