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

public Class XMLStreamReaderReader

extends XMLReaderAdapter
Class Inheritance
Imports
javax.xml.stream.XMLStreamReader, org.eclipse.persistence.internal.oxm.Constants, .Unmarshaller, org.eclipse.persistence.internal.oxm.record.namespaces.UnmarshalNamespaceContext, org.xml.sax.ContentHandler, .InputSource, .Locator, .SAXException, org.xml.sax.ext.Locator2

Convert an XMLStreamReader into SAX events.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
XMLStreamReaderReader.StreamReaderLocator

An implementation of Locator, created from an existing XMLStreamReader.

private static class

Field Summary

Modifier and TypeField and Description
private int
private XMLStreamReaderReader.XMLStreamReaderAttributes
private boolean
private UnmarshalNamespaceContext
private XMLStreamReader
Inherited from org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter:
contentHandlerlexicalHandler

Constructor Summary

AccessConstructor and Description
public
public
XMLStreamReaderReader(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.
public void
parse(XMLStreamReader xmlStreamReader)

protected void
parseCharactersEvent(XMLStreamReader xmlStreamReader)

Subclasses of this class can override this method to provide alternate mechanisms for processing the characters event.

private void
parseEvent(XMLStreamReader xmlStreamReader, int eventType)

public void
setContentHandler(ContentHandler
The content handler.
handler
)

Overrides org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter.setContentHandler.

Implements org.xml.sax.XMLReader.setContentHandler.

Allow an application to register a content event handler.
Inherited from org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter:
getContentHandlergetDTDHandlergetEntityResolvergetErrorHandlergetFeaturegetLexicalHandlergetPropertyparsesetDTDHandlersetEntityResolversetErrorHandlersetFeaturesetLexicalHandlersetProperty

Field Detail

depthback to summary
private int depth
indexedAttributeListback to summary
private XMLStreamReaderReader.XMLStreamReaderAttributes indexedAttributeList
qNameAwareback to summary
private boolean qNameAware
unmarshalNamespaceContextback to summary
private UnmarshalNamespaceContext unmarshalNamespaceContext
xmlStreamReaderback to summary
private XMLStreamReader xmlStreamReader

Constructor Detail

XMLStreamReaderReaderback to summary
public XMLStreamReaderReader()
XMLStreamReaderReaderback to summary
public XMLStreamReaderReader(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
public void parse(XMLStreamReader xmlStreamReader) throws SAXException
parseCharactersEventback to summary
protected void parseCharactersEvent(XMLStreamReader xmlStreamReader) throws SAXException

Subclasses of this class can override this method to provide alternate mechanisms for processing the characters event. One possibility is obtaining a CharSequence and calling the corresponding characters method on the extended content handler.

parseEventback to summary
private void parseEvent(XMLStreamReader xmlStreamReader, int eventType) throws SAXException
setContentHandlerback to summary
public void setContentHandler(ContentHandler handler)

Overrides org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter.setContentHandler.

Implements org.xml.sax.XMLReader.setContentHandler.

Doc from org.xml.sax.XMLReader.setContentHandler.

Allow an application to register a content event handler.

If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters
handler:ContentHandler

The content handler.

Annotations
@Override
org.eclipse.persistence.internal.oxm.record back to summary

private Class XMLStreamReaderReader.StreamReaderLocator

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

An implementation of Locator, created from an existing XMLStreamReader.

See Also
org.xml.sax.Locator, javax.xml.stream.XMLStreamReader

Field Summary

Modifier and TypeField and Description
private XMLStreamReader

Constructor Summary

AccessConstructor and Description
public
StreamReaderLocator(XMLStreamReader
the XMLStreamReader object from which to copy location information.
r
)

Instantiates a new StreamReaderLocator.

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.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

readerback to summary
private XMLStreamReader reader

Constructor Detail

StreamReaderLocatorback to summary
public StreamReaderLocator(XMLStreamReader r)

Instantiates a new StreamReaderLocator.

Parameters
r:XMLStreamReader

the XMLStreamReader object from which to copy location information.

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
org.eclipse.persistence.internal.oxm.record back to summary

private Class XMLStreamReaderReader.XMLStreamReaderAttributes

extends IndexedAttributeList
Class Inheritance

Field Summary

Modifier and TypeField and Description
private XMLStreamReader
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 String
getValue(String
The Namespace URI, or the empty String if the name has no Namespace URI.
uri
,
String
The local name of the attribute.
localName
)

Overrides org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter.IndexedAttributeList.getValue.

Implements org.xml.sax.Attributes.getValue.

Look up an attribute's value by Namespace name.
public void
Inherited from org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter.IndexedAttributeList:
getIndexgetIndexgetLengthgetLocalNamegetQNamegetTypegetTypegetTypegetURIgetValuegetValuereset

Field Detail

xmlStreamReaderback to summary
private XMLStreamReader xmlStreamReader

Constructor Detail

XMLStreamReaderAttributesback to summary
private XMLStreamReaderAttributes()

Method Detail

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

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

Annotations
@Override
getValueback to summary
public String getValue(String uri, String localName)

Overrides org.eclipse.persistence.internal.oxm.record.XMLReaderAdapter.IndexedAttributeList.getValue.

Implements org.xml.sax.Attributes.getValue.

Doc from org.xml.sax.Attributes.getValue.

Look up an attribute's value by Namespace name.

See getValue(int) for a description of the possible values.

Parameters
uri:String

The Namespace URI, or the empty String if the name has no Namespace URI.

localName:String

The local name of the attribute.

Returns:String

The attribute value as a string, or null if the attribute is not in the list.

Annotations
@Override
setXmlStreamReaderback to summary
public void setXmlStreamReader(XMLStreamReader xmlStreamReader)