|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.activation.MimeType
public class MimeType
RFC 2045 和 2046 中定義的多用途 Internet 郵件擴展(Multipurpose Internet Mail Extension,MIME)型別。
| 建構子摘要 | |
|---|---|
MimeType()
預設的建構子。 |
|
MimeType(String rawdata)
根據 String 建構 MimeType 的建構子。 |
|
MimeType(String primary,
String sub)
用給定的基本型別和子型別建構 MimeType 的建構子,它的參數列表為空。 |
|
| 方法摘要 | |
|---|---|
String |
getBaseType()
返回此物件的 String 表示形式,不帶參數列表。 |
String |
getParameter(String name)
獲取與給定名稱關聯的值;如果沒有當前關聯,則返回 null。 |
MimeTypeParameterList |
getParameters()
獲取此物件的參數列表。 |
String |
getPrimaryType()
獲取此物件的基本型別。 |
String |
getSubType()
獲取此物件的子型別。 |
boolean |
match(MimeType type)
確定此物件的基本型別和子型別與給定型別中的型別是否相同。 |
boolean |
match(String rawdata)
確定此物件的基本型別和子型別與 rawdata 中描述的內容型別是否相同。 |
void |
readExternal(ObjectInput in)
對象可實作 readExternal 方法來恢復其內容:對於基本型別,調用 DataInput 的方法;對於物件、字元串和陣列,調用 readObject。 |
void |
removeParameter(String name)
移除與給定名稱關聯的所有值。 |
void |
setParameter(String name,
String value)
將值設置為與給定的名稱關聯,替換以前的任何關聯。 |
void |
setPrimaryType(String primary)
將此物件的基本型別設置為給定的 String。 |
void |
setSubType(String sub)
將此物件的子型別設置為給定的 String。 |
String |
toString()
返回此物件的 String 表示形式。 |
void |
writeExternal(ObjectOutput out)
對象可實作 writeExternal 方法來保存其內容:對於其基本值,調用 DataOutput 的方法;對於物件、字元串和陣列,調用 ObjectOutput 的 writeObject 方法。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public MimeType()
public MimeType(String rawdata)
throws MimeTypeParseException
rawdata - MIME 型別字元串
MimeTypeParseException
public MimeType(String primary,
String sub)
throws MimeTypeParseException
primary - 基本 MIME 型別sub - MIME 子型別
MimeTypeParseException - 如果基本型別或子型別不是有效的標記| 方法詳細資訊 |
|---|
public String getPrimaryType()
public void setPrimaryType(String primary)
throws MimeTypeParseException
primary - 基本 MIME 型別
MimeTypeParseException - 如果基本型別不是有效的標記public String getSubType()
public void setSubType(String sub)
throws MimeTypeParseException
sub - MIME 子型別
MimeTypeParseException - 如果子型別不是有效的標記public MimeTypeParameterList getParameters()
public String getParameter(String name)
name - 參數名
public void setParameter(String name,
String value)
name - 參數名value - 參數的值public void removeParameter(String name)
name - 參數名public String toString()
Object 中的 toStringpublic String getBaseType()
public boolean match(MimeType type)
type - 要與之比較的 MimeType 物件
public boolean match(String rawdata)
throws MimeTypeParseException
rawdata - 要與之比較的 MIME 型別字元串
MimeTypeParseException
public void writeExternal(ObjectOutput out)
throws IOException
Externalizable 中的 writeExternalout - 要寫入的 ObjectOutput 物件
IOException - 套件括可能發生的所有 I/O 異常
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
Externalizable 中的 readExternalin - 要從中讀取的 ObjectInput 物件
ClassNotFoundException - 如果找不到要恢復的物件的類別。I
IOException - 如果發生 I/O 錯誤
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。