Class StaxStreamReader

java.lang.Object
org.apache.sis.internal.storage.xml.stream.StaxStreamIO
org.apache.sis.internal.storage.xml.stream.StaxStreamReader
All Implemented Interfaces:
AutoCloseable, Runnable, Spliterator<AbstractFeature>, XMLStreamConstants
Direct Known Subclasses:
Reader

public abstract class StaxStreamReader extends StaxStreamIO implements XMLStreamConstants, Spliterator<AbstractFeature>, Runnable
Base class of Apache SIS readers of XML files using STAX parser. This class is itself an spliterator over all Feature instances found in the XML file, with the following restrictions:
  • tryAdvance(Consumer) shall returns the features in the order they are declared in the XML file.
  • tryAdvance(Consumer) shall not return null value.
  • Modifications of the XML file are not allowed while an iteration is in progress.
  • A StaxStreamReader instance can iterate over the features only once; if a new iteration is wanted, a new StaxStreamReader instance must be created.
This is a helper class for DataStore implementations. Readers for a given specification should extend this class and implement methods as in the following example:

Example:

Readers can be used like below:

Multi-threading

This class and subclasses are not tread-safe. Synchronization shall be done by the DataStore that contains the StaxStreamReader instance.
Since:
0.8
Version:
0.8