Top Description Inners Fields Constructors Methods
org.hibernate.boot.jaxb.internal.stax

public Class JpaOrmXmlEventReader

extends EventReaderDelegate
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .Collections, .Iterator, .List, javax.xml.namespace.QName, javax.xml.stream.XMLEventFactory, .XMLEventReader, .XMLStreamException, javax.xml.stream.events.Attribute, .EndElement, .Namespace, .StartElement, .XMLEvent, javax.xml.stream.util.EventReaderDelegate, org.hibernate.boot.xsd.LocalXsdResolver, .MappingXsdSupport

A JPA orm.xml specific StAX EVentReader to handle a few oddities. Mainly we handle the namespace change. Ultimately we should handle "upgrading" the documents as well. The idea being that we'd always treat all versions as the latest. HHH-8108 for more discussion.
Authors
Strong Liu, Steve Ebersole, Hardy Ferentschik
See Also
HHH-8108

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private static final List<String>
private static final String
private static final String
private final XMLEventFactory

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
private Iterator<Attribute>
private Iterator<Namespace>
private Iterator<Namespace>
private Attribute
mapAttribute(StartElement startElement, Attribute originalAttribute)

private List<Attribute>
private Namespace
mapNamespace(Namespace originalNamespace)

private List<Namespace>
private List<Namespace>
mapNamespaces(Iterator<Namespace> originalNamespaceIterator)

public XMLEvent
public XMLEvent
peek()

Overrides javax.xml.stream.util.EventReaderDelegate.peek.

Implements javax.xml.stream.XMLEventReader.peek.

Check the next XMLEvent without reading it from the stream.
private XMLEvent
wrap(XMLEvent event)

private StartElement
wrap(StartElement startElement)

private XMLEvent
wrap(EndElement endElement)

Inherited from javax.xml.stream.util.EventReaderDelegate:
closegetElementTextgetParentgetPropertyhasNextnextnextTagremovesetParent

Field Detail

NAMESPACE_URIS_TO_MAPback to summary
private static final List<String> NAMESPACE_URIS_TO_MAP
ROOT_ELEMENT_NAMEback to summary
private static final String ROOT_ELEMENT_NAME
VERSION_ATTRIBUTE_NAMEback to summary
private static final String VERSION_ATTRIBUTE_NAME
xmlEventFactoryback to summary
private final XMLEventFactory xmlEventFactory

Constructor Detail

JpaOrmXmlEventReaderback to summary
public JpaOrmXmlEventReader(XMLEventReader reader)
JpaOrmXmlEventReaderback to summary
public JpaOrmXmlEventReader(XMLEventReader reader, XMLEventFactory xmlEventFactory)

Method Detail

existingXmlAttributesIteratorback to summary
private Iterator<Attribute> existingXmlAttributesIterator(StartElement startElement)
Annotations
@SuppressWarnings:unchecked
existingXmlNamespacesIteratorback to summary
private Iterator<Namespace> existingXmlNamespacesIterator(StartElement startElement)
Annotations
@SuppressWarnings:unchecked
existingXmlNamespacesIteratorback to summary
private Iterator<Namespace> existingXmlNamespacesIterator(EndElement endElement)
Annotations
@SuppressWarnings:unchecked
mapAttributeback to summary
private Attribute mapAttribute(StartElement startElement, Attribute originalAttribute)
mapAttributesback to summary
private List<Attribute> mapAttributes(StartElement startElement)
mapNamespaceback to summary
private Namespace mapNamespace(Namespace originalNamespace)
mapNamespacesback to summary
private List<Namespace> mapNamespaces(StartElement startElement)
mapNamespacesback to summary
private List<Namespace> mapNamespaces(Iterator<Namespace> originalNamespaceIterator)
nextEventback to summary
public XMLEvent nextEvent() throws XMLStreamException

Overrides javax.xml.stream.util.EventReaderDelegate.nextEvent.

Implements javax.xml.stream.XMLEventReader.nextEvent.

Doc from javax.xml.stream.XMLEventReader.nextEvent.

Gets the next XMLEvent. The initial event is StartDocument.

Returns:XMLEvent

the next XMLEvent

Annotations
@Override
Exceptions
XMLStreamException:
if there is an error with the underlying XML.
peekback to summary
public XMLEvent peek() throws XMLStreamException

Overrides javax.xml.stream.util.EventReaderDelegate.peek.

Implements javax.xml.stream.XMLEventReader.peek.

Doc from javax.xml.stream.XMLEventReader.peek.

Check the next XMLEvent without reading it from the stream. Returns null if the stream is at EOF or has no more XMLEvents. A call to peek() will be equal to the next return of next().

Returns:XMLEvent

the next XMLEvent

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
wrapback to summary
private XMLEvent wrap(XMLEvent event)
wrapback to summary
private StartElement wrap(StartElement startElement)
wrapback to summary
private XMLEvent wrap(EndElement endElement)
org.hibernate.boot.jaxb.internal.stax back to summary

public Class JpaOrmXmlEventReader.BadVersionException

extends RuntimeException
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
BadVersionException(String requestedVersion)

Method Summary

Modifier and TypeMethod and Description
public String

Field Detail

requestedVersionback to summary
private final String requestedVersion

Constructor Detail

BadVersionExceptionback to summary
public BadVersionException(String requestedVersion)

Method Detail

getRequestedVersionback to summary
public String getRequestedVersion()