Class StaxDataStore

All Implemented Interfaces:
AutoCloseable, ResourceOnFileSystem, StoreResource, Resource, Localized
Direct Known Subclasses:
Store

public abstract class StaxDataStore extends URIDataStore
Base class of XML data stores based on the StAX framework.
Since:
0.8
Version:
1.3
Author:
Johann Sorel (Geomatys), Martin Desruisseaux (Geomatys)
  • Field Details

    • locale

      protected final Locale locale
      The locale to use for locale-sensitive data (not for logging or warning messages), or null if unspecified.
      See Also:
    • timezone

      protected final TimeZone timezone
      The timezone to use when parsing or formatting dates and times without explicit timezone, or null if unspecified.
      See Also:
    • encoding

      protected final Charset encoding
      The character encoding of the file content, or null if unspecified. This is often (but not always) ignored at reading time, but taken in account at writing time.
  • Constructor Details

    • StaxDataStore

      protected StaxDataStore(StaxDataStoreProvider provider, StorageConnector connector) throws DataStoreException
      Creates a new data store. The provider is mandatory if the data store will use JAXB, otherwise it is optional.
      Parameters:
      provider - the provider of this data store, or null if unspecified.
      connector - information about the storage (URL, stream, etc).
      Throws:
      DataStoreException - if the input or output type is not recognized.
  • Method Details

    • getProvider

      public final StaxDataStoreProvider getProvider()
      Returns the factory that created this DataStore instance, or null if unspecified.
      Overrides:
      getProvider in class DataStore
      Returns:
      the factory that created this DataStore instance, or null if unspecified.
      See Also:
    • getFormatName

      public final String getFormatName()
      Returns the short name (abbreviation) of the format being read or written. This is used for error messages.
      Returns:
      short name of format being read or written.
      See Also:
    • close

      public void close() throws DataStoreException
      Closes the input or output stream and releases any resources used by this XML data store. This data store cannot be used anymore after this method has been invoked.

      Note for implementers

      Implementations should invoke listeners.close() on their first line before to clear their resources and to invoke super.close().
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in class DataStore
      Throws:
      DataStoreException - if an error occurred while closing the input or output stream.
      See Also: