Class StaxDataStore
java.lang.Object
org.apache.sis.storage.DataStore
org.apache.sis.internal.storage.URIDataStore
org.apache.sis.internal.storage.xml.stream.StaxDataStore
- All Implemented Interfaces:
AutoCloseable,ResourceOnFileSystem,StoreResource,Resource,Localized
- Direct Known Subclasses:
Store
Base class of XML data stores based on the StAX framework.
- Since:
- 0.8
- Version:
- 1.3
- Author:
- Johann Sorel (Geomatys), Martin Desruisseaux (Geomatys)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.internal.storage.URIDataStore
URIDataStore.Provider -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CharsetThe character encoding of the file content, ornullif unspecified.protected final LocaleThe locale to use for locale-sensitive data (not for logging or warning messages), ornullif unspecified.protected final TimeZoneThe timezone to use when parsing or formatting dates and times without explicit timezone, ornullif unspecified.Fields inherited from class org.apache.sis.internal.storage.URIDataStore
location -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStaxDataStore(StaxDataStoreProvider provider, StorageConnector connector) Creates a new data store. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the input or output stream and releases any resources used by this XML data store.final StringReturns the short name (abbreviation) of the format being read or written.final StaxDataStoreProviderReturns the factory that created thisDataStoreinstance, ornullif unspecified.Methods inherited from class org.apache.sis.internal.storage.URIDataStore
addTitleOrIdentifier, getComponentFiles, getIdentifier, getOpenParameters, getOriginator, getSpecifiedPath, location, parametersMethods inherited from class org.apache.sis.storage.DataStore
addListener, findResource, getDisplayName, getLocale, getMetadata, getNativeMetadata, removeListener, setLocale, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sis.storage.Resource
addListener, getMetadata, removeListener
-
Field Details
-
locale
The locale to use for locale-sensitive data (not for logging or warning messages), ornullif unspecified.- See Also:
-
timezone
The timezone to use when parsing or formatting dates and times without explicit timezone, ornullif unspecified.- See Also:
-
encoding
The character encoding of the file content, ornullif 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. Theprovideris mandatory if the data store will use JAXB, otherwise it is optional.- Parameters:
provider- the provider of this data store, ornullif unspecified.connector- information about the storage (URL, stream, etc).- Throws:
DataStoreException- if the input or output type is not recognized.
-
-
Method Details
-
getProvider
Returns the factory that created thisDataStoreinstance, ornullif unspecified.- Overrides:
getProviderin classDataStore- Returns:
- the factory that created this
DataStoreinstance, ornullif unspecified. - See Also:
-
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
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 invokelisteners.close()on their first line before to clear their resources and to invokesuper.close().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classDataStore- Throws:
DataStoreException- if an error occurred while closing the input or output stream.- See Also:
-