📄 packet.html
字号:
<BR> Returns the packet ID, or <tt>null</tt> if the packet does not have an ID.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xmpp/packet/Packet.html#getTo()">getTo</A></B>()</CODE><BR> Returns the XMPP address (JID) that the packet is addressed to, or <tt>null</tt> if the "to" attribute is not set.</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/xmpp/packet/Packet.html#setError(org.xmpp.packet.PacketError.Condition)">setError</A></B>(<A HREF="../../../org/xmpp/packet/PacketError.Condition.html" title="enum in org.xmpp.packet">PacketError.Condition</A> condition)</CODE><BR> Sets the packet error using the specified condition.</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/xmpp/packet/Packet.html#setError(org.xmpp.packet.PacketError)">setError</A></B>(<A HREF="../../../org/xmpp/packet/PacketError.html" title="class in org.xmpp.packet">PacketError</A> error)</CODE><BR> Sets the packet error.</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/xmpp/packet/Packet.html#setFrom(org.xmpp.packet.JID)">setFrom</A></B>(<A HREF="../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A> from)</CODE><BR> Sets the XMPP address (JID) that the packet comes from.</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/xmpp/packet/Packet.html#setFrom(java.lang.String)">setFrom</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> from)</CODE><BR> Sets the XMPP address (JID) that the packet comes from.</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/xmpp/packet/Packet.html#setID(java.lang.String)">setID</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> ID)</CODE><BR> Sets the packet ID.</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/xmpp/packet/Packet.html#setTo(org.xmpp.packet.JID)">setTo</A></B>(<A HREF="../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A> to)</CODE><BR> Sets the XMPP address (JID) that the packet is address to.</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/xmpp/packet/Packet.html#setTo(java.lang.String)">setTo</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> to)</CODE><BR> Sets the XMPP address (JID) that the packet is addressed to.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xmpp/packet/Packet.html#toString()">toString</A></B>()</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xmpp/packet/Packet.html#toXML()">toXML</A></B>()</CODE><BR> Returns the textual XML representation of this packet.</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.5.0/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.5.0/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5.0/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.5.0/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/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.5.0/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="docFactory"><!-- --></A><H3>docFactory</H3><PRE>protected static org.dom4j.DocumentFactory <B>docFactory</B></PRE><DL><DL></DL></DL><HR><A NAME="element"><!-- --></A><H3>element</H3><PRE>protected org.dom4j.Element <B>element</B></PRE><DL><DL></DL></DL><HR><A NAME="toJID"><!-- --></A><H3>toJID</H3><PRE>protected <A HREF="../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A> <B>toJID</B></PRE><DL><DL></DL></DL><HR><A NAME="fromJID"><!-- --></A><H3>fromJID</H3><PRE>protected <A HREF="../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A> <B>fromJID</B></PRE><DL><DL></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(org.dom4j.Element)"><!-- --></A><H3>Packet</H3><PRE>public <B>Packet</B>(org.dom4j.Element element)</PRE><DL><DD>Constructs a new Packet. The TO address contained in the XML Element will only be validated. In other words, stringprep operations will only be performed on the TO JID to verify that it is well-formed. The FROM address is assigned by the server so there is no need to verify it.<P><DL><DT><B>Parameters:</B><DD><CODE>element</CODE> - the XML Element that contains the packet contents.</DL></DL><HR><A NAME="Packet(org.dom4j.Element, boolean)"><!-- --></A><H3>Packet</H3><PRE>public <B>Packet</B>(org.dom4j.Element element, boolean skipValidation)</PRE><DL><DD>Constructs a new Packet. The JID address contained in the XML Element may not be validated. When validation can be skipped then stringprep operations will not be performed on the JIDs to verify that addresses are well-formed. However, when validation cannot be skipped then <tt>only</tt> the TO address will be verified. The FROM address is assigned by the server so there is no need to verify it.<P><DL><DT><B>Parameters:</B><DD><CODE>element</CODE> - the XML Element that contains the packet contents.<DD><CODE>skipValidation</CODE> - true if stringprep should not be applied to the TO address.</DL></DL><HR><A NAME="Packet()"><!-- --></A><H3>Packet</H3><PRE>protected <B>Packet</B>()</PRE><DL><DD>Constructs a new Packet with no element data. This method is used by extensions of this class that require a more optimized path for creating new packets.<P></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="getID()"><!-- --></A><H3>getID</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getID</B>()</PRE><DL><DD>Returns the packet ID, or <tt>null</tt> if the packet does not have an ID. Packet ID's are optional, except for IQ packets.<P><DD><DL><DT><B>Returns:</B><DD>the packet ID.</DL></DD></DL><HR><A NAME="setID(java.lang.String)"><!-- --></A><H3>setID</H3><PRE>public void <B>setID</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> ID)</PRE><DL><DD>Sets the packet ID. Packet ID's are optional, except for IQ packets.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>ID</CODE> - the packet ID.</DL></DD></DL><HR><A NAME="getTo()"><!-- --></A><H3>getTo</H3><PRE>public <A HREF="../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A> <B>getTo</B>()</PRE><DL><DD>Returns the XMPP address (JID) that the packet is addressed to, or <tt>null</tt> if the "to" attribute is not set. The XMPP protocol often makes the "to" attribute optional, so it does not always need to be set.<P><DD><DL><DT><B>Returns:</B><DD>the XMPP address (JID) that the packet is addressed to, or <tt>null</tt> if not 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.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> to)</PRE><DL><DD>Sets the XMPP address (JID) that the packet is addressed 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> - the XMPP address (JID) that the packet is addressed to.</DL></DD></DL><HR><A NAME="setTo(org.xmpp.packet.JID)"><!-- --></A><H3>setTo</H3><PRE>public void <B>setTo</B>(<A HREF="../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A> to)</PRE><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -