public class DataForm extends java.lang.Object implements 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.
|
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()
Returns the root element name.
|
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()
Returns the root element XML namespace.
|
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.
|
java.lang.String |
toXML()
Returns the XML representation of the PacketExtension.
|
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()
PacketExtension
getElementName
in interface PacketExtension
public java.lang.String getNamespace()
PacketExtension
getNamespace
in interface 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 java.lang.String toXML()
PacketExtension
toXML
in interface PacketExtension