Module org.eclipse.persistence.core
Class XMLFragmentReader
java.lang.Object
org.eclipse.persistence.internal.oxm.record.XMLReader
org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter
org.eclipse.persistence.internal.oxm.record.DOMReader
org.eclipse.persistence.internal.oxm.record.XMLFragmentReader
- All Implemented Interfaces:
XMLReader
Internal:
Purpose: An implementation of XMLReader for parsing XMLFragment Nodes into SAX events.
Responsibilities:
- Walk the XMLFragment node's DOM tree and report sax events to the provided content handler
- Report lexical events to the lexical handler if it's provided
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.persistence.internal.oxm.record.DOMReader
DOMReader.IndexedAttributeList, DOMReader.LocatorImpl
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
Modifier and TypeFieldDescriptionprotected NamespaceResolver
protected List
<NamespaceResolver> protected Map
<Element, NamespaceResolver> 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 void
Remove any temporary namespace resolvers created while processing a given element.protected void
Trigger an endDocument event on the contenthandler.protected void
endPrefixMappings
(Element elem) If there is a temporary namespace resolver for a given element, each entry contains a prefix that requires an endPrefixMapping event to be triggeredprotected NamespaceResolver
getTempResolver
(Element elem) Returns the namespace resolver in the map of temporary namespace resolvers for a given elementprotected void
handleNewNamespaceDeclaration
(Element elem, String prefix, String namespaceURI) protected void
Handle prefixed attribute - may need to declare the namespace URI locally.protected void
handleXsiTypeAttribute
(Attr attr) void
protected void
processParentNamespaces
(Element element) Process namespace declarations on parent elements if not the root.protected void
reportElementEvents
(Element elem) protected String
resolveNamespacePrefix
(String prefix) Convenience method that iterates over each namespace resolver in the resolver list until it locates a uri for 'prefix' or the final resolver is reached w/o success.protected void
Trigger a startDocument event on the contenthandler.Methods inherited from class org.eclipse.persistence.internal.oxm.record.DOMReader
buildAttributeList, getCurrentObject, getDocPresPolicy, getQName, handleChildNodes, newObjectEvent, parse, parse, reportElementEvents, setDocPresPolicy, setupLocator
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
-
Field Details
-
nsresolver
-
nsresolverList
-
tmpresolverMap
-
-
Constructor Details
-
XMLFragmentReader
-
-
Method Details
-
parse
- Overrides:
parse
in classDOMReader
- Throws:
SAXException
-
reportElementEvents
- Overrides:
reportElementEvents
in classDOMReader
- Throws:
SAXException
-
endDocument
Trigger an endDocument event on the contenthandler.- Overrides:
endDocument
in classDOMReader
- Throws:
SAXException
-
startDocument
Trigger a startDocument event on the contenthandler.- Overrides:
startDocument
in classDOMReader
- Throws:
SAXException
-
handleNewNamespaceDeclaration
- Overrides:
handleNewNamespaceDeclaration
in classDOMReader
-
handlePrefixedAttribute
Handle prefixed attribute - may need to declare the namespace URI locally.- Overrides:
handlePrefixedAttribute
in classDOMReader
- Throws:
SAXException
-
endPrefixMappings
If there is a temporary namespace resolver for a given element, each entry contains a prefix that requires an endPrefixMapping event to be triggered- Overrides:
endPrefixMappings
in classDOMReader
- Throws:
SAXException
-
getTempResolver
Returns the namespace resolver in the map of temporary namespace resolvers for a given element- Returns:
- the namespace resolver in the map for elem, or a new resolver if none exists
-
cleanupNamespaceResolvers
Remove any temporary namespace resolvers created while processing a given element. -
resolveNamespacePrefix
Convenience method that iterates over each namespace resolver in the resolver list until it locates a uri for 'prefix' or the final resolver is reached w/o success.- Returns:
- true if a URI exists in one of the resolvers in the list, false otherwise
-
processParentNamespaces
Process namespace declarations on parent elements if not the root. For each parent node from current to root place puch 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.- Overrides:
processParentNamespaces
in classDOMReader
- Throws:
SAXException
-
handleXsiTypeAttribute
- Overrides:
handleXsiTypeAttribute
in classDOMReader
- Throws:
SAXException
-