Class XMLRecord

  • 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.XMLRecord<org.eclipse.persistence.internal.sessions.AbstractSession>, Record
    Direct Known Subclasses:
    DOMRecord, UnmarshalRecord

    public abstract class XMLRecord
    extends org.eclipse.persistence.internal.sessions.AbstractRecord
    implements 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>
    PUBLIC: Provides a Record/Map API on an XML DOM element.
    See Also:
    Serialized Form
    • Field Detail

      • currentObject

        protected Object currentObject
      • session

        protected org.eclipse.persistence.internal.sessions.AbstractSession session
      • hasCustomNamespaceMapper

        protected boolean hasCustomNamespaceMapper
      • equalNamespaceResolvers

        protected boolean equalNamespaceResolvers
      • NIL

        public static final org.eclipse.persistence.internal.oxm.record.XMLRecord.Nil NIL
        INTERNAL: Nil: This is used to indicate that this field represents xsi:nil="true"
    • Constructor Detail

      • XMLRecord

        public XMLRecord()
    • Method Detail

      • get

        public Object get​(String key)
        PUBLIC: Add the field-value pair to the row.
        Overrides:
        get in class org.eclipse.persistence.internal.sessions.AbstractRecord
      • put

        public Object put​(String key,
                          Object value)
        PUBLIC: Add the field-value pair to the row.
        Overrides:
        put in class org.eclipse.persistence.internal.sessions.AbstractRecord
      • attributeWithoutQName

        public void attributeWithoutQName​(String namespaceURI,
                                          String localName,
                                          String prefix,
                                          String value)
        Marshal an attribute for the give namespaceURI, localName, preifx and value
        Specified by:
        attributeWithoutQName in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
        Parameters:
        namespaceURI -
        localName -
        prefix -
        value -
      • attribute

        public void attribute​(String namespaceURI,
                              String localName,
                              String qName,
                              String value)
        Marshal an attribute for the give namespaceURI, localName, qualifiedName and value
        Specified by:
        attribute in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
        Parameters:
        namespaceURI -
        localName -
        qName -
        value -
      • namespaceDeclaration

        public void namespaceDeclaration​(String prefix,
                                         String namespaceURI)
        Marshal a namespace declaration for the given prefix and url
        Specified by:
        namespaceDeclaration in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
        Parameters:
        prefix -
        namespaceURI -
      • getLocalName

        public abstract String getLocalName()
        PUBLIC: Get the local name of the context root element.
      • getNamespaceURI

        public abstract String getNamespaceURI()
        PUBLIC: Get the namespace URI for the context root element.
      • clear

        public abstract void clear()
        PUBLIC: Clear the sub-nodes of the DOM.
        Specified by:
        clear in interface Map
        Overrides:
        clear in class org.eclipse.persistence.internal.sessions.AbstractRecord
      • getDocument

        public abstract Document getDocument()
        PUBLIC: Return the document.
      • contains

        public boolean contains​(Object value)
        PUBLIC: Check if the value is contained in the row.
        Overrides:
        contains in class org.eclipse.persistence.internal.sessions.AbstractRecord
      • getDOM

        public abstract Node getDOM()
        PUBLIC: Return the DOM.
        Specified by:
        getDOM in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • transformToXML

        public abstract String transformToXML()
        Return the XML string representation of the DOM.
      • convertToXMLField

        protected XMLField convertToXMLField​(org.eclipse.persistence.internal.helper.DatabaseField databaseField)
        INTERNAL: Convert a DatabaseField to an XMLField
      • convertToXMLField

        protected List<XMLField> convertToXMLField​(List<org.eclipse.persistence.internal.helper.DatabaseField> databaseFields)
      • get

        public Object get​(org.eclipse.persistence.internal.helper.DatabaseField key)
        INTERNAL: Retrieve the value for the field. If missing null is returned.
        Specified by:
        get in interface org.eclipse.persistence.internal.oxm.record.AbstractUnmarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLUnmarshaller>
        Overrides:
        get in class org.eclipse.persistence.internal.sessions.AbstractRecord
      • getIndicatingNoEntry

        public Object getIndicatingNoEntry​(String fieldName)
        INTERNAL: Retrieve the value for the field name.
        Overrides:
        getIndicatingNoEntry in class org.eclipse.persistence.internal.sessions.AbstractRecord
      • resolveNamespacePrefix

        public String resolveNamespacePrefix​(String prefix)
        Specified by:
        resolveNamespacePrefix in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
        Specified by:
        resolveNamespacePrefix in interface org.eclipse.persistence.internal.oxm.record.AbstractUnmarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLUnmarshaller>
      • getMarshaller

        public XMLMarshaller getMarshaller()
        INTERNAL:
        Specified by:
        getMarshaller in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • setMarshaller

        public void setMarshaller​(XMLMarshaller marshaller)
        INTERNAL:
        Specified by:
        setMarshaller in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • getUnmarshaller

        public XMLUnmarshaller getUnmarshaller()
        INTERNAL:
        Specified by:
        getUnmarshaller in interface org.eclipse.persistence.internal.oxm.record.AbstractUnmarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLUnmarshaller>
      • setUnmarshaller

        public void setUnmarshaller​(XMLUnmarshaller unmarshaller)
        INTERNAL:
      • getOwningObject

        public Object getOwningObject()
        INTERNAL:
        Specified by:
        getOwningObject in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • setOwningObject

        public void setOwningObject​(Object owningObject)
        INTERNAL:
        Specified by:
        setOwningObject in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • getCurrentObject

        public Object getCurrentObject()
        INTERNAL:
      • setCurrentObject

        public void setCurrentObject​(Object obj)
        INTERNAL:
      • getLeafElementType

        public org.eclipse.persistence.internal.oxm.XPathQName getLeafElementType()
        INTERNAL:
        Specified by:
        getLeafElementType in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • setLeafElementType

        public void setLeafElementType​(org.eclipse.persistence.internal.oxm.XPathQName leafElementType)
        INTERNAL:
        Specified by:
        setLeafElementType in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • setLeafElementType

        public void setLeafElementType​(QName leafElementType)
        INTERNAL:
        Specified by:
        setLeafElementType in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • setNamespaceResolver

        public void setNamespaceResolver​(NamespaceResolver nr)
        Specified by:
        setNamespaceResolver in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • getNamespaceResolver

        public NamespaceResolver getNamespaceResolver()
        Specified by:
        getNamespaceResolver in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • getSession

        public org.eclipse.persistence.internal.sessions.AbstractSession getSession()
        Specified by:
        getSession in interface org.eclipse.persistence.internal.oxm.record.XMLRecord<org.eclipse.persistence.internal.sessions.AbstractSession>
      • setSession

        public void setSession​(org.eclipse.persistence.internal.sessions.AbstractSession session)
        Specified by:
        setSession in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • setEqualNamespaceResolvers

        public void setEqualNamespaceResolvers​(boolean equalNRs)
        Specified by:
        setEqualNamespaceResolvers in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • hasEqualNamespaceResolvers

        public boolean hasEqualNamespaceResolvers()
        Specified by:
        hasEqualNamespaceResolvers in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • isXOPPackage

        public boolean isXOPPackage()
        Specified by:
        isXOPPackage in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • setXOPPackage

        public void setXOPPackage​(boolean isXOPPackage)
        Specified by:
        setXOPPackage in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • isNamespaceAware

        public boolean isNamespaceAware()
        INTERNAL: Determine if namespaces will be considered during marshal/unmarshal operations.
        Specified by:
        isNamespaceAware in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
        Specified by:
        isNamespaceAware in interface org.eclipse.persistence.internal.oxm.record.XMLRecord<org.eclipse.persistence.internal.sessions.AbstractSession>
        Since:
        2.4
      • getNamespaceSeparator

        public char getNamespaceSeparator()
        INTERNAL: The character used to separate the prefix and uri portions when namespaces are present
        Specified by:
        getNamespaceSeparator in interface org.eclipse.persistence.internal.oxm.record.XMLRecord<org.eclipse.persistence.internal.sessions.AbstractSession>
        Since:
        2.4
      • hasCustomNamespaceMapper

        public boolean hasCustomNamespaceMapper()
        Specified by:
        hasCustomNamespaceMapper in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • setCustomNamespaceMapper

        public void setCustomNamespaceMapper​(boolean customNamespaceMapper)
        Specified by:
        setCustomNamespaceMapper in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
      • addExtraNamespacesToNamespaceResolver

        public List<org.eclipse.persistence.internal.oxm.Namespace> addExtraNamespacesToNamespaceResolver​(org.eclipse.persistence.internal.oxm.mappings.Descriptor descriptor,
                                                                                                          org.eclipse.persistence.internal.core.sessions.CoreAbstractSession session,
                                                                                                          boolean allowOverride,
                                                                                                          boolean ignoreEqualResolvers)
        INTERNAL
        Specified by:
        addExtraNamespacesToNamespaceResolver in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
        Since:
        EclipseLink 2.5.0
      • addXsiTypeAndClassIndicatorIfRequired

        public boolean addXsiTypeAndClassIndicatorIfRequired​(org.eclipse.persistence.internal.oxm.mappings.Descriptor descriptor,
                                                             org.eclipse.persistence.internal.oxm.mappings.Descriptor referenceDescriptor,
                                                             org.eclipse.persistence.internal.oxm.mappings.Field xmlField,
                                                             boolean isRootElement)
        INTERNAL
        Specified by:
        addXsiTypeAndClassIndicatorIfRequired in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
        Since:
        EclipseLink 2.5.0
      • addXsiTypeAndClassIndicatorIfRequired

        public boolean addXsiTypeAndClassIndicatorIfRequired​(org.eclipse.persistence.internal.oxm.mappings.Descriptor descriptor,
                                                             org.eclipse.persistence.internal.oxm.mappings.Descriptor referenceDescriptor,
                                                             org.eclipse.persistence.internal.oxm.mappings.Field xmlField,
                                                             Object originalObject,
                                                             Object obj,
                                                             boolean wasXMLRoot,
                                                             boolean isRootElement)
        INTERNAL
        Specified by:
        addXsiTypeAndClassIndicatorIfRequired in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
        Since:
        EclipseLink 2.5.0
      • removeExtraNamespacesFromNamespaceResolver

        public void removeExtraNamespacesFromNamespaceResolver​(List<org.eclipse.persistence.internal.oxm.Namespace> extraNamespaces,
                                                               org.eclipse.persistence.internal.core.sessions.CoreAbstractSession session)
        INTERNAL
        Specified by:
        removeExtraNamespacesFromNamespaceResolver in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
        Since:
        EclipseLink 2.5.0
      • writeXsiTypeAttribute

        public void writeXsiTypeAttribute​(org.eclipse.persistence.internal.oxm.mappings.Descriptor descriptor,
                                          String typeUri,
                                          String typeLocal,
                                          String typePrefix,
                                          boolean addToNamespaceResolver)
        INTERNAL
        Specified by:
        writeXsiTypeAttribute in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
        Since:
        EclipseLink 2.5.0
      • writeXsiTypeAttribute

        public void writeXsiTypeAttribute​(org.eclipse.persistence.internal.oxm.mappings.Descriptor xmlDescriptor,
                                          XMLSchemaReference xmlRef,
                                          boolean addToNamespaceResolver)
        INTERNAL
        Specified by:
        writeXsiTypeAttribute in interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.sessions.AbstractSession,​org.eclipse.persistence.internal.helper.DatabaseField,​XMLMarshaller,​NamespaceResolver>
        Since:
        EclipseLink 2.5.0
      • getConversionManager

        public org.eclipse.persistence.internal.oxm.ConversionManager getConversionManager()
        INTERNAL
        Specified by:
        getConversionManager in interface org.eclipse.persistence.internal.oxm.record.XMLRecord<org.eclipse.persistence.internal.sessions.AbstractSession>
        Since:
        EclipseLink 2.6.0