attachmentpart.html

来自「j2ee api,很好的api。我这现在有」· HTML 代码 · 共 881 行 · 第 1/3 页

HTML
881
字号
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/soap/AttachmentPart.html#getMimeHeader(java.lang.String)">getMimeHeader</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;name)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets all the values of the header identified by the given <code>String</code>.</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.4/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/soap/AttachmentPart.html#getNonMatchingMimeHeaders(java.lang.String[])">getNonMatchingMimeHeaders</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[]&nbsp;names)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves all <code>MimeHeader</code> objects whose name does not match a name in the given array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/soap/AttachmentPart.html#getSize()">getSize</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of bytes in this <code>AttachmentPart</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/soap/AttachmentPart.html#removeAllMimeHeaders()">removeAllMimeHeaders</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes all the MIME header entries.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/soap/AttachmentPart.html#removeMimeHeader(java.lang.String)">removeMimeHeader</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;header)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes all MIME headers that match the given name.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/soap/AttachmentPart.html#setContent(java.lang.Object, java.lang.String)">setContent</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;object,           <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;contentType)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the content of this attachment part to that of the given  <code>Object</code> and sets the value of the <code>Content-Type</code> header to the given type. </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="../../../javax/xml/soap/AttachmentPart.html#setContentId(java.lang.String)">setContentId</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;contentId)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the MIME header whose name is "Content-Id" with the given 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="../../../javax/xml/soap/AttachmentPart.html#setContentLocation(java.lang.String)">setContentLocation</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;contentLocation)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the MIME header whose name is "Content-Location" with the given 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="../../../javax/xml/soap/AttachmentPart.html#setContentType(java.lang.String)">setContentType</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;contentType)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the MIME header whose name is "Content-Type" with the given value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/soap/AttachmentPart.html#setDataHandler(javax.activation.DataHandler)">setDataHandler</A></B>(<A HREF="../../../javax/activation/DataHandler.html" title="class in javax.activation">DataHandler</A>&nbsp;dataHandler)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the given <code>DataHandler</code> object as the data handler for this <code>AttachmentPart</code> object. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/soap/AttachmentPart.html#setMimeHeader(java.lang.String, java.lang.String)">setMimeHeader</A></B>(<A HREF="http://java.sun.com/j2se/1.4/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.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Changes the first header entry that matches the given name to the given value, adding a new header if no existing header matches. </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"><TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4/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.4/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/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.4/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 =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="AttachmentPart()"><!-- --></A><H3>AttachmentPart</H3><PRE>public <B>AttachmentPart</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"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getSize()"><!-- --></A><H3>getSize</H3><PRE>public abstract int <B>getSize</B>()                     throws <A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></PRE><DL><DD>Returns the number of bytes in this <code>AttachmentPart</code> object.<P><DD><DL><DT><B>Returns:</B><DD>the size of this <code>AttachmentPart</code> object in bytes         or -1 if the size cannot be determined<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></CODE> - if the content of this attachment is            corrupted of if there was an exception while trying            to determine the size.</DL></DD></DL><HR><A NAME="clearContent()"><!-- --></A><H3>clearContent</H3><PRE>public abstract void <B>clearContent</B>()</PRE><DL><DD>Clears out the content of this <code>AttachmentPart</code> object. The MIME header portion is left untouched.<P><DD><DL></DL></DD></DL><HR><A NAME="getContent()"><!-- --></A><H3>getContent</H3><PRE>public abstract <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getContent</B>()                           throws <A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></PRE><DL><DD>Gets the content of this <code>AttachmentPart</code> object as a Java object. The type of the returned Java object depends on (1) the <code>DataContentHandler</code> object that is used to interpret the bytes and (2) the <code>Content-Type</code> given in the header. <p> For the MIME content types "text/plain", "text/html" and "text/xml", the <code>DataContentHandler</code> object does the conversions to and  from the Java types corresponding to the MIME types. For other MIME types,the <code>DataContentHandler</code> object  can return an <code>InputStream</code> object that contains the content data as raw bytes. <p> A SAAJ-compliant implementation must, as a minimum, return a <code>java.lang.String</code> object corresponding to any content stream with a <code>Content-Type</code> value of <code>text/plain</code>, a <code>javax.xml.transform.stream.StreamSource</code> object corresponding to a content stream with a <code>Content-Type</code> value of <code>text/xml</code>, a <code>java.awt.Image</code> object corresponding to a content stream with a <code>Content-Type</code> value of <code>image/gif</code> or <code>image/jpeg</code>.  For those content types that an  installed <code>DataContentHandler</code> object does not understand, the <code>DataContentHandler</code> object is required to return a <code>java.io.InputStream</code> object with the raw bytes.<P><DD><DL><DT><B>Returns:</B><DD>a Java object with the content of this <code>AttachmentPart</code>         object<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></CODE> - if there is no content set into this            <code>AttachmentPart</code> object or if there was a data            transformation error</DL></DD></DL><HR><A NAME="setContent(java.lang.Object, java.lang.String)"><!-- --></A><H3>setContent</H3><PRE>public abstract void <B>setContent</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;object,                                <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;contentType)</PRE><DL><DD>Sets the content of this attachment part to that of the given  <code>Object</code> and sets the value of the <code>Content-Type</code> header to the given type. The type of the <code>Object</code> should correspond to the value given for the <code>Content-Type</code>. This depends on the particular set of <code>DataContentHandler</code> objects in use.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>object</CODE> - the Java object that makes up the content for               this attachment part<DD><CODE>contentType</CODE> - the MIME string that specifies the type of                  the content<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the contentType does not            match the type of the content object, or if there            was no <code>DataContentHandler</code> object for this            content object<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/soap/AttachmentPart.html#getContent()"><CODE>getContent()</CODE></A></DL></DD></DL><HR><A NAME="getDataHandler()"><!-- --></A><H3>getDataHandler</H3><PRE>public abstract <A HREF="../../../javax/activation/DataHandler.html" title="class in javax.activation">DataHandler</A> <B>getDataHandler</B>()                                    throws <A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></PRE><DL><DD>Gets the <code>DataHandler</code> object for this <code>AttachmentPart</code> object.<P><DD><DL><DT><B>Returns:</B><DD>the <code>DataHandler</code> object associated with this         <code>AttachmentPart</code> object<DT><B>Throws:</B><DD><CODE><code>SOAPException</code></CODE> - if there is no data in this <code>AttachmentPart</code> object<DD><CODE><A HREF="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</A></CODE></DL></DD></DL><HR><A NAME="setDataHandler(javax.activation.DataHandler)"><!-- --></A><H3>setDataHandler</H3><PRE>public abstract void <B>setDataHandler</B>(<A HREF="../../../javax/activation/DataHandler.html" title="class in javax.activation">DataHandler</A>&nbsp;dataHandler)</PRE><DL><DD>Sets the given <code>DataHandler</code> object as the data handler for this <code>AttachmentPart</code> object. Typically, on an incoming message, the data handler is automatically set. When a message is being created and populated with content, the <code>setDataHandler</code> method can be used to get data from various data sources into the message.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>dataHandler</CODE> - the <code>DataHandler</code> object to be set<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if there was a problem with            the specified <code>DataHandler</code> object</DL></DD></DL><HR><A NAME="getContentId()"><!-- --></A><H3>getContentId</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getContentId</B>()</PRE><DL><DD>Gets the value of the MIME header whose name is "Content-Id".<P>

⌨️ 快捷键说明

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