contenttype.html

来自「SUN的JAVA MAIL API」· HTML 代码 · 共 509 行 · 第 1/2 页

HTML
509
字号
<A NAME="ContentType()"><!-- --></A><H3>
ContentType</H3>
<PRE>
public <B>ContentType</B>()</PRE>
<DL>
<DD>No-arg Constructor.</DL>
<HR>

<A NAME="ContentType(java.lang.String, java.lang.String, javax.mail.internet.ParameterList)"><!-- --></A><H3>
ContentType</H3>
<PRE>
public <B>ContentType</B>(java.lang.String&nbsp;primaryType,
                   java.lang.String&nbsp;subType,
                   <A HREF="../../../javax/mail/internet/ParameterList.html">ParameterList</A>&nbsp;list)</PRE>
<DL>
<DD>Constructor.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>primaryType</CODE> - primary type<DD><CODE>subType</CODE> - subType<DD><CODE>list</CODE> - ParameterList</DL>
</DD>
</DL>
<HR>

<A NAME="ContentType(java.lang.String)"><!-- --></A><H3>
ContentType</H3>
<PRE>
public <B>ContentType</B>(java.lang.String&nbsp;s)
            throws <A HREF="../../../javax/mail/internet/ParseException.html">ParseException</A></PRE>
<DL>
<DD>Constructor that takes a Content-Type string. The String
 is parsed into its constituents: primaryType, subType
 and parameters. A ParseException is thrown if the parse fails.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - the Content-Type string.<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/internet/ParseException.html">ParseException</A> - if the parse fails.</DL>
</DD>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="getPrimaryType()"><!-- --></A><H3>
getPrimaryType</H3>
<PRE>
public java.lang.String <B>getPrimaryType</B>()</PRE>
<DL>
<DD>Return the primary type.<DD><DL>
<DT><B>Returns:</B><DD>the primary type</DL>
</DD>
</DL>
<HR>

<A NAME="getSubType()"><!-- --></A><H3>
getSubType</H3>
<PRE>
public java.lang.String <B>getSubType</B>()</PRE>
<DL>
<DD>Return the subType.<DD><DL>
<DT><B>Returns:</B><DD>the subType</DL>
</DD>
</DL>
<HR>

<A NAME="getBaseType()"><!-- --></A><H3>
getBaseType</H3>
<PRE>
public java.lang.String <B>getBaseType</B>()</PRE>
<DL>
<DD>Return the MIME type string, without the parameters.
 The returned value is basically the concatenation of
 the primaryType, the '/' character and the secondaryType.<DD><DL>
<DT><B>Returns:</B><DD>the type</DL>
</DD>
</DL>
<HR>

<A NAME="getParameter(java.lang.String)"><!-- --></A><H3>
getParameter</H3>
<PRE>
public java.lang.String <B>getParameter</B>(java.lang.String&nbsp;name)</PRE>
<DL>
<DD>Return the specified parameter value. Returns <code>null</code>
 if this parameter is absent.<DD><DL>
<DT><B>Returns:</B><DD>parameter value</DL>
</DD>
</DL>
<HR>

<A NAME="getParameterList()"><!-- --></A><H3>
getParameterList</H3>
<PRE>
public <A HREF="../../../javax/mail/internet/ParameterList.html">ParameterList</A> <B>getParameterList</B>()</PRE>
<DL>
<DD>Return a ParameterList object that holds all the available 
 parameters. Returns null if no parameters are available.<DD><DL>
<DT><B>Returns:</B><DD>ParameterList</DL>
</DD>
</DL>
<HR>

<A NAME="setPrimaryType(java.lang.String)"><!-- --></A><H3>
setPrimaryType</H3>
<PRE>
public void <B>setPrimaryType</B>(java.lang.String&nbsp;primaryType)</PRE>
<DL>
<DD>Set the primary type. Overrides existing primary type.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>primaryType</CODE> - primary type</DL>
</DD>
</DL>
<HR>

