Smack

org.jivesoftware.smackx.packet
Class DataForm

java.lang.Object
  extended by org.jivesoftware.smackx.packet.DataForm
All Implemented Interfaces:
PacketExtension

public class DataForm
extends Object
implements PacketExtension

Represents a form that could be use for gathering data as well as for reporting data returned from a search.

Author:
Gaston Dombiak

Nested Class Summary
static class DataForm.Item
          Represents items of reported data.
static class DataForm.ReportedData
          Represents the fields that will be returned from a search.
 
Constructor Summary
DataForm(String type)
           
 
Method Summary
 void addField(FormField field)
          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 addItem(DataForm.Item item)
          Adds a new item returned from a search.
 String getElementName()
          Returns the root element name.
 Iterator<FormField> getFields()
          Returns an Iterator for the fields that are part of the form.
 Iterator<String> getInstructions()
          Returns an Iterator for the list of instructions that explain how to fill out the form and what the form is about.
 Iterator<DataForm.Item> getItems()
          Returns an Iterator for the items returned from a search.
 String getNamespace()
          Returns the root element XML namespace.
 DataForm.ReportedData getReportedData()
          Returns the fields that will be returned from a search.
 String getTitle()
          Returns the description of the data.
 String getType()
          Returns the meaning of the data within the context.
 void setInstructions(List<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(String title)
          Sets the description of the data.
 String toXML()
          Returns the XML reppresentation of the PacketExtension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataForm

public DataForm(String type)
Method Detail

getType

public String getType()
Returns the meaning of the data within the context. The data could be part of a form to fill out, a form submission or data results.

Possible form types are:

Returns:
the form's type.

getTitle

public String getTitle()
Returns the description of the data. It is similar to the title on a web page or an X window. You can put a on either a form to fill out, or a set of data results. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>description of the data.</DL> </DD> </DL> <HR> <A NAME="getInstructions()"><!-- --></A><H3> getInstructions</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A><<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>> <B>getInstructions</B>()</PRE> <DL> <DD>Returns an Iterator for 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. Join the instructions together in order to show them to the user. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>an Iterator for the list of instructions that explain how to fill out the form.</DL> </DD> </DL> <HR> <A NAME="getReportedData()"><!-- --></A><H3> getReportedData</H3> <PRE> public <A HREF="../../../../org/jivesoftware/smackx/packet/DataForm.ReportedData.html" title="class in org.jivesoftware.smackx.packet">DataForm.ReportedData</A> <B>getReportedData</B>()</PRE> <DL> <DD>Returns the fields that will be returned from a search. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>fields that will be returned from a search.</DL> </DD> </DL> <HR> <A NAME="getItems()"><!-- --></A><H3> getItems</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A><<A HREF="../../../../org/jivesoftware/smackx/packet/DataForm.Item.html" title="class in org.jivesoftware.smackx.packet">DataForm.Item</A>> <B>getItems</B>()</PRE> <DL> <DD>Returns an Iterator for the items returned from a search. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>an Iterator for the items returned from a search.</DL> </DD> </DL> <HR> <A NAME="getFields()"><!-- --></A><H3> getFields</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A><<A HREF="../../../../org/jivesoftware/smackx/FormField.html" title="class in org.jivesoftware.smackx">FormField</A>> <B>getFields</B>()</PRE> <DL> <DD>Returns an Iterator for the fields that are part of the form. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>an Iterator for the fields that are part of the form.</DL> </DD> </DL> <HR> <A NAME="getElementName()"><!-- --></A><H3> getElementName</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getElementName</B>()</PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/smack/packet/PacketExtension.html#getElementName()">PacketExtension</A></CODE></B></DD> <DD>Returns the root element name. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smack/packet/PacketExtension.html#getElementName()">getElementName</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/smack/packet/PacketExtension.html" title="interface in org.jivesoftware.smack.packet">PacketExtension</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the element name.</DL> </DD> </DL> <HR> <A NAME="getNamespace()"><!-- --></A><H3> getNamespace</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getNamespace</B>()</PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/smack/packet/PacketExtension.html#getNamespace()">PacketExtension</A></CODE></B></DD> <DD>Returns the root element XML namespace. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smack/packet/PacketExtension.html#getNamespace()">getNamespace</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/smack/packet/PacketExtension.html" title="interface in org.jivesoftware.smack.packet">PacketExtension</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the namespace.</DL> </DD> </DL> <HR> <A NAME="setTitle(java.lang.String)"><!-- --></A><H3> setTitle</H3> <PRE> public void <B>setTitle</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> title)</PRE> <DL> <DD>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. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>title</CODE> - description of the data.</DL> </DD> </DL> <HR> <A NAME="setInstructions(java.util.List)"><!-- --></A><H3> setInstructions</H3> <PRE> public void <B>setInstructions</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>> instructions)</PRE> <DL> <DD>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. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>instructions</CODE> - list of instructions that explain how to fill out the form.</DL> </DD> </DL> <HR> <A NAME="setReportedData(org.jivesoftware.smackx.packet.DataForm.ReportedData)"><!-- --></A><H3> setReportedData</H3> <PRE> public void <B>setReportedData</B>(<A HREF="../../../../org/jivesoftware/smackx/packet/DataForm.ReportedData.html" title="class in org.jivesoftware.smackx.packet">DataForm.ReportedData</A> reportedData)</PRE> <DL> <DD>Sets the fields that will be returned from a search. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>reportedData</CODE> - the fields that will be returned from a search.</DL> </DD> </DL> <HR> <A NAME="addField(org.jivesoftware.smackx.FormField)"><!-- --></A><H3> addField</H3> <PRE> public void <B>addField</B>(<A HREF="../../../../org/jivesoftware/smackx/FormField.html" title="class in org.jivesoftware.smackx">FormField</A> field)</PRE> <DL> <DD>Adds a new field as part of the form. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>field</CODE> - the field to add to the form.</DL> </DD> </DL> <HR> <A NAME="addInstruction(java.lang.String)"><!-- --></A><H3> addInstruction</H3> <PRE> public void <B>addInstruction</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> instruction)</PRE> <DL> <DD>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. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>instruction</CODE> - the new instruction that explain how to fill out the form.</DL> </DD> </DL> <HR> <A NAME="addItem(org.jivesoftware.smackx.packet.DataForm.Item)"><!-- --></A><H3> addItem</H3> <PRE> public void <B>addItem</B>(<A HREF="../../../../org/jivesoftware/smackx/packet/DataForm.Item.html" title="class in org.jivesoftware.smackx.packet">DataForm.Item</A> item)</PRE> <DL> <DD>Adds a new item returned from a search. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>item</CODE> - the item returned from a search.</DL> </DD> </DL> <HR> <A NAME="toXML()"><!-- --></A><H3> toXML</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>toXML</B>()</PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/smack/packet/PacketExtension.html#toXML()">PacketExtension</A></CODE></B></DD> <DD>Returns the XML reppresentation of the PacketExtension. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smack/packet/PacketExtension.html#toXML()">toXML</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/smack/packet/PacketExtension.html" title="interface in org.jivesoftware.smack.packet">PacketExtension</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the packet extension as XML.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev">  <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Smack</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../org/jivesoftware/smackx/packet/ChatStateExtension.Provider.html" title="class in org.jivesoftware.smackx.packet"><B>PREV CLASS</B></A>   <A HREF="../../../../org/jivesoftware/smackx/packet/DataForm.Item.html" title="class in org.jivesoftware.smackx.packet"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/jivesoftware/smackx/packet/DataForm.html" target="_top"><B>FRAMES</B></A>    <A HREF="DataForm.html" target="_top"><B>NO FRAMES</B></A>    <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright © 2003-2007 Jive Software. </i> </BODY> </HTML>