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

public Class XMLEventReaderReader

extends XMLReaderAdapter
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .Iterator, .List, .Map, javax.xml.namespace.QName, javax.xml.stream.XMLEventReader, .XMLStreamException, javax.xml.stream.events.Characters, .Comment, .EndElement, .Namespace, .ProcessingInstruction, .StartElement, .XMLEvent, org.eclipse.persistence.internal.oxm.Constants, .Unmarshaller, org.xml.sax.InputSource, .Locator, .SAXException, org.xml.sax.ext.Locator2

Convert and XMLEventReader into SAX events.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
XMLEventReaderReader.EventReaderLocator

An implementation of Locator, with location data provided by an existing XMLEvent.

private static class

Field Summary

Modifier and TypeField and Description
private int
private XMLEventReaderReader.XMLEventReaderAttributes
private XMLEvent
private Map<Integer, List<Namespace>>
Inherited from org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter:
contentHandlerlexicalHandler

Constructor Summary

AccessConstructor and Description
public
public
XMLEventReaderReader(Unmarshaller<ABSTRACT_SESSION extends CoreAbstractSession<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, PLATFORM extends CorePlatform<CONVERSION_MANAGER extends CoreConversionManager>, PROJECT extends CoreProject<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, SESSION extends CoreSession>, SESSION_EVENT_MANAGER extends CoreSessionEventManager<SESSION_EVENT_LISTENER extends CoreSessionEventListener>>, CONTEXT extends Context<ABSTRACT_SESSION extends CoreAbstractSession<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, PLATFORM extends CorePlatform<CONVERSION_MANAGER extends CoreConversionManager>, PROJECT extends CoreProject<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, SESSION extends CoreSession>, SESSION_EVENT_MANAGER extends CoreSessionEventManager<SESSION_EVENT_LISTENER extends CoreSessionEventListener>>, DESCRIPTOR extends Descriptor<?, ?, ?, ?, ?, NAMESPACE_RESOLVER, ?, ?, ?, ?>, FIELD extends Field, NAMESPACE_RESOLVER extends NamespaceResolver, PROJECT extends CoreProject<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, SESSION extends CoreSession>, SESSION extends CoreSession<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, PLATFORM extends CorePlatform, PROJECT extends CoreProject<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, SESSION extends CoreSession>, SESSION_EVENT_MANAGER extends CoreSessionEventManager>, SESSION_EVENT_LISTENER extends CoreSessionEventListener>, DESCRIPTOR extends Descriptor, ID_RESOLVER extends IDResolver, MEDIA_TYPE extends MediaType, ROOT extends Root, UNMARSHALLER_HANDLER extends UnmarshallerHandler, UNMARSHALLER_LISTENER extends Unmarshaller.Listener> xmlUnmarshaller)

Method Summary

Modifier and TypeMethod and Description
public Locator
getLocator()

Overrides org.eclipse.persistence.internal.oxm.record.XMLReader.getLocator.

INTERNAL: return the Locator object associated with this reader
public void
parse(InputSource
The input source for the top-level of the XML document.
input
)

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

Implements org.xml.sax.XMLReader.parse.

Parse an XML document.
private void
parse(XMLEventReader xmlEventReader)

private void
parseEvent(XMLEvent xmlEvent)

Inherited from org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter:
getContentHandlergetDTDHandlergetEntityResolvergetErrorHandlergetFeaturegetLexicalHandlergetPropertyparsesetContentHandlersetDTDHandlersetEntityResolversetErrorHandlersetFeaturesetLexicalHandlersetProperty

Field Detail

depthback to summary
private int depth
indexedAttributeListback to summary
private XMLEventReaderReader.XMLEventReaderAttributes indexedAttributeList
lastEventback to summary
private XMLEvent lastEvent
namespacesback to summary
private Map<Integer, List<Namespace>> namespaces

Constructor Detail

XMLEventReaderReaderback to summary
public XMLEventReaderReader()
XMLEventReaderReaderback to summary
public XMLEventReaderReader(Unmarshaller<ABSTRACT_SESSION extends CoreAbstractSession<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, PLATFORM extends CorePlatform<CONVERSION_MANAGER extends CoreConversionManager>, PROJECT extends CoreProject<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, SESSION extends CoreSession>, SESSION_EVENT_MANAGER extends CoreSessionEventManager<SESSION_EVENT_LISTENER extends CoreSessionEventListener>>, CONTEXT extends Context<ABSTRACT_SESSION extends CoreAbstractSession<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, PLATFORM extends CorePlatform<CONVERSION_MANAGER extends CoreConversionManager>, PROJECT extends CoreProject<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, SESSION extends CoreSession>, SESSION_EVENT_MANAGER extends CoreSessionEventManager<SESSION_EVENT_LISTENER extends CoreSessionEventListener>>, DESCRIPTOR extends Descriptor<?, ?, ?, ?, ?, NAMESPACE_RESOLVER, ?, ?, ?, ?>, FIELD extends Field, NAMESPACE_RESOLVER extends NamespaceResolver, PROJECT extends CoreProject<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, SESSION extends CoreSession>, SESSION extends CoreSession<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, PLATFORM extends CorePlatform, PROJECT extends CoreProject<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, SESSION extends CoreSession>, SESSION_EVENT_MANAGER extends CoreSessionEventManager>, SESSION_EVENT_LISTENER extends CoreSessionEventListener>, DESCRIPTOR extends Descriptor, ID_RESOLVER extends IDResolver, MEDIA_TYPE extends MediaType, ROOT extends Root, UNMARSHALLER_HANDLER extends UnmarshallerHandler, UNMARSHALLER_LISTENER extends Unmarshaller.Listener> xmlUnmarshaller)

Method Detail

getLocatorback to summary
public Locator getLocator()

Overrides org.eclipse.persistence.internal.oxm.record.XMLReader.getLocator.

Doc from org.eclipse.persistence.internal.oxm.record.XMLReader.getLocator.

INTERNAL: return the Locator object associated with this reader

Annotations
@Override
parseback to summary
public void parse(InputSource input) throws SAXException

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

Implements org.xml.sax.XMLReader.parse.

Doc from org.xml.sax.XMLReader.parse.

Parse an XML document.

The application can use this method to instruct the XML reader to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).

Applications may not invoke this method while a parse is in progress (they should create a new XMLReader instead for each nested XML document). Once a parse is complete, an application may reuse the same XMLReader object, possibly with a different input source. Configuration of the XMLReader object (such as handler bindings and values established for feature flags and properties) is unchanged by completion of a parse, unless the definition of that aspect of the configuration explicitly specifies other behavior. (For example, feature flags or properties exposing characteristics of the document being parsed.)

During the parse, the XMLReader will provide information about the XML document through the registered event handlers.

This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception.

Parameters
input:InputSource

The input source for the top-level of the XML document.

Annotations
@Override
Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
parseback to summary
private void parse(XMLEventReader xmlEventReader) throws SAXException
parseEventback to summary
private void parseEvent(XMLEvent xmlEvent) throws SAXException
org.eclipse.persistence.internal.oxm.record back to summary

private final Class XMLEventReaderReader.EventReaderLocator

extends Object
implements Locator2
Class Inheritance
  • java.lang.Object
  • org.eclipse.persistence.internal.oxm.record.XMLEventReaderReader.EventReaderLocator
All Implemented Interfaces
org.xml.sax.ext.Locator2, org.xml.sax.Locator

An implementation of Locator, with location data provided by an existing XMLEvent.

See Also
org.xml.sax.Locator, javax.xml.stream.events.XMLEvent

Field Summary

Modifier and TypeField and Description
private XMLEvent

Constructor Summary

AccessConstructor and Description
public
EventReaderLocator()

Instantiates a new EventReaderLocator.

Method Summary

Modifier and TypeMethod and Description
public int
getColumnNumber()

Implements org.xml.sax.Locator.getColumnNumber.

Returns the column number of this Locator.
public String
getEncoding()

Implements org.xml.sax.ext.Locator2.getEncoding.

Returns the name of the character encoding for the entity.
public int
getLineNumber()

Implements org.xml.sax.Locator.getLineNumber.

Returns the line number of this Locator.
public String
getPublicId()

Implements org.xml.sax.Locator.getPublicId.

Returns the public ID of this Locator.
public String
getSystemId()

Implements org.xml.sax.Locator.getSystemId.

Returns the system ID of this Locator.
public String
getXMLVersion()

Implements org.xml.sax.ext.Locator2.getXMLVersion.

Returns the version of XML used for the entity.
public void
setEvent(XMLEvent
the XMLEvent object from which to copy location information.
e
)

Set the XMLEvent for this EventReaderLocator.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

eventback to summary
private XMLEvent event

Constructor Detail

EventReaderLocatorback to summary
public EventReaderLocator()

Instantiates a new EventReaderLocator.

Method Detail

getColumnNumberback to summary
public int getColumnNumber()

Implements org.xml.sax.Locator.getColumnNumber.

Returns the column number of this Locator.

Returns:int

Doc from org.xml.sax.Locator.getColumnNumber.

The column number, or -1 if none is available.

Annotations
@Override
getEncodingback to summary
public String getEncoding()

Implements org.xml.sax.ext.Locator2.getEncoding.

Doc from org.xml.sax.ext.Locator2.getEncoding.

Returns the name of the character encoding for the entity. If the encoding was declared externally (for example, in a MIME Content-Type header), that will be the name returned. Else if there was an <?xml ...encoding='...'?> declaration at the start of the document, that encoding name will be returned. Otherwise the encoding will been inferred (normally to be UTF-8, or some UTF-16 variant), and that inferred name will be returned.

When an InputSource is used to provide an entity's character stream, this method returns the encoding provided in that input stream.

Note that some recent W3C specifications require that text in some encodings be normalized, using Unicode Normalization Form C, before processing. Such normalization must be performed by applications, and would normally be triggered based on the value returned by this method.

Encoding names may be those used by the underlying JVM, and comparisons should be case-insensitive.

Returns:String

Name of the character encoding being used to interpret * the entity's text, or null if this was not provided for a * character stream passed through an InputSource or is otherwise not yet available in the current parsing state.

Annotations
@Override
getLineNumberback to summary
public int getLineNumber()

Implements org.xml.sax.Locator.getLineNumber.

Returns the line number of this Locator.

Returns:int

Doc from org.xml.sax.Locator.getLineNumber.

The line number, or -1 if none is available.

Annotations
@Override
getPublicIdback to summary
public String getPublicId()

Implements org.xml.sax.Locator.getPublicId.

Returns the public ID of this Locator.

Returns:String

Doc from org.xml.sax.Locator.getPublicId.

A string containing the public identifier, or null if none is available.

Annotations
@Override
getSystemIdback to summary
public String getSystemId()

Implements org.xml.sax.Locator.getSystemId.

Returns the system ID of this Locator.

Returns:String

Doc from org.xml.sax.Locator.getSystemId.

A string containing the system identifier, or null if none is available.

Annotations
@Override
getXMLVersionback to summary
public String getXMLVersion()

Implements org.xml.sax.ext.Locator2.getXMLVersion.

Doc from org.xml.sax.ext.Locator2.getXMLVersion.

Returns the version of XML used for the entity. This will normally be the identifier from the current entity's <?xml version='...' ...?> declaration, or be defaulted by the parser.

Returns:String

Identifier for the XML version being used to interpret the entity's text, or null if that information is not yet available in the current parsing state.

Annotations
@Override
setEventback to summary
public void setEvent(XMLEvent e)

Set the XMLEvent for this EventReaderLocator.

Parameters
e:XMLEvent

the XMLEvent object from which to copy location information.

org.eclipse.persistence.internal.oxm.record back to summary

private final Class XMLEventReaderReader.XMLEventReaderAttributes

extends IndexedAttributeList
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Iterator<E>
private Iterator<E>
Inherited from org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter.IndexedAttributeList:
attributesNO_ATTRIBUTES

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected XMLReaderAdapter.Attribute[]
public void
setIterators(Iterator<E> attrs, Iterator<E> namespaces)

Inherited from org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter.IndexedAttributeList:
getIndexgetIndexgetLengthgetLocalNamegetQNamegetTypegetTypegetTypegetURIgetValuegetValuegetValuereset

Field Detail

attrsback to summary
private Iterator<E> attrs
namespacesback to summary
private Iterator<E> namespaces

Constructor Detail

XMLEventReaderAttributesback to summary
private XMLEventReaderAttributes()

Method Detail

attributesback to summary
protected XMLReaderAdapter.Attribute[] attributes()

Implements abstract org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter.IndexedAttributeList.attributes.

Annotations
@Override
setIteratorsback to summary
public void setIterators(Iterator<E> attrs, Iterator<E> namespaces)