|
Openfire 3.5.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmpp.packet.PacketExtension org.xmpp.forms.DataForm
public class DataForm
Represents a form that could be use for gathering data as well as for reporting data returned from a search.
The form could be of the following types:addReportedField(String,String,FormField.Type)
to set the columns of the report whilst
the report's rows can be configured using addItemFields(Map)
.
Nested Class Summary | |
---|---|
static class |
DataForm.Type
Type-safe enumeration to represent the type of the Data forms. |
Field Summary | |
---|---|
static String |
ELEMENT_NAME
Element name of the packet extension. |
static String |
NAMESPACE
Namespace of the packet extension. |
Fields inherited from class org.xmpp.packet.PacketExtension |
---|
docFactory, element, registeredExtensions |
Constructor Summary | |
---|---|
DataForm(DataForm.Type type)
|
|
DataForm(org.dom4j.Element element)
|
Method Summary | |
---|---|
FormField |
addField()
Adds a new field as part of the form. |
void |
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. |
void |
addItemFields(Map<String,Object> fields)
Adds a new row of items of reported data. |
void |
addReportedField(String variable,
String label,
FormField.Type type)
Adds a field to the list of fields that will be returned from a search. |
void |
clearInstructions()
Clears all the stored instructions in this packet extension. |
DataForm |
createCopy()
Creates a deep copy of this packet extension. |
FormField |
getField(String variable)
Returns the field whose variable matches the specified variable. |
List<FormField> |
getFields()
Returns the fields that are part of the form. |
List<String> |
getInstructions()
Returns an unmodifiable list of instructions that explain how to fill out the form and what the form is about. |
String |
getTitle()
Returns the description of the data form. |
DataForm.Type |
getType()
Returns the type of this data form. |
static boolean |
parseBoolean(String booleanString)
|
static Date |
parseDate(String date)
Returns the Date obtained by parsing the specified date representation. |
boolean |
removeField(String variable)
Removes the field whose variable matches the specified variable. |
void |
setTitle(String title)
Sets the description of the data. |
Methods inherited from class org.xmpp.packet.PacketExtension |
---|
getElement, getExtensionClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ELEMENT_NAME
public static final String NAMESPACE
Constructor Detail |
---|
public DataForm(DataForm.Type type)
public DataForm(org.dom4j.Element element)
Method Detail |
---|
public static Date parseDate(String date) throws ParseException
date
- date representation in the UTC GMT+0 format.
ParseException
- if an error occurs while parsing the date representation.public static boolean parseBoolean(String booleanString) throws ParseException
ParseException
public DataForm.Type getType()
DataForm.Type
public void setTitle(String title)
title
- description of the data.public String getTitle()
public List<String> getInstructions()
public void addInstruction(String instruction)
instruction
- the new instruction that explain how to fill out the form.public void clearInstructions()
public FormField addField()
public List<FormField> getFields()
public FormField getField(String variable)
variable
- the variable name of the field to search.
public boolean removeField(String variable)
variable
- the variable name of the field to remove.
public void addReportedField(String variable, String label, FormField.Type type)
variable
- variable name of the new column. This value will be used in
addItemFields(java.util.Map)
when adding reported items.label
- label that corresponds to the new column. Optional parameter.type
- indicates the type of field of the new column. Optional parameter.public void addItemFields(Map<String,Object> fields)
Collection
. Since the value is of type Object
it
is possible to include any type of object as a value. The actual value to include in the
data form is the result of the encode(Object)
method.
fields
- list of public DataForm createCopy()
PacketExtension
createCopy
in class PacketExtension
|
Openfire 3.5.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |