- java.lang.Object
-
- org.eclipse.persistence.internal.core.sessions.CoreAbstractRecord
-
- org.eclipse.persistence.internal.sessions.AbstractRecord
-
- org.eclipse.persistence.oxm.record.XMLRecord
-
- org.eclipse.persistence.oxm.record.DOMRecord
-
- All Implemented Interfaces:
Serializable,Cloneable,Map,org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,NamespaceResolver>,org.eclipse.persistence.internal.oxm.record.AbstractUnmarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.helper.DatabaseField,XMLUnmarshaller>,org.eclipse.persistence.internal.oxm.record.TransformationRecord,org.eclipse.persistence.internal.oxm.record.XMLRecord<org.eclipse.persistence.internal.sessions.AbstractSession>,DataRecord
- Direct Known Subclasses:
EISDOMRecord
public class DOMRecord extends XMLRecord implements org.eclipse.persistence.internal.oxm.record.TransformationRecord
PUBLIC: Provides a Record/Map API on an XML DOM element.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.internal.sessions.AbstractRecord
org.eclipse.persistence.internal.sessions.AbstractRecord.EntrySet, org.eclipse.persistence.internal.sessions.AbstractRecord.KeySet, org.eclipse.persistence.internal.sessions.AbstractRecord.NoEntry, org.eclipse.persistence.internal.sessions.AbstractRecord.RecordEntry, org.eclipse.persistence.internal.sessions.AbstractRecord.RecordEntryIterator, org.eclipse.persistence.internal.sessions.AbstractRecord.RecordKeyIterator, org.eclipse.persistence.internal.sessions.AbstractRecord.RecordValuesIterator, org.eclipse.persistence.internal.sessions.AbstractRecord.ValuesSet
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.oxm.record.XMLRecord
currentObject, equalNamespaceResolvers, hasCustomNamespaceMapper, NIL, session, unmarshaller
-
-
Constructor Summary
Constructors Constructor Description DOMRecord()INTERNAL: Default constructor.DOMRecord(String rootElementName)INTERNAL: Create a record with the root element name.DOMRecord(String rootElementName, String rootElementNamespaceURI)INTERNAL: Create a record with the root element name get the namespace URI from the namespaceResolver.DOMRecord(String rootElementName, NamespaceResolver namespaceResolver)INTERNAL: Create a record with the root element name get the namespace URI from the namespaceResolver.DOMRecord(String localRootElementName, NamespaceResolver namespaceResolver, Node parent)INTERNAL: Create a record with the local root element name, that is a child of the parent.DOMRecord(String localRootElementName, Node parent)INTERNAL: Create a record with the local root element name, that is a child of the parent.DOMRecord(Document document)INTERNAL: Create a record with the element.DOMRecord(Element element)INTERNAL: Create a record with the element.DOMRecord(Node node)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(org.eclipse.persistence.internal.helper.DatabaseField key, Object value)INTERNAL: Add the field-value pair to the document.XMLRecordbuildNestedRow(Element element)INTERNAL: Build the nested record, this can be overwriten by subclasses to use their subclass instance.voidclear()PUBLIC: Clear the sub-nodes of the DOM.DOMRecordclone()INTERNAL: Clone the row and its values.booleancontains(Object value)PUBLIC: Check if the value is contained in the row.booleancontainsKey(org.eclipse.persistence.internal.helper.DatabaseField key)INTERNAL: Check if the field is contained in the row.NodecreateNewDocument(String defaultRootElementName)INTERNAL: Creates a new Document and returns the root element of that documentNodecreateNewDocument(String defaultRootElementName, String namespaceURI)INTERNAL: Creates a new Document and returns the root element of that documentSetentrySet()PUBLIC:Objectget(org.eclipse.persistence.internal.helper.DatabaseField key)INTERNAL: Retrieve the value for the field.DocumentgetDocument()PUBLIC: Return the document.NodegetDOM()PUBLIC: Return the DOM.VectorgetFields()INTERNAL: This should not be used, but added some support for it as is called from some places such as sdk call used in the descriptor to define operation not supported, may also be called from toplin in some places.ObjectgetIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key)INTERNAL: Given a DatabaseField return the corresponding value from the documentObjectgetIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNode)ObjectgetIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNode, boolean checkForXsiNil)StringgetLocalName()PUBLIC: Get the local name of the context root element.StringgetNamespaceURI()PUBLIC: Get the namespace URI for the context root element.org.eclipse.persistence.internal.oxm.ReferenceResolvergetReferenceResolver()INTERNAL: The ReferenceResolver that is leveraged by key based mappings.VectorgetValues()INTERNAL: This should not be used, but added some support for it as is called from some places such as sdk call used in the descriptor to define operation not supported, may also be called from TopLink in some places.ObjectgetValues(String key)INTERNAL: Retrieve the value for the field name.ObjectgetValues(org.eclipse.persistence.internal.helper.DatabaseField key)INTERNAL: Given a DatabaseField, return the corresponding values from the documentObjectgetValues(org.eclipse.persistence.internal.helper.DatabaseField key, AbstractNullPolicy nullPolicy)List<XMLEntry>getValuesIndicatingNoEntry(List<org.eclipse.persistence.internal.helper.DatabaseField> keys)List<XMLEntry>getValuesIndicatingNoEntry(List<org.eclipse.persistence.internal.helper.DatabaseField> keys, boolean shouldReturnNodes)ObjectgetValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key)ObjectgetValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNodes)INTERNAL: Given a DatabaseField, return the corresponding values from the documentObjectgetValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNodes, AbstractNullPolicy nullPolicy)ObjectgetValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, AbstractNullPolicy nullPolicy)SetkeySet()PUBLIC: Return the set of element names from the DOM.Objectput(Object key, Object value)PUBLIC: Add the field-value pair to the row.Objectput(List<XMLField> xmlFields, List<XMLEntry> values)Objectput(org.eclipse.persistence.internal.helper.DatabaseField key, Object value)INTERNAL: Set the field value into the DOM.Objectremove(org.eclipse.persistence.internal.helper.DatabaseField key)INTERNAL: Remove the field key from the row.voidreplaceAt(Object value, int index)INTERNAL: replaces the value at index with valueStringresolveNamespacePrefix(String prefix)voidresolveReferences(org.eclipse.persistence.internal.core.sessions.CoreAbstractSession abstractSession, IDResolver idResolver)INTERNAL: If the UnmarshalRecord has a ReferenceResolver, tell it to resolve its references.voidsetDOM(Element element)voidsetDOM(Node element)INTERNAL: Sets the dom and updated document to be the owner document of the given elementprotected voidsetFields(Vector fields)INTERNAL: Setting fields vector will not update the document so this is not supportedvoidsetReferenceResolver(org.eclipse.persistence.internal.oxm.ReferenceResolver referenceResolver)INTERNAL: Set the ReferenceResolver that will be leveraged by key based mappings.voidsetSession(org.eclipse.persistence.internal.sessions.AbstractSession session)protected voidsetValues(Vector values)INTERNAL: Setting values vector will not update the document so this is not supportedintsize()Return the number of elements in the DOM.StringtoString()INTERNAL: Print the dom XML string.voidtransformFromXML(Reader reader)Set the XML from an XML reader.voidtransformFromXML(String xml)Set the XML from an XML string.voidtransformToWriter(Writer writer)Write the XML string representation of the DOM.StringtransformToXML()Return the XML string representation of the DOM.Collectionvalues()PUBLIC: Return the collection of element values from the DOM.-
Methods inherited from class org.eclipse.persistence.oxm.record.XMLRecord
addExtraNamespacesToNamespaceResolver, addXsiTypeAndClassIndicatorIfRequired, addXsiTypeAndClassIndicatorIfRequired, attribute, attributeWithoutQName, convertToXMLField, convertToXMLField, get, getConversionManager, getCurrentObject, getDocPresPolicy, getIndicatingNoEntry, getLeafElementType, getMarshaller, getNamespaceResolver, getNamespaceSeparator, getOwningObject, getSession, getUnmarshaller, hasCustomNamespaceMapper, hasEqualNamespaceResolvers, isNamespaceAware, isXOPPackage, namespaceDeclaration, put, removeExtraNamespacesFromNamespaceResolver, setCurrentObject, setCustomNamespaceMapper, setDocPresPolicy, setEqualNamespaceResolvers, setLeafElementType, setLeafElementType, setMarshaller, setNamespaceResolver, setOwningObject, setUnmarshaller, setXOPPackage, writeXsiTypeAttribute, writeXsiTypeAttribute
-
Methods inherited from class org.eclipse.persistence.internal.sessions.AbstractRecord
containsKey, containsKey, containsValue, elements, get, getField, getLookupField, getSopObject, hasNullValueInFields, hasSopObject, isEmpty, keys, mergeFrom, putAll, remove, remove, replaceAt, resetSize, setNullValueInFields, setSopObject
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
DOMRecord
public DOMRecord()
INTERNAL: Default constructor.
-
DOMRecord
public DOMRecord(String rootElementName)
INTERNAL: Create a record with the root element name.
-
DOMRecord
public DOMRecord(String rootElementName, NamespaceResolver namespaceResolver)
INTERNAL: Create a record with the root element name get the namespace URI from the namespaceResolver.
-
DOMRecord
public DOMRecord(String rootElementName, String rootElementNamespaceURI)
INTERNAL: Create a record with the root element name get the namespace URI from the namespaceResolver.
-
DOMRecord
public DOMRecord(String localRootElementName, Node parent)
INTERNAL: Create a record with the local root element name, that is a child of the parent.
-
DOMRecord
public DOMRecord(String localRootElementName, NamespaceResolver namespaceResolver, Node parent)
INTERNAL: Create a record with the local root element name, that is a child of the parent. Lookup the namespace URI from the namespaceResolver.
-
DOMRecord
public DOMRecord(Element element)
INTERNAL: Create a record with the element.
-
DOMRecord
public DOMRecord(Node node)
-
DOMRecord
public DOMRecord(Document document)
INTERNAL: Create a record with the element.
-
-
Method Detail
-
getLocalName
public String getLocalName()
PUBLIC: Get the local name of the context root element.- Specified by:
getLocalNamein classXMLRecord
-
getNamespaceURI
public String getNamespaceURI()
PUBLIC: Get the namespace URI for the context root element.- Specified by:
getNamespaceURIin classXMLRecord
-
getReferenceResolver
public org.eclipse.persistence.internal.oxm.ReferenceResolver getReferenceResolver()
INTERNAL: The ReferenceResolver that is leveraged by key based mappings.- Since:
- EclipseLink 2.5.0
-
setReferenceResolver
public void setReferenceResolver(org.eclipse.persistence.internal.oxm.ReferenceResolver referenceResolver)
INTERNAL: Set the ReferenceResolver that will be leveraged by key based mappings.- Since:
- EclipseLink 2.5.0
-
add
public void add(org.eclipse.persistence.internal.helper.DatabaseField key, Object value)INTERNAL: Add the field-value pair to the document.- Overrides:
addin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
clear
public void clear()
PUBLIC: Clear the sub-nodes of the DOM.
-
clone
public DOMRecord clone()
INTERNAL: Clone the row and its values.- Overrides:
clonein classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
createNewDocument
public Node createNewDocument(String defaultRootElementName)
INTERNAL: Creates a new Document and returns the root element of that document
-
createNewDocument
public Node createNewDocument(String defaultRootElementName, String namespaceURI)
INTERNAL: Creates a new Document and returns the root element of that document
-
getDocument
public Document getDocument()
PUBLIC: Return the document.- Specified by:
getDocumentin classXMLRecord
-
containsKey
public boolean containsKey(org.eclipse.persistence.internal.helper.DatabaseField key)
INTERNAL: Check if the field is contained in the row.- Overrides:
containsKeyin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
contains
public boolean contains(Object value)
PUBLIC: Check if the value is contained in the row.
-
get
public Object get(org.eclipse.persistence.internal.helper.DatabaseField key)
Description copied from class:XMLRecordINTERNAL: Retrieve the value for the field. If missing null is returned.- Specified by:
getin interfaceorg.eclipse.persistence.internal.oxm.record.AbstractUnmarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.helper.DatabaseField,XMLUnmarshaller>- Overrides:
getin classXMLRecord
-
getIndicatingNoEntry
public Object getIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key)
INTERNAL: Given a DatabaseField return the corresponding value from the document- Overrides:
getIndicatingNoEntryin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
getIndicatingNoEntry
public Object getIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNode)
-
getIndicatingNoEntry
public Object getIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNode, boolean checkForXsiNil)
-
getValues
public Object getValues(String key)
INTERNAL: Retrieve the value for the field name.- Overrides:
getValuesin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
getValues
public Object getValues(org.eclipse.persistence.internal.helper.DatabaseField key)
INTERNAL: Given a DatabaseField, return the corresponding values from the document- Overrides:
getValuesin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
getValues
public Object getValues(org.eclipse.persistence.internal.helper.DatabaseField key, AbstractNullPolicy nullPolicy)
-
getValuesIndicatingNoEntry
public Object getValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key)
-
getValuesIndicatingNoEntry
public Object getValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, AbstractNullPolicy nullPolicy)
-
getValuesIndicatingNoEntry
public List<XMLEntry> getValuesIndicatingNoEntry(List<org.eclipse.persistence.internal.helper.DatabaseField> keys)
-
getValuesIndicatingNoEntry
public List<XMLEntry> getValuesIndicatingNoEntry(List<org.eclipse.persistence.internal.helper.DatabaseField> keys, boolean shouldReturnNodes)
-
getValuesIndicatingNoEntry
public Object getValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNodes)
INTERNAL: Given a DatabaseField, return the corresponding values from the document
-
getValuesIndicatingNoEntry
public Object getValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNodes, AbstractNullPolicy nullPolicy)
-
buildNestedRow
public XMLRecord buildNestedRow(Element element)
INTERNAL: Build the nested record, this can be overwriten by subclasses to use their subclass instance.
-
getDOM
public Node getDOM()
PUBLIC: Return the DOM.- Specified by:
getDOMin interfaceorg.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,NamespaceResolver>- Specified by:
getDOMin classXMLRecord
-
put
public Object put(org.eclipse.persistence.internal.helper.DatabaseField key, Object value)
INTERNAL: Set the field value into the DOM. The field name must be a valid simple XPath expression.- Specified by:
putin interfaceorg.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,NamespaceResolver>- Overrides:
putin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
put
public Object put(Object key, Object value) throws ValidationException
Description copied from class:org.eclipse.persistence.internal.sessions.AbstractRecordPUBLIC: Add the field-value pair to the row.- Specified by:
putin interfaceMap- Specified by:
putin interfaceorg.eclipse.persistence.internal.oxm.record.TransformationRecord- Overrides:
putin classorg.eclipse.persistence.internal.sessions.AbstractRecord- Throws:
ValidationException
-
remove
public Object remove(org.eclipse.persistence.internal.helper.DatabaseField key)
INTERNAL: Remove the field key from the row.- Overrides:
removein classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
replaceAt
public void replaceAt(Object value, int index)
INTERNAL: replaces the value at index with value- Overrides:
replaceAtin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
entrySet
public Set entrySet()
PUBLIC:
-
setFields
protected void setFields(Vector fields) throws XMLMarshalException
INTERNAL: Setting fields vector will not update the document so this is not supported- Overrides:
setFieldsin classorg.eclipse.persistence.internal.sessions.AbstractRecord- Throws:
XMLMarshalException
-
getFields
public Vector getFields()
INTERNAL: This should not be used, but added some support for it as is called from some places such as sdk call used in the descriptor to define operation not supported, may also be called from toplin in some places.- Overrides:
getFieldsin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
getValues
public Vector getValues()
INTERNAL: This should not be used, but added some support for it as is called from some places such as sdk call used in the descriptor to define operation not supported, may also be called from TopLink in some places.- Overrides:
getValuesin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
setValues
protected void setValues(Vector values) throws XMLMarshalException
INTERNAL: Setting values vector will not update the document so this is not supported- Overrides:
setValuesin classorg.eclipse.persistence.internal.sessions.AbstractRecord- Throws:
XMLMarshalException
-
setDOM
public void setDOM(Node element)
INTERNAL: Sets the dom and updated document to be the owner document of the given element
-
setDOM
public void setDOM(Element element)
-
toString
public String toString()
INTERNAL: Print the dom XML string.- Overrides:
toStringin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
keySet
public Set keySet()
PUBLIC: Return the set of element names from the DOM.
-
values
public Collection values()
PUBLIC: Return the collection of element values from the DOM.
-
size
public int size()
Return the number of elements in the DOM.
-
transformFromXML
public void transformFromXML(String xml)
Set the XML from an XML string.
-
setSession
public void setSession(org.eclipse.persistence.internal.sessions.AbstractSession session)
- Specified by:
setSessionin interfaceorg.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,NamespaceResolver>- Overrides:
setSessionin classXMLRecord
-
transformFromXML
public void transformFromXML(Reader reader)
Set the XML from an XML reader.
-
transformToXML
public String transformToXML()
Return the XML string representation of the DOM.- Specified by:
transformToXMLin classXMLRecord
-
transformToWriter
public void transformToWriter(Writer writer)
Write the XML string representation of the DOM.
-
resolveNamespacePrefix
public String resolveNamespacePrefix(String prefix)
- Specified by:
resolveNamespacePrefixin interfaceorg.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.helper.DatabaseField,XMLMarshaller,NamespaceResolver>- Specified by:
resolveNamespacePrefixin interfaceorg.eclipse.persistence.internal.oxm.record.AbstractUnmarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.helper.DatabaseField,XMLUnmarshaller>- Overrides:
resolveNamespacePrefixin classXMLRecord
-
resolveReferences
public void resolveReferences(org.eclipse.persistence.internal.core.sessions.CoreAbstractSession abstractSession, IDResolver idResolver)INTERNAL: If the UnmarshalRecord has a ReferenceResolver, tell it to resolve its references.- Since:
- EclipseLink 2.5.0
-
-