Source Code Cross Referenced for AttachmentUnmarshaller.java in  » 6.0-JDK-Modules » jaxb-api » javax » xml » bind » attachment » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » jaxb api » javax.xml.bind.attachment 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package javax.xml.bind.attachment;
002:
003:        import javax.activation.DataHandler;
004:
005:        /**
006:         * <p>Enables JAXB unmarshalling of a root document containing optimized binary data formats.</p>
007:         *
008:         * <p>This API enables an efficient cooperative processing of optimized
009:         * binary data formats between a JAXB 2.0 implementation and MIME-based package
010:         * processor (MTOM/XOP and WS-I AP 1.0). JAXB unmarshals the body of a package, delegating the 
011:         * understanding of the packaging format being used to a MIME-based 
012:         * package processor that implements this abstract class.</p>
013:         *
014:         * <p>This abstract class identifies if a package requires XOP processing, {@link #isXOPPackage()} and provides retrieval of binary content stored as attachments by content-id.</p>
015:         *
016:         * <h2>Identifying the content-id, cid, to pass to <code>getAttachment*(String cid)</code></h2>
017:         * <ul>
018:         * <li>
019:         * For XOP processing, the infoset representation of the cid is described 
020:         * in step 2a in 
021:         * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#interpreting_xop_packages">Section 3.2 Interpreting XOP Packages</a>
022:         * </li>
023:         * <li>
024:         * For WS-I AP 1.0, the cid is identified as an element or attribute of 
025:         * type <code>ref:swaRef </code> specified in 
026:         * <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">Section 4.4 Referencing Attachments from the SOAP Envelope</a>
027:         * </li>
028:         * </ul>
029:         * 
030:         * @author Marc Hadley
031:         * @author Kohsuke Kawaguchi
032:         * @author Joseph Fialli
033:         * 
034:         * @since JAXB 2.0
035:         * 
036:         * @see javax.xml.bind.Unmarshaller#setAttachmentUnmarshaller(AttachmentUnmarshaller)
037:         *
038:         * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
039:         * @see <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">WS-I Attachments Profile Version 1.0.</a>
040:         * @see <a href="http://www.w3.org/TR/xml-media-types/">Describing Media Content of Binary Data in XML</a>
041:         */
042:        public abstract class AttachmentUnmarshaller {
043:            /**
044:             * <p>Lookup MIME content by content-id, <code>cid</code>, and return as a {@link DataHandler}.</p>
045:             * 
046:             * <p>The returned <code>DataHandler</code> instance must be configured
047:             * to meet the following required mapping constaint. 
048:             * <table border="2" rules="all" cellpadding="4">
049:             *   <thead>
050:             *     <tr>
051:             *       <th align="center" colspan="2">
052:             *       Required Mappings between MIME and Java Types
053:             *       </tr>
054:             *     <tr>
055:             *       <th>MIME Type</th>
056:             *       <th>Java Type</th>
057:             *     </tr>
058:             *     </tr>
059:             *     <tr>
060:             *       <th><code>DataHandler.getContentType()</code></th>
061:             *       <th><code>instanceof DataHandler.getContent()</code></th>
062:             *     </tr>
063:             *   </thead>
064:             *   <tbody>
065:             *     <tr>
066:             *       <td>image/gif</td>
067:             *       <td>java.awt.Image</td>
068:             *     </tr>
069:             *     <tr>
070:             *       <td>image/jpeg</td>
071:             *       <td>java.awt.Image</td>
072:             *     </tr>
073:             *     <tr>
074:             *       <td>text/xml  or application/xml</td>
075:             *       <td>javax.xml.transform.Source</td>
076:             *     </tr>
077:             *   </tbody>
078:             *  </table>
079:             * Note that it is allowable to support additional mappings.</p>
080:             * 
081:             * @param cid It is expected to be a valid lexical form of the XML Schema 
082:             * <code>xs:anyURI</code> datatype. If <code>{@link #isXOPPackage()}
083:             * ==true</code>, it must be a valid URI per the <code>cid:</code> URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)
084:             * 
085:             * @return
086:             *       a {@link DataHandler} that represents the MIME attachment.
087:             *
088:             * @throws IllegalArgumentException if the attachment for the given cid is not found.
089:             */
090:            public abstract DataHandler getAttachmentAsDataHandler(String cid);
091:
092:            /**
093:             * <p>Retrieve the attachment identified by content-id, <code>cid</code>,  as a <tt>byte[]</tt></p>.
094:             *
095:             * @param cid It is expected to be a valid lexical form of the XML Schema 
096:             * <code>xs:anyURI</code> datatype. If <code>{@link #isXOPPackage()}
097:             * ==true</code>, it must be a valid URI per the <code>cid:</code> URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)
098:             *
099:             * @return byte[] representation of attachment identified by cid.
100:             * 
101:             * @throws IllegalArgumentException if the attachment for the given cid is not found.
102:             */
103:            public abstract byte[] getAttachmentAsByteArray(String cid);
104:
105:            /**
106:             * <p>Read-only property that returns true if JAXB unmarshaller needs to perform XOP processing.</p>
107:             *
108:             * <p>This method returns <code>true</code> when the constraints specified
109:             * in  <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#identifying_xop_documents">Identifying XOP Documents</a> are met.
110:             * This value must not change during the unmarshalling process.</p>
111:             *
112:             * @return true when MIME context is a XOP Document.
113:             */
114:            public boolean isXOPPackage() {
115:                return false;
116:            }
117:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.