public class DataForm
extends java.lang.Object
implements org.jivesoftware.smack.packet.PacketExtension
Modifier and Type | Class and Description |
---|---|
static class |
DataForm.Item
Represents items of reported data.
|
static class |
DataForm.ReportedData
Represents the fields that will be returned from a search.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ELEMENT |
static java.lang.String |
NAMESPACE |
Constructor and Description |
---|
DataForm(java.lang.String type) |
Modifier and Type | Method and Description |
---|---|
void |
addField(FormField field)
Adds a new field as part of the form.
|
void |
addInstruction(java.lang.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.
|
void |
addItem(DataForm.Item item)
Adds a new item returned from a search.
|
java.lang.String |
getElementName() |
java.util.List<FormField> |
getFields()
Returns a List of the fields that are part of the form.
|
java.util.List<java.lang.String> |
getInstructions()
Returns a List of the list of instructions that explain how to fill out the form and
what the form is about.
|
java.util.List<DataForm.Item> |
getItems()
Returns a List of the items returned from a search.
|
java.lang.String |
getNamespace() |
DataForm.ReportedData |
getReportedData()
Returns the fields that will be returned from a search.
|
java.lang.String |
getTitle()
Returns the description of the data.
|
java.lang.String |
getType()
Returns the meaning of the data within the context.
|
boolean |
hasHiddenFormTypeField()
Returns true if this DataForm has at least one FORM_TYPE field which is
hidden.
|
void |
setInstructions(java.util.List<java.lang.String> instructions)
Sets the list of instructions that explain how to fill out the form and what the form is
about.
|
void |
setReportedData(DataForm.ReportedData reportedData)
Sets the fields that will be returned from a search.
|
void |
setTitle(java.lang.String title)
Sets the description of the data.
|
org.jivesoftware.smack.util.XmlStringBuilder |
toXML() |
public static final java.lang.String NAMESPACE
public static final java.lang.String ELEMENT
public java.lang.String getType()
Possible form types are:
public java.lang.String getTitle()
public java.util.List<java.lang.String> getInstructions()
public DataForm.ReportedData getReportedData()
public java.util.List<DataForm.Item> getItems()
public java.util.List<FormField> getFields()
public java.lang.String getElementName()
getElementName
in interface org.jivesoftware.smack.packet.PacketExtension
public java.lang.String getNamespace()
getNamespace
in interface org.jivesoftware.smack.packet.PacketExtension
public void setTitle(java.lang.String title)
title
- description of the data.public void setInstructions(java.util.List<java.lang.String> instructions)
instructions
- list of instructions that explain how to fill out the form.public void setReportedData(DataForm.ReportedData reportedData)
reportedData
- the fields that will be returned from a search.public void addField(FormField field)
field
- the field to add to the form.public void addInstruction(java.lang.String instruction)
instruction
- the new instruction that explain how to fill out the form.public void addItem(DataForm.Item item)
item
- the item returned from a search.public boolean hasHiddenFormTypeField()
public org.jivesoftware.smack.util.XmlStringBuilder toXML()
toXML
in interface org.jivesoftware.smack.packet.PacketExtension