|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.xml.bind.attachment.AttachmentUnmarshaller
public abstract class AttachmentUnmarshaller
啟用包含優化的二進制資料格式的根文檔的 JAXB 解組。
此 API 支持 JAXB 2.0 實作與基於 MIME 的套件處理器(MTOM/XOP 和 WS-I AP 1.0)之間的協作,有效地處理優化的二進制資料格式。JAXB 解組套件的正文,把理解將使用的打包格式這項任務委託給實作此抽象類別的基於 MIME 的套件處理器。
此抽象類別標識套件是否需要 XOP 處理(isXOPPackage()),並提供對使用內容 id 存儲為附件的二進制內容的檢索。
getAttachment*(String cid) 的內容 id(即 cid)。ref:swaRef 的屬性。
Unmarshaller.setAttachmentUnmarshaller(AttachmentUnmarshaller),
XML-binary Optimized Packaging,
WS-I Attachments Profile Version 1.0.,
Describing Media Content of Binary Data in XML| 建構子摘要 | |
|---|---|
AttachmentUnmarshaller()
|
|
| 方法摘要 | |
|---|---|
abstract byte[] |
getAttachmentAsByteArray(String cid)
以 byte[] 形式檢索由內容 id(即 cid)標識的附件。 |
abstract DataHandler |
getAttachmentAsDataHandler(String cid)
通過內容 id(即 cid)尋找 MIME 內容,並作為 DataHandler 返回。 |
boolean |
isXOPPackage()
只讀屬性,如果 JAXB 解組程序需要執行 XOP 處理,則返回 true。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public AttachmentUnmarshaller()
| 方法詳細資訊 |
|---|
public abstract DataHandler getAttachmentAsDataHandler(String cid)
通過內容 id(即 cid)尋找 MIME 內容,並作為 DataHandler 返回。
返回的 DataHandler 實例必須配置為滿足以下必需的映射關係約束條件。
| MIME 和 Java 型別之間的必需的映射關係 | |
|---|---|
| MIME 型別 | Java 型別 |
DataHandler.getContentType() |
instanceof DataHandler.getContent() |
| image/gif | java.awt.Image |
| image/jpeg | java.awt.Image |
| text/xml or application/xml | javax.xml.transform.Source |
cid - 需要它是 XML 網要 xs:anyURI 資料型別的有效詞法形式。如果 isXOPPackage() ==true,則對於每個 cid: URI 網要,它都必須是有效的 URI(參見 RFC 2387)。
DataHandler。
IllegalArgumentException - 如果未找到給定 cid 的附件。public abstract byte[] getAttachmentAsByteArray(String cid)
以 byte[] 形式檢索由內容 id(即 cid)標識的附件。
cid - 需要它是 XML 網要 xs:anyURI 資料型別的有效詞法形式。如果 isXOPPackage() ==true,則對於每個 cid: URI 網要,它都必須是有效的 URI(參見 RFC 2387)。
IllegalArgumentException - 如果未找到給定 cid 的附件。public boolean isXOPPackage()
只讀屬性,如果 JAXB 解組程序需要執行 XOP 處理,則返回 true。
當滿足 Identifying XOP Documents 中指定的約束條件時,此方法返回 true。解組過程中此值不得更改。
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。