⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 packet.html

📁 开源项目smack的API文件
💻 HTML
📖 第 1 页 / 共 3 页
字号:
</TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#nextID()">nextID</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the next unique id.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected static&nbsp;<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#parseXMLLang(java.lang.String)">parseXMLLang</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>&nbsp;language)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#removeExtension(org.jivesoftware.smack.packet.PacketExtension)">removeExtension</A></B>(<A HREF="../../../../org/jivesoftware/smack/packet/PacketExtension.html" title="interface in org.jivesoftware.smack.packet">PacketExtension</A>&nbsp;extension)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes a packet extension from the packet.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#setDefaultXmlns(java.lang.String)">setDefaultXmlns</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>&nbsp;defaultXmlns)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#setError(org.jivesoftware.smack.packet.XMPPError)">setError</A></B>(<A HREF="../../../../org/jivesoftware/smack/packet/XMPPError.html" title="class in org.jivesoftware.smack.packet">XMPPError</A>&nbsp;error)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the error for this packet.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#setFrom(java.lang.String)">setFrom</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>&nbsp;from)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets who the packet is being sent "from".</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#setPacketID(java.lang.String)">setPacketID</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>&nbsp;packetID)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the unique ID of the packet.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#setProperty(java.lang.String, java.lang.Object)">setProperty</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>&nbsp;name,            <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a property with an Object as the value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#setTo(java.lang.String)">setTo</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>&nbsp;to)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets who the packet is being sent "to".</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#toXML()">toXML</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the packet as XML.</TD></TR></TABLE>&nbsp;<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#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#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>&nbsp;<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="DEFAULT_LANGUAGE"><!-- --></A><H3>DEFAULT_LANGUAGE</H3><PRE>protected 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>DEFAULT_LANGUAGE</B></PRE><DL><DL></DL></DL><HR><A NAME="ID_NOT_AVAILABLE"><!-- --></A><H3>ID_NOT_AVAILABLE</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>ID_NOT_AVAILABLE</B></PRE><DL><DD>Constant used as packetID to indicate that a packet has no id. To indicate that a packet has no id set this constant as the packet's id. When the packet is asked for its id the answer will be <tt>null</tt>.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.jivesoftware.smack.packet.Packet.ID_NOT_AVAILABLE">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="Packet()"><!-- --></A><H3>Packet</H3><PRE>public <B>Packet</B>()</PRE><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="nextID()"><!-- --></A><H3>nextID</H3><PRE>public static <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>nextID</B>()</PRE><DL><DD>Returns the next unique id. Each id made up of a short alphanumeric prefix along with a unique numeric value.<P><DD><DL><DT><B>Returns:</B><DD>the next id.</DL></DD></DL><HR><A NAME="setDefaultXmlns(java.lang.String)"><!-- --></A><H3>setDefaultXmlns</H3><PRE>public static void <B>setDefaultXmlns</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>&nbsp;defaultXmlns)</PRE><DL><DD><DL></DL></DD></DL><HR><A NAME="getPacketID()"><!-- --></A><H3>getPacketID</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>getPacketID</B>()</PRE><DL><DD>Returns the unique ID of the packet. The returned value could be <tt>null</tt> when ID_NOT_AVAILABLE was set as the packet's id.<P><DD><DL><DT><B>Returns:</B><DD>the packet's unique ID or <tt>null</tt> if the packet's id is not available.</DL></DD></DL><HR><A NAME="setPacketID(java.lang.String)"><!-- --></A><H3>setPacketID</H3><PRE>public void <B>setPacketID</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>&nbsp;packetID)</PRE><DL><DD>Sets the unique ID of the packet. To indicate that a packet has no id pass the constant ID_NOT_AVAILABLE as the packet's id value.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>packetID</CODE> - the unique ID for the packet.</DL></DD></DL><HR><A NAME="getTo()"><!-- --></A><H3>getTo</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>getTo</B>()</PRE><DL><DD>Returns who the packet is being sent "to", or <tt>null</tt> if the value is not set. The XMPP protocol often makes the "to" attribute optional, so it does not always need to be set.<p> The StringUtils class provides several useful methods for dealing with XMPP addresses such as parsing the <A HREF="../../../../org/jivesoftware/smack/util/StringUtils.html#parseBareAddress(java.lang.String)"><CODE>bare address</CODE></A>, <A HREF="../../../../org/jivesoftware/smack/util/StringUtils.html#parseName(java.lang.String)"><CODE>user name</CODE></A>, <A HREF="../../../../org/jivesoftware/smack/util/StringUtils.html#parseServer(java.lang.String)"><CODE>server</CODE></A>, and <A HREF="../../../../org/jivesoftware/smack/util/StringUtils.html#parseResource(java.lang.String)"><CODE>resource</CODE></A>.<P><DD><DL><DT><B>Returns:</B><DD>who the packet is being sent to, or <tt>null</tt> if the      value has not been set.</DL></DD></DL><HR><A NAME="setTo(java.lang.String)"><!-- --></A><H3>setTo</H3><PRE>public void <B>setTo</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>&nbsp;to)</PRE><DL><DD>Sets who the packet is being sent "to". The XMPP protocol often makes the "to" attribute optional, so it does not always need to be set.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>to</CODE> - who the packet is being sent to.</DL></DD></DL><HR><A NAME="getFrom()"><!-- --></A><H3>getFrom</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>getFrom</B>()</PRE><DL><DD>Returns who the packet is being sent "from" or <tt>null</tt> if the value is not set. The XMPP protocol often makes the "from" attribute optional, so it does not always need to be set.<p> The StringUtils class provides several useful methods for dealing with XMPP addresses such as parsing the <A HREF="../../../../org/jivesoftware/smack/util/StringUtils.html#parseBareAddress(java.lang.String)"><CODE>bare address</CODE></A>, <A HREF="../../../../org/jivesoftware/smack/util/StringUtils.html#parseName(java.lang.String)"><CODE>user name</CODE></A>, <A HREF="../../../../org/jivesoftware/smack/util/StringUtils.html#parseServer(java.lang.String)"><CODE>server</CODE></A>, and <A HREF="../../../../org/jivesoftware/smack/util/StringUtils.html#parseResource(java.lang.String)"><CODE>resource</CODE></A>.<P><DD><DL><DT><B>Returns:</B><DD>who the packet is being sent from, or <tt>null</tt> if the      value has not been set.</DL></DD></DL><HR><A NAME="setFrom(java.lang.String)"><!-- --></A><H3>setFrom</H3><PRE>public void <B>setFrom</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>&nbsp;from)</PRE><DL><DD>Sets who the packet is being sent "from". The XMPP protocol often makes the "from" attribute optional, so it does not always need to be set.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>from</CODE> - who the packet is being sent to.</DL></DD></DL><HR><A NAME="getError()"><!-- --></A><H3>getError</H3><PRE>public <A HREF="../../../../org/jivesoftware/smack/packet/XMPPError.html" title="class in org.jivesoftware.smack.packet">XMPPError</A> <B>getError</B>()</PRE><DL><DD>Returns the error associated with this packet, or <tt>null</tt> if there are no errors.<P><DD><DL><DT><B>Returns:</B><DD>the error sub-packet or <tt>null</tt> if there isn't an error.</DL></DD></DL><HR><A NAME="setError(org.jivesoftware.smack.packet.XMPPError)"><!-- --></A><H3>setError</H3>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -