Purpose:Provide a mapping for binary data that can be treated as either inline or as an attachment.
Responsibilities:
XMLBinaryDataMapping represents a mapping of binary data in the object model to XML. This can either be written directly as inline binary data (base64) or passed through as an MTOM or SWAREF attachment.
The following typed are allowable to be mapped using an XMLBinaryDataMapping:
Setting the XPath: TopLink XML mappings make use of XPath statements to find the relevant
data in an XML document. The XPath statement is relative to the context node specified in the descriptor.
The XPath may contain path and positional information; the last node in the XPath forms the local
node for the binary mapping. The XPath is specified on the mapping using the setXPath
method.
Inline Binary Data: Set this flag if you want to always inline binary data for this mapping. This will disable consideration for attachment handling for this mapping.
SwaRef: Set this flag in order to specify that the target node of this mapping is of type xs:swaref
org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller , org.eclipse.persistence.oxm.attachment.XMLAttachmentUnmarshaller , org.eclipse.persistence.oxm.mappings.MimeTypePolicy
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private boolean | |
| private MimeTypePolicy | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| include | back to summary |
|---|---|
| private static final String include | |
| isSwaRef | back to summary |
|---|---|
| private boolean isSwaRef | |
| mimeTypePolicy | back to summary |
|---|---|
| private MimeTypePolicy mimeTypePolicy | |
| shouldInlineBinaryData | back to summary |
|---|---|
| private boolean shouldInlineBinaryData | |
| XMLBinaryDataMapping | back to summary |
|---|---|
| public XMLBinaryDataMapping() | |
| getMimeType | back to summary |
|---|---|
| public String getMimeType(Object anObject) Implements org. INTERNAL
| |
| getMimeType | back to summary |
|---|---|
| public String getMimeType() Implements org. INTERNAL
| |
| getMimeTypePolicy | back to summary |
|---|---|
| public MimeTypePolicy getMimeTypePolicy() | |
| isAbstractColumnMapping | back to summary |
|---|---|
| public boolean isAbstractColumnMapping() Overrides org. Doc from org. INTERNAL:
| |
| isAbstractDirectMapping | back to summary |
|---|---|
| public boolean isAbstractDirectMapping() Overrides org. Implements org. Doc from org. Related mapping should implement this method to return true.
| |
| isSwaRef | back to summary |
|---|---|
| public boolean isSwaRef() Implements org.
| |
| setMimeType | back to summary |
|---|---|
| public void setMimeType(String mimeTypeString) Implements org. Force mapping to set default FixedMimeTypePolicy using the MimeType string as argument
| |
| setMimeTypePolicy | back to summary |
|---|---|
| public void setMimeTypePolicy(MimeTypePolicy aPolicy) Implements org. Allow implementer to set the MimeTypePolicy class FixedMimeTypePolicy or AttributeMimeTypePolicy (dynamic)
| |
| setShouldInlineBinaryData | back to summary |
|---|---|
| public void setShouldInlineBinaryData(boolean b) Implements org.
| |
| setSwaRef | back to summary |
|---|---|
| public void setSwaRef(boolean swaRef) Implements org.
| |
| setXPath | back to summary |
|---|---|
| public void setXPath(String xpathString) Overrides org. Implements org. Set the Mapping field name attribute to the given XPath String | |
| shouldInlineBinaryData | back to summary |
|---|---|
| public boolean shouldInlineBinaryData() Implements org.
| |
| valueFromRow | back to summary |
|---|---|
| public Object valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery query, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed) Overrides org. Doc from org. INTERNAL: Return the mapping's attribute value from the row. The execution session is passed for the case of building a UnitOfWork clone directly from a row, the session set in the query will not know which platform to use for converting the value. Allows the correct session to be passed in.
| |
| writeFromObjectIntoRow | back to summary |
|---|---|
| public void writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping. Overrides org. Doc from org. INTERNAL: Get a value from the object and set that in the respective field of the row.
| |
| writeSingleValue | back to summary |
|---|---|
| public void writeSingleValue(Object attributeValue, Object parent, XMLRecord record, AbstractSession session) Overrides org. Implements org. Doc from org. INTERNAL: A method that marshals a single value to the provided Record based on this mapping's XPath. Used for Sequenced marshalling. | |