<A NAME="setSubType(java.lang.String)"><!-- --></A><H3>
setSubType</H3>
<PRE>
public void <B>setSubType</B>(java.lang.String&nbsp;subType)</PRE>
<DL>
<DD>Set the subType. Overrides existing subType<DD><DL>
<DT><B>Parameters:</B><DD><CODE>type</CODE> - subType</DL>
</DD>
</DL>
<HR>

<A NAME="setParameter(java.lang.String, java.lang.String)"><!-- --></A><H3>
setParameter</H3>
<PRE>
public void <B>setParameter</B>(java.lang.String&nbsp;name,
                         java.lang.String&nbsp;value)</PRE>
<DL>
<DD>Set the specified parameter. If this parameter already exists,
 it is replaced by this new value.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - parameter name<DD><CODE>value</CODE> - parameter value</DL>
</DD>
</DL>
<HR>

<A NAME="setParameterList(javax.mail.internet.ParameterList)"><!-- --></A><H3>
setParameterList</H3>
<PRE>
public void <B>setParameterList</B>(<A HREF="../../../javax/mail/internet/ParameterList.html">ParameterList</A>&nbsp;list)</PRE>
<DL>
<DD>Set a new ParameterList.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>list</CODE> - ParameterList</DL>
</DD>
</DL>
<HR>

<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public java.lang.String <B>toString</B>()</PRE>
<DL>
<DD>Retrieve a RFC2045 style string representation of
 this Content-Type. Returns <code>null</code> if
 the conversion failed.<DD><DL>
<DT><B>Returns:</B><DD>RFC2045 style string<DT><B>Overrides:</B><DD>toString in class java.lang.Object</DL>
</DD>
</DL>
<HR>

<A NAME="match(javax.mail.internet.ContentType)"><!-- --></A><H3>
match</H3>
<PRE>
public boolean <B>match</B>(<A HREF="../../../javax/mail/internet/ContentType.html">ContentType</A>&nbsp;cType)</PRE>
<DL>
<DD>Match with the specified ContentType object. This method
 compares <strong>only the <code>primaryType</code> and 
 <code>subType</code> </strong>. The parameters of both operands
 are ignored. <p>

 For example, this method will return <code>true</code> when
 comparing the ContentTypes for <strong>"text/plain"</strong>
 and <strong>"text/plain; charset=foobar"</strong>.

 If the <code>subType</code> of either operand is the special
 character '*', then the subtype is ignored during the match. 
 For example, this method will return <code>true</code> when 
 comparing the ContentTypes for <strong>"text/plain"</strong> 
 and <strong>"text/*" </strong><DD><DL>
<DT><B>Parameters:</B><DD><CODE>ContentType</CODE> - to compare this against</DL>
</DD>
</DL>
<HR>

<A NAME="match(java.lang.String)"><!-- --></A><H3>
match</H3>
<PRE>
public boolean <B>match</B>(java.lang.String&nbsp;s)</PRE>
<DL>
<DD>Match with the specified content-type string. This method
 compares <strong>only the <code>primaryType</code> and 
 <code>subType</code> </strong>.
 The parameters of both operands are ignored. <p>

 For example, this method will return <code>true</code> when
 comparing the ContentType for <strong>"text/plain"</strong>
 with <strong>"text/plain; charset=foobar"</strong>.

 If the <code>subType</code> of either operand is the special 
 character '*', then the subtype is ignored during the match. 
 For example, this method will return <code>true</code> when 
 comparing the ContentType for <strong>"text/plain"</strong> 
 with <strong>"text/*" </strong></DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="class-use/ContentType.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../javax/mail/internet/HeaderTokenizer.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ContentType.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="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>
<!-- =========== END OF NAVBAR =========== -->

<HR>

</BODY>
</HTML>

⌨️ 快捷键说明

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