Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/DesignDocs/293925/Phase9"

Line 1: Line 1:
 
<div style="margin:5px;float:right;border:1px solid #000000;padding:5px">__TOC__</div>
 
<div style="margin:5px;float:right;border:1px solid #000000;padding:5px">__TOC__</div>
= Phase 9 - Attachments (page under construction) =
+
= Phase 9 - Attachments (part 2;  page under construction) =
  
 
Provide support for WebService attachments.  
 
Provide support for WebService attachments.  
Line 16: Line 16:
 
! Field  
 
! Field  
 
! Method
 
! Method
|-
 
| [http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlAttachmentRef.html XmlAttachmentRef]
 
| xml-attachment-ref
 
| align="center" | &nbsp;
 
| align="center" | &nbsp;
 
| align="center" | X
 
| align="center" | X
 
|-
 
| [http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlMimeType.html XmlMimeType]
 
| xml-mime-type
 
| align="center" | &nbsp;
 
| align="center" | &nbsp;
 
| align="center" | X
 
| align="center" | X
 
 
|-
 
|-
 
| [http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlInlineBinaryData.html XmlInlineBinaryData]  
 
| [http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlInlineBinaryData.html XmlInlineBinaryData]  
Line 38: Line 24:
 
| align="center" | X
 
| align="center" | X
 
|}
 
|}
 
 
== Example: XmlAttachmentRef annotation ==
 
 
=== Java Metadata  ===
 
 
The following example will demonstrate how the [http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlAttachmentRef.html XmlAttachmentRef] annotation can be applied:
 
 
==== org.example.AttTypes.java  ====
 
 
<source lang="java">
 
package org.example;
 
 
@javax.xml.bind.annotation.XmlRootElement(name="att-types")
 
public class AttTypes {
 
    @javax.xml.bind.annotation.XmlAttachmentRef
 
    @javax.xml.bind.annotation.XmlAttribute
 
    DataHandler data;
 
 
    @javax.xml.bind.annotation.XmlAttachmentRef
 
    @javax.xml.bind.annotation.XmlElement
 
    DataHandler body;
 
}
 
</source>
 
 
=== XML Metadata  ===
 
 
==== xml-attachment-ref  ====
 
 
If this is present in the XML then it completely replaces the corresponding annotation.
 
 
==== org/example/eclipselink-oxm.xml  ====
 
 
This XML file represents metadata overrides for the "org.example.AttTypes" class.
 
 
<source lang="xml">
 
<?xml version="1.0" encoding="US-ASCII"?>
 
<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm">
 
    <java-types>
 
        <java-type name="org.example.AttTypes">
 
            <xml-root-element name="att-types"/>
 
            <java-attributes>
 
                <xml-attribute java-attribute="data" xml-attachment-ref="true" />
 
                <xml-element java-attribute="body" xml-attachment-ref="true" />
 
            </java-attributes>
 
        </java-type>
 
    </java-types>
 
</xml-bindings>
 
</source>
 
 
== Example: XmlMimeType annotation ==
 
 
=== Java Metadata  ===
 
 
The following example will demonstrate how the [http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlMimeType.html XmlMimeType] annotation can be applied:
 
 
==== org.example.AttTypes.java  ====
 
 
<source lang="java">
 
package org.example;
 
 
@javax.xml.bind.annotation.XmlRootElement(name="att-types")
 
public class AttTypes {
 
    @javax.xml.bind.annotation.XmlMimeType("text/plain")
 
    public byte[] b;
 
    @javax.xml.bind.annotation.XmlMimeType("application/binary")
 
    public DataHandler d;
 
    @javax.xml.bind.annotation.XmlMimeType("text/xml")
 
    public Source s;
 
    @javax.xml.bind.annotation.XmlMimeType("image/jpeg")
 
    public Image i;
 
}
 
</source>
 
 
=== XML Metadata  ===
 
 
==== xml-mime-type  ====
 
 
If this is present in the XML then it completely replaces the corresponding annotation.
 
 
==== org/example/eclipselink-oxm.xml  ====
 
 
This XML file represents metadata overrides for the "org.example.AttTypes" class.
 
 
<source lang="xml">
 
<?xml version="1.0" encoding="US-ASCII"?>
 
<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm">
 
    <java-types>
 
        <java-type name="org.example.AttTypes">
 
            <java-attributes>
 
                <xml-element java-attribute="b" xml-mime-type="text/plain" />
 
                <xml-element java-attribute="d" xml-mime-type="application/binary" />
 
                <xml-element java-attribute="s" xml-mime-type="text/xml" />
 
                <xml-element java-attribute="i" xml-mime-type="image/jpeg" />
 
            </java-attributes>
 
        </java-type>
 
    </java-types>
 
</xml-bindings>
 
</source>
 

Revision as of 11:17, 19 November 2009

Phase 9 - Attachments (part 2; page under construction)

Provide support for WebService attachments.

Annotations

The following annotations will be targetted in this phase:

Annotation XML Metadata Tag Package Type Field Method
XmlInlineBinaryData xml-inline-binary-data   X X X

Back to the top