Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EclipseLink/DesignDocs/293925/Phase9
< EclipseLink | DesignDocs | 293925
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 |
Example: Class-level XmlInlineBinaryData Annotation
Java Metadata
The following example will demonstrate how the XmlInlineBinaryData annotation can be applied at the class level:
org.example.MyData.java
package org.example; @javax.xml.bind.annotation.XmlInlineBinaryData @javax.xml.bind.annotation.XmlRootElement(name="my-data") public class MyData { private DataHandler myDataHandler; public byte[] bytes; public DataHandler getData() { return myDataHandler; } public void setData(DataHandler data) { myDataHandler = data; } }
XML Metadata
xml-inline-binary-data
If this is present in XML, the corresponding annotation will be ignored, and the true/false value set in XML used instead.
org/example/eclipselink-oxm.xml
This XML file represents metadata overrides for the "org.example" package.
<?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.MyData" xml-inline-binary-data="true"> <xml-root-element name="my-data"/> </java-type> </java-types> </xml-bindings>