Module org.eclipse.persistence.core
Class DOMReader
java.lang.Object
org.eclipse.persistence.internal.oxm.record.XMLReader
org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter
org.eclipse.persistence.internal.oxm.record.DOMReader
- All Implemented Interfaces:
XMLReader
- Direct Known Subclasses:
XMLFragmentReader
INTERNAL:
Purpose: An implementation of XMLReader for parsing DOM Nodes into SAX events.
Responsibilities:
- Walk the DOM tree and report sax events to the provided content handler
- Report lexical events to the lexical handler if it's provided
- Listen for callbacks from the Mapping-Level framework to handle caching nodes for document preservation
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final class
Implementation of Attributes - used to pass along a given node's attributes to the startElement method of the reader's content handler.protected static final class
Nested classes/interfaces inherited from class org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter
XMLReaderAdapter.Attribute, XMLReaderAdapter.ExtendedContentHandlerAdapter
Nested classes/interfaces inherited from class org.eclipse.persistence.internal.oxm.record.XMLReader
XMLReader.ValidatingContentHandler
-
Field Summary
Fields inherited from class org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter
contentHandler, lexicalHandler
Fields inherited from class org.eclipse.persistence.internal.oxm.record.XMLReader
locator, NAMESPACE_PREFIXES_FEATURE, REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE_FEATURE, validatingContentHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected DOMReader.IndexedAttributeList
buildAttributeList
(Element elem) protected void
Trigger an endDocument event on the contenthandler.protected void
endPrefixMappings
(Element elem) getCurrentObject
(CoreAbstractSession session, Mapping selfRecordMapping) protected String
protected void
handleChildNodes
(NodeList children) protected void
handleNewNamespaceDeclaration
(Element elem, String emptyString, String value) protected void
Handle prefixed attribute - may need to declare the namespace URI locally.protected void
handleXsiTypeAttribute
(Attr attr) void
newObjectEvent
(Object object, Object parent, Mapping selfRecordMapping) An EclipseLink specific callback into the Reader.void
void
void
parse
(InputSource input) protected void
processParentNamespaces
(Element element) Process namespace declarations on parent elements if not the root.protected void
reportElementEvents
(Element elem) protected void
reportElementEvents
(Element elem, String newUri, String newName) void
protected void
setupLocator
(Document doc) protected void
Trigger a startDocument event on the contenthandler.Methods inherited from class org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getLexicalHandler, getProperty, parse, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setLexicalHandler, setProperty
Methods inherited from class org.eclipse.persistence.internal.oxm.record.XMLReader
convertValueBasedOnSchemaType, getLocator, getMediaType, getNamespaceSeparator, getValidatorHandler, getValue, isInCollection, isNamespaceAware, isNullRecord, isNullRepresentedByXsiNil, setLocator, setNamespaceAware, setNamespaceSeparator, setValidatorHandler
-
Constructor Details
-
DOMReader
public DOMReader() -
DOMReader
-
-
Method Details
-
parse
- Specified by:
parse
in interfaceXMLReader
- Overrides:
parse
in classXMLReader
- Throws:
SAXException
-
parse
- Throws:
SAXException
-
parse
- Throws:
SAXException
-
processParentNamespaces
Process namespace declarations on parent elements if not the root. For each parent node from current to root push each onto a stack, then pop each off, calling startPrefixMapping for each XMLNS attribute. Using a stack ensures that the parent nodes are processed top down.- Throws:
SAXException
-
reportElementEvents
- Throws:
SAXException
-
reportElementEvents
- Throws:
SAXException
-
buildAttributeList
- Throws:
SAXException
-
endPrefixMappings
- Throws:
SAXException
-
getQName
- Throws:
SAXException
-
handleNewNamespaceDeclaration
-
handleXsiTypeAttribute
- Throws:
SAXException
-
handlePrefixedAttribute
Handle prefixed attribute - may need to declare the namespace URI locally.- Throws:
SAXException
-
handleChildNodes
- Throws:
SAXException
-
endDocument
Trigger an endDocument event on the contenthandler.- Throws:
SAXException
-
startDocument
Trigger a startDocument event on the contenthandler.- Throws:
SAXException
-
newObjectEvent
An EclipseLink specific callback into the Reader. This allows Objects to be associated with the XML Nodes they came from.- Overrides:
newObjectEvent
in classXMLReader
-
getCurrentObject
- Overrides:
getCurrentObject
in classXMLReader
-
getDocPresPolicy
-
setDocPresPolicy
-
setupLocator
-