Class AnnotatedXMLEventReader

java.lang.Object
javax.xml.stream.util.EventReaderDelegate
org.dellroad.stuff.xml.AnnotatedXMLEventReader
All Implemented Interfaces:
Iterator<Object>, XMLEventReader

public abstract class AnnotatedXMLEventReader extends EventReaderDelegate
XMLEventReader that reads and removes an initial annotation element from an XML document. The annotation element, if present, must be the first element inside the top-level document element. readAnnotationElement() must be provided by the subclass to determine whether the first non-top element is the expected annotation element, and read it if so. Whoever reads from this AnnotatedXMLEventReader instance class will not see the annotation element.

This class can be used in combination with AnnotatedXMLEventWriter to transparently annotate XML documents.

See Also: