Top Description Fields Constructors Methods
org.eclipse.persistence.internal.oxm.record

public Class XMLFragmentReader

extends DOMReader
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .List, .Map, .Map.Entry, javax.xml.XMLConstants, org.eclipse.persistence.internal.oxm.Constants, .NamespaceResolver, org.eclipse.persistence.platform.xml.XMLPlatformFactory, org.w3c.dom.Attr, .Element, .NamedNodeMap, .Node, org.xml.sax.ContentHandler, .SAXException

Internal:

Purpose: An implementation of XMLReader for parsing XMLFragment Nodes into SAX events.

Responsibilities:

Field Summary

Modifier and TypeField and Description
protected NamespaceResolver
protected List<NamespaceResolver>
protected Map<Element, NamespaceResolver>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
cleanupNamespaceResolvers(Element elem)

Remove any temporary namespace resolvers created while processing a given element.

protected void
endDocument()

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.endDocument.

Trigger an endDocument event on the contenthandler.
protected void
endPrefixMappings(Element elem)

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.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
protected NamespaceResolver

Returns:

the namespace resolver in the map for elem, or a new resolver if none exists
getTempResolver
(Element elem)

Returns the namespace resolver in the map of temporary namespace resolvers for a given element

protected void
protected void
handlePrefixedAttribute(Element elem)

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.handlePrefixedAttribute.

Handle prefixed attribute - may need to declare the namespace URI locally.
protected void
public void
protected void
processParentNamespaces(Element element)

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.processParentNamespaces.

Process namespace declarations on parent elements if not the root.
protected void
protected String

Returns:

true if a URI exists in one of the resolvers in the list, false otherwise
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
startDocument()

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.startDocument.

Trigger a startDocument event on the contenthandler.
Inherited from org.eclipse.persistence.internal.oxm.record.DOMReader:
buildAttributeListgetCurrentObjectgetDocPresPolicygetQNamehandleChildNodesnewObjectEventparseparsereportElementEventssetDocPresPolicysetupLocator

Field Detail

nsresolverback to summary
protected NamespaceResolver nsresolver
nsresolverListback to summary
protected List<NamespaceResolver> nsresolverList
tmpresolverMapback to summary
protected Map<Element, NamespaceResolver> tmpresolverMap

Constructor Detail

XMLFragmentReaderback to summary
public XMLFragmentReader(NamespaceResolver namespaceResolver)

Method Detail

cleanupNamespaceResolversback to summary
protected void cleanupNamespaceResolvers(Element elem)

Remove any temporary namespace resolvers created while processing a given element.

endDocumentback to summary
protected void endDocument() throws SAXException

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.endDocument.

Trigger an endDocument event on the contenthandler.

Annotations
@Override
endPrefixMappingsback to summary
protected void endPrefixMappings(Element elem) throws SAXException

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.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

Annotations
@Override
getTempResolverback to summary
protected NamespaceResolver getTempResolver(Element elem)

Returns the namespace resolver in the map of temporary namespace resolvers for a given element

Returns:NamespaceResolver

the namespace resolver in the map for elem, or a new resolver if none exists

handleNewNamespaceDeclarationback to summary
protected void handleNewNamespaceDeclaration(Element elem, String prefix, String namespaceURI)

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.handleNewNamespaceDeclaration.

Annotations
@Override
handlePrefixedAttributeback to summary
protected void handlePrefixedAttribute(Element elem) throws SAXException

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.handlePrefixedAttribute.

Handle prefixed attribute - may need to declare the namespace URI locally.

Annotations
@Override
handleXsiTypeAttributeback to summary
protected void handleXsiTypeAttribute(Attr attr) throws SAXException

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.handleXsiTypeAttribute.

Annotations
@Override
parseback to summary
public void parse(Node node, String uri, String name) throws SAXException

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.parse.

Annotations
@Override
processParentNamespacesback to summary
protected void processParentNamespaces(Element element) throws SAXException

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.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.

Annotations
@Override
reportElementEventsback to summary
protected void reportElementEvents(Element elem) throws SAXException

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.reportElementEvents.

Annotations
@Override
resolveNamespacePrefixback to summary
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.

Returns:String

true if a URI exists in one of the resolvers in the list, false otherwise

startDocumentback to summary
protected void startDocument() throws SAXException

Overrides org.eclipse.persistence.internal.oxm.record.DOMReader.startDocument.

Trigger a startDocument event on the contenthandler.

Annotations
@Override