Class DOMRecord
- 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:
java.io.Serializable,java.lang.Cloneable,java.util.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>,Record
- 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(java.lang.String rootElementName)INTERNAL: Create a record with the root element name.DOMRecord(java.lang.String rootElementName, java.lang.String rootElementNamespaceURI)INTERNAL: Create a record with the root element name get the namespace URI from the namespaceResolver.DOMRecord(java.lang.String rootElementName, NamespaceResolver namespaceResolver)INTERNAL: Create a record with the root element name get the namespace URI from the namespaceResolver.DOMRecord(java.lang.String localRootElementName, NamespaceResolver namespaceResolver, org.w3c.dom.Node parent)INTERNAL: Create a record with the local root element name, that is a child of the parent.DOMRecord(java.lang.String localRootElementName, org.w3c.dom.Node parent)INTERNAL: Create a record with the local root element name, that is a child of the parent.DOMRecord(org.w3c.dom.Document document)INTERNAL: Create a record with the element.DOMRecord(org.w3c.dom.Element element)INTERNAL: Create a record with the element.DOMRecord(org.w3c.dom.Node node)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(org.eclipse.persistence.internal.helper.DatabaseField key, java.lang.Object value)INTERNAL: Add the field-value pair to the document.XMLRecordbuildNestedRow(org.w3c.dom.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(java.lang.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.org.w3c.dom.NodecreateNewDocument(java.lang.String defaultRootElementName)INTERNAL: Creates a new Document and returns the root element of that documentorg.w3c.dom.NodecreateNewDocument(java.lang.String defaultRootElementName, java.lang.String namespaceURI)INTERNAL: Creates a new Document and returns the root element of that documentjava.util.SetentrySet()PUBLIC:java.lang.Objectget(org.eclipse.persistence.internal.helper.DatabaseField key)INTERNAL: Retrieve the value for the field.org.w3c.dom.DocumentgetDocument()PUBLIC: Return the document.org.w3c.dom.NodegetDOM()PUBLIC: Return the DOM.java.util.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.java.lang.ObjectgetIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key)INTERNAL: Given a DatabaseField return the corresponding value from the documentjava.lang.ObjectgetIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNode)java.lang.ObjectgetIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNode, boolean checkForXsiNil)java.lang.StringgetLocalName()PUBLIC: Get the local name of the context root element.java.lang.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.java.util.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.java.lang.ObjectgetValues(java.lang.String key)INTERNAL: Retrieve the value for the field name.java.lang.ObjectgetValues(org.eclipse.persistence.internal.helper.DatabaseField key)INTERNAL: Given a DatabaseField, return the corresponding values from the documentjava.lang.ObjectgetValues(org.eclipse.persistence.internal.helper.DatabaseField key, AbstractNullPolicy nullPolicy)java.util.List<XMLEntry>getValuesIndicatingNoEntry(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> keys)java.util.List<XMLEntry>getValuesIndicatingNoEntry(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> keys, boolean shouldReturnNodes)java.lang.ObjectgetValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key)java.lang.ObjectgetValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNodes)INTERNAL: Given a DatabaseField, return the corresponding values from the documentjava.lang.ObjectgetValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNodes, AbstractNullPolicy nullPolicy)java.lang.ObjectgetValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, AbstractNullPolicy nullPolicy)java.util.SetkeySet()PUBLIC: Return the set of element names from the DOM.java.lang.Objectput(java.lang.Object key, java.lang.Object value)java.lang.Objectput(java.util.List<XMLField> xmlFields, java.util.List<XMLEntry> values)java.lang.Objectput(org.eclipse.persistence.internal.helper.DatabaseField key, java.lang.Object value)INTERNAL: Set the field value into the DOM.java.lang.Objectremove(org.eclipse.persistence.internal.helper.DatabaseField key)INTERNAL: Remove the field key from the row.voidreplaceAt(java.lang.Object value, int index)INTERNAL: replaces the value at index with valuejava.lang.StringresolveNamespacePrefix(java.lang.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(org.w3c.dom.Element element)voidsetDOM(org.w3c.dom.Node element)INTERNAL: Sets the dom and updated document to be the owner document of the given elementprotected voidsetFields(java.util.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(java.util.Vector values)INTERNAL: Setting values vector will not update the document so this is not supportedintsize()Return the number of elements in the DOM.java.lang.StringtoString()INTERNAL: Print the dom XML string.voidtransformFromXML(java.io.Reader reader)Set the XML from an XML reader.voidtransformFromXML(java.lang.String xml)Set the XML from an XML string.voidtransformToWriter(java.io.Writer writer)Write the XML string representation of the DOM.java.lang.StringtransformToXML()Return the XML string representation of the DOM.java.util.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
-
-
-
-
Constructor Detail
-
DOMRecord
public DOMRecord()
INTERNAL: Default constructor.
-
DOMRecord
public DOMRecord(java.lang.String rootElementName)
INTERNAL: Create a record with the root element name.
-
DOMRecord
public DOMRecord(java.lang.String rootElementName, NamespaceResolver namespaceResolver)INTERNAL: Create a record with the root element name get the namespace URI from the namespaceResolver.
-
DOMRecord
public DOMRecord(java.lang.String rootElementName, java.lang.String rootElementNamespaceURI)INTERNAL: Create a record with the root element name get the namespace URI from the namespaceResolver.
-
DOMRecord
public DOMRecord(java.lang.String localRootElementName, org.w3c.dom.Node parent)INTERNAL: Create a record with the local root element name, that is a child of the parent.
-
DOMRecord
public DOMRecord(java.lang.String localRootElementName, NamespaceResolver namespaceResolver, org.w3c.dom.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(org.w3c.dom.Element element)
INTERNAL: Create a record with the element.
-
DOMRecord
public DOMRecord(org.w3c.dom.Node node)
-
DOMRecord
public DOMRecord(org.w3c.dom.Document document)
INTERNAL: Create a record with the element.
-
-
Method Detail
-
getLocalName
public java.lang.String getLocalName()
PUBLIC: Get the local name of the context root element.- Specified by:
getLocalNamein classXMLRecord
-
getNamespaceURI
public java.lang.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, java.lang.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 org.w3c.dom.Node createNewDocument(java.lang.String defaultRootElementName)
INTERNAL: Creates a new Document and returns the root element of that document
-
createNewDocument
public org.w3c.dom.Node createNewDocument(java.lang.String defaultRootElementName, java.lang.String namespaceURI)INTERNAL: Creates a new Document and returns the root element of that document
-
getDocument
public org.w3c.dom.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(java.lang.Object value)
PUBLIC: Check if the value is contained in the row.
-
get
public java.lang.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 java.lang.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 java.lang.Object getIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNode)
-
getIndicatingNoEntry
public java.lang.Object getIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNode, boolean checkForXsiNil)
-
getValues
public java.lang.Object getValues(java.lang.String key)
INTERNAL: Retrieve the value for the field name.- Overrides:
getValuesin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
getValues
public java.lang.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 java.lang.Object getValues(org.eclipse.persistence.internal.helper.DatabaseField key, AbstractNullPolicy nullPolicy)
-
getValuesIndicatingNoEntry
public java.lang.Object getValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key)
-
getValuesIndicatingNoEntry
public java.lang.Object getValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, AbstractNullPolicy nullPolicy)
-
getValuesIndicatingNoEntry
public java.util.List<XMLEntry> getValuesIndicatingNoEntry(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> keys)
-
getValuesIndicatingNoEntry
public java.util.List<XMLEntry> getValuesIndicatingNoEntry(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> keys, boolean shouldReturnNodes)
-
getValuesIndicatingNoEntry
public java.lang.Object getValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNodes)INTERNAL: Given a DatabaseField, return the corresponding values from the document
-
getValuesIndicatingNoEntry
public java.lang.Object getValuesIndicatingNoEntry(org.eclipse.persistence.internal.helper.DatabaseField key, boolean shouldReturnNodes, AbstractNullPolicy nullPolicy)
-
buildNestedRow
public XMLRecord buildNestedRow(org.w3c.dom.Element element)
INTERNAL: Build the nested record, this can be overwriten by subclasses to use their subclass instance.
-
getDOM
public org.w3c.dom.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 java.lang.Object put(org.eclipse.persistence.internal.helper.DatabaseField key, java.lang.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 java.lang.Object put(java.util.List<XMLField> xmlFields, java.util.List<XMLEntry> values)
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value) throws ValidationException- Specified by:
putin interfacejava.util.Map- Specified by:
putin interfaceorg.eclipse.persistence.internal.oxm.record.TransformationRecord- Overrides:
putin classorg.eclipse.persistence.internal.sessions.AbstractRecord- Throws:
ValidationException
-
remove
public java.lang.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(java.lang.Object value, int index)INTERNAL: replaces the value at index with value- Overrides:
replaceAtin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
entrySet
public java.util.Set entrySet()
PUBLIC:- Specified by:
entrySetin interfacejava.util.Map- Overrides:
entrySetin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
setFields
protected void setFields(java.util.Vector fields) throws XMLMarshalExceptionINTERNAL: 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 java.util.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 java.util.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(java.util.Vector values) throws XMLMarshalExceptionINTERNAL: 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(org.w3c.dom.Node element)
INTERNAL: Sets the dom and updated document to be the owner document of the given element
-
setDOM
public void setDOM(org.w3c.dom.Element element)
-
toString
public java.lang.String toString()
INTERNAL: Print the dom XML string.- Overrides:
toStringin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
keySet
public java.util.Set keySet()
PUBLIC: Return the set of element names from the DOM.- Specified by:
keySetin interfacejava.util.Map- Overrides:
keySetin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
values
public java.util.Collection values()
PUBLIC: Return the collection of element values from the DOM.- Specified by:
valuesin interfacejava.util.Map- Overrides:
valuesin classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
size
public int size()
Return the number of elements in the DOM.- Specified by:
sizein interfacejava.util.Map- Overrides:
sizein classorg.eclipse.persistence.internal.sessions.AbstractRecord
-
transformFromXML
public void transformFromXML(java.lang.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(java.io.Reader reader)
Set the XML from an XML reader.
-
transformToXML
public java.lang.String transformToXML()
Return the XML string representation of the DOM.- Specified by:
transformToXMLin classXMLRecord
-
transformToWriter
public void transformToWriter(java.io.Writer writer)
Write the XML string representation of the DOM.
-
resolveNamespacePrefix
public java.lang.String resolveNamespacePrefix(java.lang.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
-
-