org.dellroad.stuff.pobj
Class UpdatesXMLEventReader

java.lang.Object
  extended by javax.xml.stream.util.EventReaderDelegate
      extended by org.dellroad.stuff.xml.AnnotatedXMLEventReader
          extended by org.dellroad.stuff.pobj.UpdatesXMLEventReader
All Implemented Interfaces:
Iterator, XMLEventReader

public class UpdatesXMLEventReader
extends AnnotatedXMLEventReader

AnnotatedXMLEventReader that reads the nested schema update list. Used by PersistentObjectSchemaUpdater.


Constructor Summary
UpdatesXMLEventReader(XMLEventReader inner)
           
 
Method Summary
 List<String> getUpdates()
          Get the updates gleaned from the scan.
protected  boolean isAnnotationElement(StartElement event)
          Determine if the given event represents the start of the annotation element.
protected  void readAnnotationElement(StartElement startElement)
          Read the annotation element.
 
Methods inherited from class org.dellroad.stuff.xml.AnnotatedXMLEventReader
advance, next, nextEvent, peek, setParent, skipWhiteSpace
 
Methods inherited from class javax.xml.stream.util.EventReaderDelegate
close, getElementText, getParent, getProperty, hasNext, nextTag, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdatesXMLEventReader

public UpdatesXMLEventReader(XMLEventReader inner)
Method Detail

getUpdates

public List<String> getUpdates()
Get the updates gleaned from the scan.

Returns:
list of updates, or null if the document didn't contain an updates element

isAnnotationElement

protected boolean isAnnotationElement(StartElement event)
Description copied from class: AnnotatedXMLEventReader
Determine if the given event represents the start of the annotation element.

Specified by:
isAnnotationElement in class AnnotatedXMLEventReader

readAnnotationElement

protected void readAnnotationElement(StartElement startElement)
                              throws XMLStreamException
Description copied from class: AnnotatedXMLEventReader
Read the annotation element.

When this method is invoked, event represents the StartElement event for the annotation element (i.e., isAnnotationElement(event) has returned true); it is also the next event in the pipeline, i.e., the next event returned by AnnotatedXMLEventReader.nextEvent().

The last event consumed by this method should be the EndElement event for the annotation element, and the event returned by AnnotatedXMLEventReader.peek() should be the next event after the EndElement.

Specified by:
readAnnotationElement in class AnnotatedXMLEventReader
Parameters:
startElement - the StartElement event for the annotation element
Throws:
XMLStreamException