Enable Jakarta XML Binding marshalling to optimize storage of binary data.
This API enables an efficient cooperative creation of optimized binary data formats between a Jakarta XML Binding marshalling process and a MIME-based package processor. A Jakarta XML Binding implementation marshals the root body of a MIME-based package, delegating the creation of referenceable MIME parts to the MIME-based package processor that implements this abstraction.
XOP processing is enabled when isXOPPackage() is true.
See addMtomAttachment(DataHandler, String, String) for details.
WS-I Attachment Profile 1.0 is supported by
addSwaRefAttachment(DataHandler) being called by the
marshaller for each Jakarta XML Binding property related to
{http://ws-i.org/profiles/basic/1.1/xsd}swaRef.
Marshaller#setAttachmentMarshaller(AttachmentMarshaller), XML-binary Optimized Packaging, WS-I Attachments Profile Version 1.0.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract String | Returns: a valid content-id URI (see RFC 2387) that identifies the attachment containingdata.
Otherwise, null if the attachment was not added and should instead be inlined in the message.represents the data to be attached. Must be non-null. data, String the namespace URI of the element that encloses the base64Binary data.
Can be empty but never null. elementNamespace, String The local name of the element. Always a non-null valid string. elementLocalName)Consider MIME content |
| public abstract String | Returns: content-id URI, cid, to the attachment containingdata or null if data should be inlined.represents the data to be attached. Must be non-null. The actual data region is
specified by data, int (data,offset,length) tuple.The offset within the array of the first byte to be read;
must be non-negative and no larger than array.length offset, int The number of bytes to be read from the given array;
must be non-negative and no larger than array.length length, String If the data has an associated MIME type known to Jakarta XML Binding, that is passed
as this parameter. If none is known, "application/octet-stream".
This parameter may never be null. mimeType, String the namespace URI of the element that encloses the base64Binary data.
Can be empty but never null. elementNamespace, String The local name of the element. Always a non-null valid string. elementLocalName)Consider binary |
| public abstract String | Returns: must be a valid URI used as cid. Must satisfy Conformance Requirement R2928 from WS-I Attachments Profile Version 1.0.represents the data to be attached. Must be non-null. data)Add MIME |
| public boolean | Returns: true when MIME context is a XOP Package.Read-only property that returns true if Jakarta XML Binding marshaller should enable XOP creation. |
| AttachmentMarshaller | back to summary |
|---|---|
| protected AttachmentMarshaller() Do-nothing constructor for the derived classes. | |
| addMtomAttachment | back to summary |
|---|---|
| public abstract String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName) Consider MIME content
This method is called by Jakarta XML Binding marshal process when
The method implementor determines whether
The caller of this method is required to meet the following constraint.
If the element infoset item containing
The
| |
| addMtomAttachment | back to summary |
|---|---|
| public abstract String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName) Consider binary Since content type is not known, the attachment's MIME content type must be set to "application/octet-stream".
The
| |
| addSwaRefAttachment | back to summary |
|---|---|
| public abstract String addSwaRefAttachment(DataHandler data) Add MIME This method is called by Jakarta XML Binding marshal process for each element/attribute typed as {http://ws-i.org/profiles/basic/1.1/xsd}swaRef. The MIME-based package processor implementing this method is responsible for attaching the specified data to a MIME attachment, and generating a content-id, cid, that uniquely identifies the attachment within the MIME-based package. Caller inserts the returned content-id, cid, into the XML content being marshalled.
| |
| isXOPPackage | back to summary |
|---|---|
| public boolean isXOPPackage() Read-only property that returns true if Jakarta XML Binding marshaller should enable XOP creation. This value must not change during the marshalling process. When this
value is true, the Marshaller.marshal() must throw IllegalStateException if this value is When this method returns true and during the marshal process
at least one call to
| |