📄 form.html
字号:
<BR> Sets a new float value to a given form's field.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smackx/Form.html#setAnswer(java.lang.String, int)">setAnswer</A></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> variable, int value)</CODE><BR> Sets a new int value to a given form's field.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smackx/Form.html#setAnswer(java.lang.String, java.util.List)">setAnswer</A></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> variable, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/List.html" title="class or interface in java.util">List</A> values)</CODE><BR> Sets a new values to a given form's field.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smackx/Form.html#setAnswer(java.lang.String, long)">setAnswer</A></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> variable, long value)</CODE><BR> Sets a new long value to a given form's field.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smackx/Form.html#setAnswer(java.lang.String, java.lang.String)">setAnswer</A></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> variable, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> value)</CODE><BR> Sets a new String value to a given form's field.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smackx/Form.html#setDefaultAnswer(java.lang.String)">setDefaultAnswer</A></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> variable)</CODE><BR> Sets the default value as the value of a given form's field.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smackx/Form.html#setInstructions(java.lang.String)">setInstructions</A></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> instructions)</CODE><BR> Sets instructions that explain how to fill out the form and what the form is about.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smackx/Form.html#setTitle(java.lang.String)">setTitle</A></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)</CODE><BR> Sets the description of the data.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Field Detail</B></FONT></TH></TR></TABLE><A NAME="TYPE_FORM"><!-- --></A><H3>TYPE_FORM</H3><PRE>public static final <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>TYPE_FORM</B></PRE><DL><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.jivesoftware.smackx.Form.TYPE_FORM">Constant Field Values</A></DL></DL><HR><A NAME="TYPE_SUBMIT"><!-- --></A><H3>TYPE_SUBMIT</H3><PRE>public static final <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>TYPE_SUBMIT</B></PRE><DL><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.jivesoftware.smackx.Form.TYPE_SUBMIT">Constant Field Values</A></DL></DL><HR><A NAME="TYPE_CANCEL"><!-- --></A><H3>TYPE_CANCEL</H3><PRE>public static final <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>TYPE_CANCEL</B></PRE><DL><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.jivesoftware.smackx.Form.TYPE_CANCEL">Constant Field Values</A></DL></DL><HR><A NAME="TYPE_RESULT"><!-- --></A><H3>TYPE_RESULT</H3><PRE>public static final <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>TYPE_RESULT</B></PRE><DL><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.jivesoftware.smackx.Form.TYPE_RESULT">Constant Field Values</A></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="Form(java.lang.String)"><!-- --></A><H3>Form</H3><PRE>public <B>Form</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> type)</PRE><DL><DD>Creates a new Form of a given type from scratch.<p> Possible form types are: <ul> <li>form -> Indicates a form to fill out.</li> <li>submit -> The form is filled out, and this is the data that is being returned from the form.</li> <li>cancel -> The form was cancelled. Tell the asker that piece of information.</li> <li>result -> Data results being returned from a search, or some other query.</li> </ul><P><DL><DT><B>Parameters:</B><DD><CODE>type</CODE> - the form's type (e.g. form, submit,cancel,result).</DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getFormFrom(org.jivesoftware.smack.packet.Packet)"><!-- --></A><H3>getFormFrom</H3><PRE>public static <A HREF="../../../org/jivesoftware/smackx/Form.html" title="class in org.jivesoftware.smackx">Form</A> <B>getFormFrom</B>(<A HREF="../../../org/jivesoftware/smack/packet/Packet.html" title="class in org.jivesoftware.smack.packet">Packet</A> packet)</PRE><DL><DD>Returns a new ReportedData if the packet is used for gathering data and includes an extension that matches the elementName and namespace "x","jabber:x:data".<P><DD><DL><DT><B>Parameters:</B><DD><CODE>packet</CODE> - the packet used for gathering data.</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 to complete as part of the form.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>field</CODE> - the field to complete.</DL></DD></DL><HR><A NAME="setAnswer(java.lang.String, java.lang.String)"><!-- --></A><H3>setAnswer</H3><PRE>public void <B>setAnswer</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> variable, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> value)</PRE><DL><DD>Sets a new String value to a given form's field. The field whose variable matches the requested variable will be completed with the specified value. If no field could be found for the specified variable then an exception will be raised.<p> If the value to set to the field is not a basic type (e.g. String, boolean, int, etc.) you can use this message where the String value is the String representation of the object.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>variable</CODE> - the variable name that was completed.<DD><CODE>value</CODE> - the String value that was answered.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the form is not of type "submit".<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the form does not include the specified variable.<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the answer type does not correspond with the field type.</DL></DD></DL><HR><A NAME="setAnswer(java.lang.String, int)"><!-- --></A><H3>setAnswer</H3><PRE>public void <B>setAnswer</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> variable, int value)</PRE><DL><DD>Sets a new int value to a given form's field. The field whose variable matches the requested variable will be completed with the specified value. If no field could be found for the specified variable then an exception will be raised.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>variable</CODE> - the variable name that was completed.<DD><CODE>value</CODE> - the int value that was answered.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the form is not of type "submit".<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the form does not include the specified variable.<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the answer type does not correspond with the field type.</DL></DD></DL><HR><A NAME="setAnswer(java.lang.String, long)"><!-- --></A><H3>setAnswer</H3><PRE>public void <B>setAnswer</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> variable, long value)</PRE><DL><DD>Sets a new long value to a given form's field. The field whose variable matches the requested variable will be completed with the specified value. If no field could be found for the specified variable then an exception will be raised.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>variable</CODE> - the variable name that was completed.<DD><CODE>value</CODE> - the long value that was answered.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the form is not of type "submit".<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the form does not include the specified variable.<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the answer type does not correspond with the field type.</DL></DD></DL><HR><A NAME="setAnswer(java.lang.String, float)"><!-- --></A><H3>setAnswer</H3><PRE>public void <B>setAnswer</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> variable, float value)</PRE><DL><DD>Sets a new float value to a given form's field. The field whose variable matches the requested variable will be completed with the specified value. If no field could be found for the specified variable then an exception will be raised.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>variable</CODE> - the variable name that was completed.<DD><CODE>value</CODE> - the float value that was answered.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the form is not of type "submit".<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the form does not include the specified variable.<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the answer type does not correspond with the field type.</DL></DD></DL><HR><A NAME="setAnswer(java.lang.String, double)"><!-- --></A><H3>setAnswer</H3><PRE>public void <B>setAnswer</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> variable, double value)</PRE><DL><DD>Sets a new double value to a given form's field. The field whose variable matches the requested variable will be completed with the specified value. If no field could be found
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -