Purpose:Provide a mapping for a collection of binary data values that can be treated as either inline binary values or as an attachment.
Responsibilities:
XMLBinaryDataCollectionMapping represents a mapping of a collection 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 types 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 Class | |
| private static final String | |
| private boolean | |
| private MimeTypePolicy | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| collectionContentType | back to summary |
|---|---|
| private Class<?> collectionContentType | |
| 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 | |
| XMLBinaryDataCollectionMapping | back to summary |
|---|---|
| public XMLBinaryDataCollectionMapping() | |
| getAttributeElementClass | back to summary |
|---|---|
| public Class Implements org. Doc from org. Return the class each element in the object's collection should be converted to, before the collection is inserted into the object. This is optional - if left null, the elements will be added to the object's collection unconverted.
| |
| getCollectionContentType | back to summary |
|---|---|
| public Class | |
| 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() Implements org.
| |
| getValueToWrite | back to summary |
|---|---|
| public Object getValueToWrite(Object value, Object parent, XMLRecord record, XMLField field, XMLField includeField, AbstractSession session) | |
| isAbstractCompositeDirectCollectionMapping | back to summary |
|---|---|
| public boolean isAbstractCompositeDirectCollectionMapping() Implements org. Doc from org. Related mapping should implement this method to return true.
| |
| isSwaRef | back to summary |
|---|---|
| public boolean isSwaRef() Implements org.
| |
| setAttributeElementClass | back to summary |
|---|---|
| public void setAttributeElementClass(Class<?> attributeElementClass) Implements org. PUBLIC: Set the class each element in the object's collection should be converted to, before the collection is inserted into the object. This is optional - if left null, the elements will be added to the object's collection unconverted.
| |
| setCollectionContentType | back to summary |
|---|---|
| public void setCollectionContentType(Class<?> javaClass) | |
| setMimeType | back to summary |
|---|---|
| public void setMimeType(String mimeTypeString) Force mapping to set default FixedMimeTypePolicy using the MimeType string as argument | |
| setMimeTypePolicy | back to summary |
|---|---|
| public void setMimeTypePolicy(MimeTypePolicy mimeTypePolicy) 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: Build the nested collection from the database row.
| |
| writeFromObjectIntoRow | back to summary |
|---|---|
| public void writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping. Overrides org. Doc from org. INTERNAL:
| |
| writeSingleValue | back to summary |
|---|---|
| public void writeSingleValue(Object value, 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. | |