📄 packet.html
字号:
<DD>Sets the XMPP address (JID) that the packet is address 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="getFrom()"><!-- --></A><H3>getFrom</H3><PRE>public <A HREF="../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A> <B>getFrom</B>()</PRE><DL><DD>Returns the XMPP address (JID) that the packet is from, or <tt>null</tt> if the "from" attribute is not set. The XMPP protocol often makes the "from" attribute optional, so it does not always need to be set.<P><DD><DL><DT><B>Returns:</B><DD>the XMPP address that the packet is from, or <tt>null</tt> if not 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.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> from)</PRE><DL><DD>Sets the XMPP address (JID) that the packet comes 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> - the XMPP address (JID) that the packet comes from.</DL></DD></DL><HR><A NAME="setFrom(org.xmpp.packet.JID)"><!-- --></A><H3>setFrom</H3><PRE>public void <B>setFrom</B>(<A HREF="../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A> from)</PRE><DL><DD>Sets the XMPP address (JID) that the packet comes 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> - the XMPP address (JID) that the packet comes from.</DL></DD></DL><HR><A NAME="addExtension(org.xmpp.packet.PacketExtension)"><!-- --></A><H3>addExtension</H3><PRE>public void <B>addExtension</B>(<A HREF="../../../org/xmpp/packet/PacketExtension.html" title="class in org.xmpp.packet">PacketExtension</A> extension)</PRE><DL><DD>Adds the element contained in the PacketExtension to the element of this packet. It is important that this is the first and last time the element contained in PacketExtension is added to another Packet. Otherwise, a runtime error will be thrown when trying to add the PacketExtension's element to the Packet's element. Future modifications to the PacketExtension will be reflected in this Packet.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>extension</CODE> - the PacketExtension whose element will be added to this Packet's element.</DL></DD></DL><HR><A NAME="getExtension(java.lang.String, java.lang.String)"><!-- --></A><H3>getExtension</H3><PRE>public <A HREF="../../../org/xmpp/packet/PacketExtension.html" title="class in org.xmpp.packet">PacketExtension</A> <B>getExtension</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> name, <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> namespace)</PRE><DL><DD>Returns a <A HREF="../../../org/xmpp/packet/PacketExtension.html" title="class in org.xmpp.packet"><CODE>PacketExtension</CODE></A> on the first element found in this packet for the specified <tt>name</tt> and <tt>namespace</tt> or <tt>null</tt> if none was found.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the child element name.<DD><CODE>namespace</CODE> - the child element namespace.<DT><B>Returns:</B><DD>a PacketExtension on the first element found in this packet for the specified name and namespace or null if none was found.</DL></DD></DL><HR><A NAME="deleteExtension(java.lang.String, java.lang.String)"><!-- --></A><H3>deleteExtension</H3><PRE>public boolean <B>deleteExtension</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> name, <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> namespace)</PRE><DL><DD>Deletes the first element whose element name and namespace matches the specified element name and namespace.<p> Notice that this method may remove any child element that matches the specified element name and namespace even if that element was not added to the Packet using a <A HREF="../../../org/xmpp/packet/PacketExtension.html" title="class in org.xmpp.packet"><CODE>PacketExtension</CODE></A>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the child element name.<DD><CODE>namespace</CODE> - the child element namespace.<DT><B>Returns:</B><DD>true if a child element was removed.</DL></DD></DL><HR><A NAME="getError()"><!-- --></A><H3>getError</H3><PRE>public <A HREF="../../../org/xmpp/packet/PacketError.html" title="class in org.xmpp.packet">PacketError</A> <B>getError</B>()</PRE><DL><DD>Returns the packet error, or <tt>null</tt> if there is no packet error.<P><DD><DL><DT><B>Returns:</B><DD>the packet error.</DL></DD></DL><HR><A NAME="setError(org.xmpp.packet.PacketError)"><!-- --></A><H3>setError</H3><PRE>public void <B>setError</B>(<A HREF="../../../org/xmpp/packet/PacketError.html" title="class in org.xmpp.packet">PacketError</A> error)</PRE><DL><DD>Sets the packet error. Calling this method will automatically set the packet "type" attribute to "error".<P><DD><DL><DT><B>Parameters:</B><DD><CODE>error</CODE> - the packet error.</DL></DD></DL><HR><A NAME="setError(org.xmpp.packet.PacketError.Condition)"><!-- --></A><H3>setError</H3><PRE>public void <B>setError</B>(<A HREF="../../../org/xmpp/packet/PacketError.Condition.html" title="enum in org.xmpp.packet">PacketError.Condition</A> condition)</PRE><DL><DD>Sets the packet error using the specified condition. Calling this method will automatically set the packet "type" attribute to "error". This is a convenience method equivalent to calling: <tt>setError(new PacketError(condition));</tt><P><DD><DL><DT><B>Parameters:</B><DD><CODE>condition</CODE> - the error condition.</DL></DD></DL><HR><A NAME="createCopy()"><!-- --></A><H3>createCopy</H3><PRE>public abstract <A HREF="../../../org/xmpp/packet/Packet.html" title="class in org.xmpp.packet">Packet</A> <B>createCopy</B>()</PRE><DL><DD>Creates a deep copy of this packet.<P><DD><DL><DT><B>Returns:</B><DD>a deep copy of this packet.</DL></DD></DL><HR><A NAME="getElement()"><!-- --></A><H3>getElement</H3><PRE>public org.dom4j.Element <B>getElement</B>()</PRE><DL><DD>Returns the DOM4J Element that backs the packet. The element is the definitive representation of the packet and can be manipulated directly to change packet contents.<P><DD><DL><DT><B>Returns:</B><DD>the DOM4J Element that represents the packet.</DL></DD></DL><HR><A NAME="toXML()"><!-- --></A><H3>toXML</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>toXML</B>()</PRE><DL><DD>Returns the textual XML representation of this packet.<P><DD><DL><DT><B>Returns:</B><DD>the textual XML representation of this packet.</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</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>toString</B>()</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A></CODE> in class <CODE><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></CODE></DL></DD><DD><DL></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>Openfire 3.6.0a Javadoc</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/xmpp/packet/Message.Type.html" title="enum in org.xmpp.packet"><B>PREV CLASS</B></A> <A HREF="../../../org/xmpp/packet/PacketError.html" title="class in org.xmpp.packet"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/xmpp/packet/Packet.html" target="_top"><B>FRAMES</B></A> <A HREF="Packet.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: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <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-2008 Jive Software.</i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -