Top Description Fields Constructors Methods
org.eclipse.persistence.oxm.mappings

public Class XMLBinaryDataCollectionMapping

extends XMLCompositeDirectCollectionMapping
implements BinaryDataCollectionMapping<AbstractSession, AttributeAccessor, ContainerPolicy, Converter, ClassDescriptor, DatabaseField, XMLMarshaller, MimeTypePolicy, Session, XMLUnmarshaller, XMLRecord>
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping, org.eclipse.persistence.internal.oxm.mappings.XMLConverterMapping, org.eclipse.persistence.internal.oxm.mappings.XMLContainerMapping, org.eclipse.persistence.internal.oxm.mappings.Mapping
Imports
java.util.Enumeration, .Vector, jakarta.activation.DataHandler, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.exceptions.XMLMarshalException, org.eclipse.persistence.internal.helper.ClassConstants, .DatabaseField, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.oxm.XMLBinaryDataHelper, .XMLConversionManager, org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping, org.eclipse.persistence.internal.queries.ContainerPolicy, .JoinedAttributeManager, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, org.eclipse.persistence.mappings.AttributeAccessor, org.eclipse.persistence.mappings.converters.Converter, org.eclipse.persistence.oxm.NamespaceResolver, .XMLConstants, .XMLDescriptor, .XMLField, .XMLMarshaller, .XMLUnmarshaller, org.eclipse.persistence.oxm.mappings.nullpolicy.AbstractNullPolicy, .XMLNullRepresentationType, org.eclipse.persistence.oxm.record.DOMRecord, .XMLRecord, org.eclipse.persistence.queries.ObjectBuildingQuery, org.eclipse.persistence.sessions.Session, org.w3c.dom.Element, .Node

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

Since
TopLink 11.1.1.0.0g
See Also
org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller, org.eclipse.persistence.oxm.attachment.XMLAttachmentUnmarshaller, org.eclipse.persistence.oxm.mappings.MimeTypePolicy

Field Summary

Modifier and TypeField and Description
private Class<?>
private static final String
private boolean
private MimeTypePolicy
private boolean
Inherited from org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping:
nullValuereuseContainer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Class<?>
public Class<?>
public String
public String
public MimeTypePolicy
public Object
getValueToWrite(Object value, Object parent, XMLRecord record, XMLField field, XMLField includeField, AbstractSession session)

public boolean
public boolean
public void
public void
public void
setMimeType(String mimeTypeString)

Force mapping to set default FixedMimeTypePolicy using the MimeType string as argument

public void
setMimeTypePolicy(MimeTypePolicy
MimeTypePolicy
mimeTypePolicy
)

Implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping.setMimeTypePolicy.

Allow implementer to set the MimeTypePolicy class FixedMimeTypePolicy or AttributeMimeTypePolicy (dynamic)
public void
public void
public void
public boolean
public Object
valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery query, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed)

Overrides org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping.valueFromRow.

INTERNAL: Build the nested collection from the database row.
public void
public void
writeSingleValue(Object
- The value to be marshalled
value
,
Object parent, XMLRecord
- The Record the value is being marshalled too.
record
,
AbstractSession session)

Overrides org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping.writeSingleValue.

Implements org.eclipse.persistence.internal.oxm.mappings.Mapping.writeSingleValue, org.eclipse.persistence.oxm.mappings.XMLMapping.writeSingleValue.

INTERNAL: A method that marshals a single value to the provided Record based on this mapping's XPath.
Inherited from org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping:
convertDataValueToObjectValueconvertObjectValueToDataValuegetNullPolicygetNullValuegetReuseContainergetWrapperNullPolicygetXPathinitializeisCDATAisCollapsingStringValuesisDefaultEmptyContainerisNormalizingStringValuesisWriteOnlyisXMLMappingpreInitializesetAttributeValueInObjectsetCollapsingStringValuessetDefaultEmptyContainersetIsCDATAsetIsWriteOnlysetNormalizingStringValuessetNullPolicysetNullValuesetReuseContainersetWrapperNullPolicyuseCollectionClassName

Field Detail

collectionContentTypeback to summary
private Class<?> collectionContentType
INCLUDEback to summary
private static final String INCLUDE
isSwaRefback to summary
private boolean isSwaRef
mimeTypePolicyback to summary
private MimeTypePolicy mimeTypePolicy
shouldInlineBinaryDataback to summary
private boolean shouldInlineBinaryData

Constructor Detail

XMLBinaryDataCollectionMappingback to summary
public XMLBinaryDataCollectionMapping()

Method Detail

getAttributeElementClassback to summary
public Class<?> getAttributeElementClass()

Overrides org.eclipse.persistence.mappings.foundation.AbstractCompositeDirectCollectionMapping.getAttributeElementClass.

Implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping.getAttributeElementClass, org.eclipse.persistence.internal.oxm.mappings.DirectCollectionMapping.getAttributeElementClass.

Doc from org.eclipse.persistence.internal.oxm.mappings.DirectCollectionMapping.getAttributeElementClass.

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.

Annotations
@Override
getCollectionContentTypeback to summary
public Class<?> getCollectionContentType()
getMimeTypeback to summary
public String getMimeType(Object anObject)

Implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping.getMimeType.

INTERNAL

Annotations
@Override
getMimeTypeback to summary
public String getMimeType()

Implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping.getMimeType.

INTERNAL

Annotations
@Override
getMimeTypePolicyback to summary
public MimeTypePolicy getMimeTypePolicy()

Implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping.getMimeTypePolicy.

Annotations
@Override
getValueToWriteback to summary
public Object getValueToWrite(Object value, Object parent, XMLRecord record, XMLField field, XMLField includeField, AbstractSession session)
isAbstractCompositeDirectCollectionMappingback to summary
public boolean isAbstractCompositeDirectCollectionMapping()

Overrides org.eclipse.persistence.mappings.foundation.AbstractCompositeDirectCollectionMapping.isAbstractCompositeDirectCollectionMapping.

Implements org.eclipse.persistence.internal.oxm.mappings.Mapping.isAbstractCompositeDirectCollectionMapping.

Doc from org.eclipse.persistence.internal.oxm.mappings.Mapping.isAbstractCompositeDirectCollectionMapping.

Related mapping should implement this method to return true.

Returns:boolean

Doc from org.eclipse.persistence.core.mappings.CoreMapping.isAbstractCompositeDirectCollectionMapping.

TODO

Annotations
@Override
isSwaRefback to summary
public boolean isSwaRef()

Implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping.isSwaRef.

Annotations
@Override
setAttributeElementClassback to summary
public void setAttributeElementClass(Class<?> attributeElementClass)

Overrides org.eclipse.persistence.mappings.foundation.AbstractCompositeDirectCollectionMapping.setAttributeElementClass.

Implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping.setAttributeElementClass, org.eclipse.persistence.internal.oxm.mappings.DirectCollectionMapping.setAttributeElementClass.

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.

Annotations
@Override
setCollectionContentTypeback to summary
public void setCollectionContentType(Class<?> javaClass)
setMimeTypeback to summary
public void setMimeType(String mimeTypeString)

Force mapping to set default FixedMimeTypePolicy using the MimeType string as argument

setMimeTypePolicyback to summary
public void setMimeTypePolicy(MimeTypePolicy mimeTypePolicy)

Implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping.setMimeTypePolicy.

Allow implementer to set the MimeTypePolicy class FixedMimeTypePolicy or AttributeMimeTypePolicy (dynamic)

Parameters
mimeTypePolicy:MimeTypePolicy

MimeTypePolicy

Annotations
@Override
setShouldInlineBinaryDataback to summary
public void setShouldInlineBinaryData(boolean b)

Implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping.setShouldInlineBinaryData.

Annotations
@Override
setSwaRefback to summary
public void setSwaRef(boolean swaRef)

Implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping.setSwaRef.

Annotations
@Override
setXPathback to summary
public void setXPath(String xpathString)

Overrides org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping.setXPath.

Implements org.eclipse.persistence.internal.oxm.mappings.DirectCollectionMapping.setXPath.

Set the Mapping field name attribute to the given XPath String

Parameters
xpathString:String

String

Annotations
@Override
shouldInlineBinaryDataback to summary
public boolean shouldInlineBinaryData()

Implements org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping.shouldInlineBinaryData.

Annotations
@Override
valueFromRowback to summary
public Object valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery query, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed)

Overrides org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping.valueFromRow.

Doc from org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping.valueFromRow.

INTERNAL: Build the nested collection from the database row.

Annotations
@Override
writeFromObjectIntoRowback to summary
public void writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping.WriteType writeType)

Overrides org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping.writeFromObjectIntoRow.

Doc from org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping.writeFromObjectIntoRow.

INTERNAL:

Annotations
@Override
writeSingleValueback to summary
public void writeSingleValue(Object value, Object parent, XMLRecord record, AbstractSession session)

Overrides org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping.writeSingleValue.

Implements org.eclipse.persistence.internal.oxm.mappings.Mapping.writeSingleValue, org.eclipse.persistence.oxm.mappings.XMLMapping.writeSingleValue.

Doc from org.eclipse.persistence.oxm.mappings.XMLMapping.writeSingleValue.

INTERNAL: A method that marshals a single value to the provided Record based on this mapping's XPath. Used for Sequenced marshalling.

Parameters
value:Object

- The value to be marshalled

record:XMLRecord

- The Record the value is being marshalled too.

Annotations
@Override