public class XMLCollectionReferenceMappingNodeValue extends MappingNodeValue implements ContainerValue
Purpose: Class to handle (un)marshal operations for XMLCollectionReferenceMappings.
An instance of this class is required for each XMLField set on the mapping, that is, for each source field in the source-target key field association list.
When unmarshalling, an instance of org.eclipse.persistence.internal.oxm.Reference is created on a per mapping basis (keyed on source object instance) and sorted on the associated session's org.eclipse.persistence.internal.oxm.ReferenceResolver instance. Each target primary key value is stored in the Reference instance for use during mapping resolution phase after unmarshalling completes.
When marshalling, the target object's primary key value that is mapped to this NodeValue's XMLField (in the XMLObjectReferenceMapping's source-target key field association list) is retrieved and written out.
Reference
,
ReferenceResolver
,
XMLObjectReferenceMapping
Constructor and Description |
---|
XMLCollectionReferenceMappingNodeValue(CollectionReferenceMapping xmlCollectionReferenceMapping,
Field xmlField)
This constructor sets the XMLCollectionReferenceMapping and XMLField members to
the provided values.
|
Modifier and Type | Method and Description |
---|---|
void |
attribute(UnmarshalRecord unmarshalRecord,
java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String value)
Handle attribute operation.
|
void |
endElement(XPathFragment xPathFragment,
UnmarshalRecord unmarshalRecord)
Handle endElement operation.
|
void |
endElement(XPathFragment xPathFragment,
UnmarshalRecord unmarshalRecord,
java.lang.Object container) |
java.lang.Object |
getContainerInstance() |
CoreContainerPolicy |
getContainerPolicy() |
int |
getIndex()
INTERNAL:
Set to track the index of the corresponding containerInstance in the containerInstances Object[] on UnmarshalRecord
Set during TreeObjectBuilder initialization
|
CollectionReferenceMapping |
getMapping()
Return the mapping associated with this node value.
|
boolean |
getReuseContainer()
Return true if the original container on the object should be used if
present.
|
boolean |
isContainerValue()
INTERNAL:
|
boolean |
isDefaultEmptyContainer()
INTERNAL
Return true if an empty container should be set on the object if there
is no presence of the collection in the XML document.
|
boolean |
isMarshalNodeValue() |
boolean |
isOwningNode(XPathFragment xPathFragment)
Indicate if the next XPathFragment is an attribute or text() node.
|
boolean |
isWrapperAllowedAsCollectionName()
For media types that provide a native representation of collections (such
as JSON arrays), can the representation be simplified so that the
grouping element can be used as the collection name.
|
boolean |
marshal(XPathFragment xPathFragment,
MarshalRecord marshalRecord,
java.lang.Object object,
CoreAbstractSession session,
NamespaceResolver namespaceResolver)
Handle the marshal operation for this NodeValue.
|
boolean |
marshalSingleValue(XPathFragment xPathFragment,
MarshalRecord marshalRecord,
java.lang.Object object,
java.lang.Object value,
CoreAbstractSession session,
NamespaceResolver namespaceResolver,
MarshalContext marshalContext)
INTERNAL:
This method provides an optimization in cases where the value has already
been calculated.
|
void |
setContainerInstance(java.lang.Object object,
java.lang.Object containerInstance) |
void |
setIndex(int index)
INTERNAL:
Used to track the index of the corresponding containerInstance in the containerInstances Object[] on UnmarshalRecord
|
boolean |
startElement(XPathFragment xPathFragment,
UnmarshalRecord unmarshalRecord,
org.xml.sax.Attributes atts)
INTERNAL:
|
isMappingNodeValue
buildSelfRecord, endSelfNodeValue, getXPathNode, isAnyMappingNodeValue, isMarshalOnlyNodeValue, isMixedContentNodeValue, isNullCapableValue, isUnmarshalNodeValue, isWhitespaceAware, isWrapperNodeValue, marshal, marshal, marshal, marshalSelfAttributes, marshalSingleValue, setXPathNode
public XMLCollectionReferenceMappingNodeValue(CollectionReferenceMapping xmlCollectionReferenceMapping, Field xmlField)
xmlCollectionReferenceMapping
- public void attribute(UnmarshalRecord unmarshalRecord, java.lang.String namespaceURI, java.lang.String localName, java.lang.String value)
public void endElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord)
endElement
in class NodeValue
public void endElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord, java.lang.Object container)
endElement
in class NodeValue
public boolean isOwningNode(XPathFragment xPathFragment)
isOwningNode
in class NodeValue
public boolean isWrapperAllowedAsCollectionName()
ContainerValue
isWrapperAllowedAsCollectionName
in interface ContainerValue
public boolean isContainerValue()
NodeValue
isContainerValue
in class NodeValue
ContainerValue
public java.lang.Object getContainerInstance()
getContainerInstance
in interface ContainerValue
public void setContainerInstance(java.lang.Object object, java.lang.Object containerInstance)
setContainerInstance
in interface ContainerValue
public CoreContainerPolicy getContainerPolicy()
getContainerPolicy
in interface ContainerValue
public boolean marshal(XPathFragment xPathFragment, MarshalRecord marshalRecord, java.lang.Object object, CoreAbstractSession session, NamespaceResolver namespaceResolver)
public boolean startElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord, org.xml.sax.Attributes atts)
NodeValue
startElement
in class NodeValue
xPathFragment
- unmarshalRecord
- atts
- public boolean marshalSingleValue(XPathFragment xPathFragment, MarshalRecord marshalRecord, java.lang.Object object, java.lang.Object value, CoreAbstractSession session, NamespaceResolver namespaceResolver, MarshalContext marshalContext)
NodeValue
marshalSingleValue
in interface ContainerValue
marshalSingleValue
in class NodeValue
public CollectionReferenceMapping getMapping()
MappingNodeValue
getMapping
in interface ContainerValue
getMapping
in class MappingNodeValue
public boolean getReuseContainer()
ContainerValue
getReuseContainer
in interface ContainerValue
public boolean isMarshalNodeValue()
isMarshalNodeValue
in class NodeValue
public void setIndex(int index)
setIndex
in interface ContainerValue
public int getIndex()
getIndex
in interface ContainerValue
public boolean isDefaultEmptyContainer()
isDefaultEmptyContainer
in interface ContainerValue
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference