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
Nested ClassesModifier and TypeClassDescriptionprotected static final classImplementation of Attributes - used to pass along a given node's attributes to the startElement method of the reader's content handler.protected static final classNested classes/interfaces inherited from class org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter
XMLReaderAdapter.Attribute, XMLReaderAdapter.ExtendedContentHandlerAdapterNested 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, lexicalHandlerFields inherited from class org.eclipse.persistence.internal.oxm.record.XMLReader
locator, NAMESPACE_PREFIXES_FEATURE, REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE_FEATURE, validatingContentHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DOMReader.IndexedAttributeListbuildAttributeList(Element elem) protected voidTrigger an endDocument event on the contenthandler.protected voidendPrefixMappings(Element elem) getCurrentObject(CoreAbstractSession session, Mapping selfRecordMapping) protected Stringprotected voidhandleChildNodes(NodeList children) protected voidhandleNewNamespaceDeclaration(Element elem, String emptyString, String value) protected voidHandle prefixed attribute - may need to declare the namespace URI locally.protected voidhandleXsiTypeAttribute(Attr attr) voidnewObjectEvent(Object object, Object parent, Mapping selfRecordMapping) An EclipseLink specific callback into the Reader.voidvoidvoidparse(InputSource input) protected voidprocessParentNamespaces(Element element) Process namespace declarations on parent elements if not the root.protected voidreportElementEvents(Element elem) protected voidreportElementEvents(Element elem, String newUri, String newName) voidprotected voidsetupLocator(Document doc) protected voidTrigger 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, setPropertyMethods 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:
parsein interfaceXMLReader- Overrides:
parsein 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:
newObjectEventin classXMLReader
-
getCurrentObject
- Overrides:
getCurrentObjectin classXMLReader
-
getDocPresPolicy
-
setDocPresPolicy
-
setupLocator
-