message.html

来自「开源项目smack的API文件」· HTML 代码 · 共 775 行 · 第 1/3 页

HTML
775 行
字号
<DT><B>Parameters:</B><DD><CODE>language</CODE> - the language of the body to return.<DT><B>Returns:</B><DD>the body related to the passed in language.<DT><B>Since:</B></DT>  <DD>3.0.2</DD></DL></DD></DL><HR><A NAME="getBodies()"><!-- --></A><H3>getBodies</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../org/jivesoftware/smack/packet/Message.Body.html" title="class in org.jivesoftware.smack.packet">Message.Body</A>&gt; <B>getBodies</B>()</PRE><DL><DD>Returns a set of all bodies in this Message, including the default message body accessible from <A HREF="../../../../org/jivesoftware/smack/packet/Message.html#getBody()"><CODE>getBody()</CODE></A>.<P><DD><DL><DT><B>Returns:</B><DD>a collection of all bodies in this Message.<DT><B>Since:</B></DT>  <DD>3.0.2</DD></DL></DD></DL><HR><A NAME="setBody(java.lang.String)"><!-- --></A><H3>setBody</H3><PRE>public void <B>setBody</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;body)</PRE><DL><DD>Sets the body of the message. The body is the main message contents.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>body</CODE> - the body of the message.</DL></DD></DL><HR><A NAME="addBody(java.lang.String, java.lang.String)"><!-- --></A><H3>addBody</H3><PRE>public <A HREF="../../../../org/jivesoftware/smack/packet/Message.Body.html" title="class in org.jivesoftware.smack.packet">Message.Body</A> <B>addBody</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,                            <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;body)</PRE><DL><DD>Adds a body with a corresponding language.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>language</CODE> - the language of the body being added.<DD><CODE>body</CODE> - the body being added to the message.<DT><B>Returns:</B><DD>the new <A HREF="../../../../org/jivesoftware/smack/packet/Message.Body.html" title="class in org.jivesoftware.smack.packet"><CODE>Message.Body</CODE></A><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if the body is null, a null pointer exception is thrown<DT><B>Since:</B></DT>  <DD>3.0.2</DD></DL></DD></DL><HR><A NAME="removeBody(java.lang.String)"><!-- --></A><H3>removeBody</H3><PRE>public boolean <B>removeBody</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)</PRE><DL><DD>Removes the body with the given language from the message.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>language</CODE> - the language of the body which is to be removed<DT><B>Returns:</B><DD>true if a body was removed and false if it was not.</DL></DD></DL><HR><A NAME="removeBody(org.jivesoftware.smack.packet.Message.Body)"><!-- --></A><H3>removeBody</H3><PRE>public boolean <B>removeBody</B>(<A HREF="../../../../org/jivesoftware/smack/packet/Message.Body.html" title="class in org.jivesoftware.smack.packet">Message.Body</A>&nbsp;body)</PRE><DL><DD>Removes the body from the message and returns true if the body was removed.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>body</CODE> - the body being removed from the message.<DT><B>Returns:</B><DD>true if the body was successfully removed and false if it was not.<DT><B>Since:</B></DT>  <DD>3.0.2</DD></DL></DD></DL><HR><A NAME="getBodyLanguages()"><!-- --></A><H3>getBodyLanguages</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&gt; <B>getBodyLanguages</B>()</PRE><DL><DD>Returns all the languages being used for the bodies, not including the default body.<P><DD><DL><DT><B>Returns:</B><DD>the languages being used for the bodies.<DT><B>Since:</B></DT>  <DD>3.0.2</DD></DL></DD></DL><HR><A NAME="getThread()"><!-- --></A><H3>getThread</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>getThread</B>()</PRE><DL><DD>Returns the thread id of the message, which is a unique identifier for a sequence of "chat" messages. If no thread id is set, <tt>null</tt> will be returned.<P><DD><DL><DT><B>Returns:</B><DD>the thread id of the message, or <tt>null</tt> if it doesn't exist.</DL></DD></DL><HR><A NAME="setThread(java.lang.String)"><!-- --></A><H3>setThread</H3><PRE>public void <B>setThread</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;thread)</PRE><DL><DD>Sets the thread id of the message, which is a unique identifier for a sequence of "chat" messages.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>thread</CODE> - the thread id of the message.</DL></DD></DL><HR><A NAME="setLanguage(java.lang.String)"><!-- --></A><H3>setLanguage</H3><PRE>public void <B>setLanguage</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)</PRE><DL><DD>Sets the xml:lang of this Message.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>language</CODE> - the xml:lang of this Message.<DT><B>Since:</B></DT>  <DD>3.0.2</DD></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 class: <CODE><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#toXML()">Packet</A></CODE></B></DD><DD>Returns the packet as XML. Every concrete extension of Packet must implement this method. In addition to writing out packet-specific data, every sub-class should also write out the error and the extensions data if they are defined.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#toXML()">toXML</A></CODE> in class <CODE><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html" title="class in org.jivesoftware.smack.packet">Packet</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the XML format of the packet as a String.</DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<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;o)</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html" title="class in org.jivesoftware.smack.packet">Packet</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../../../org/jivesoftware/smack/packet/Packet.html" title="class in org.jivesoftware.smack.packet">Packet</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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</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">&nbsp;<A HREF="../../../../org/jivesoftware/smack/packet/IQ.Type.html" title="class in org.jivesoftware.smack.packet"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../../org/jivesoftware/smack/packet/Message.Body.html" title="class in org.jivesoftware.smack.packet"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html?org/jivesoftware/smack/packet/Message.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Message.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<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:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.jivesoftware.smack.packet.Packet">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright &copy; 2003-2007 Jive Software. </i></BODY></HTML>

⌨️ 快捷键说明

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