Package org.geotools.data.csv
Class CSVDataStore
- Object
-
- ContentDataStore
-
- CSVDataStore
-
- All Implemented Interfaces:
DataAccess<SimpleFeatureType,SimpleFeature>
,DataStore
,FileDataStore
public class CSVDataStore extends ContentDataStore implements FileDataStore
-
-
Field Summary
-
Fields inherited from class ContentDataStore
dataStoreFactory, entries, featureFactory, filterFactory, geometryFactory, JOINED_FEATURE_TYPE, lockingManager, LOGGER, namespaceURI, typeFactory, WRITER_ADD, WRITER_COMMIT, WRITER_UPDATE
-
-
Constructor Summary
Constructors Constructor Description CSVDataStore(CSVFileState csvFileState, CSVStrategy csvStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ContentFeatureSource
createFeatureSource(ContentEntry entry)
Instantiates new feature source for the entry.void
createSchema(SimpleFeatureType featureType)
Creates a new schema in the datastore.protected List<Name>
createTypeNames()
Creates a set of qualified names corresponding to the types that the datastore provides.CSVStrategy
getCSVStrategy()
FeatureReader<SimpleFeatureType,SimpleFeature>
getFeatureReader()
SimpleFeatureSource
getFeatureSource()
FeatureWriter<SimpleFeatureType,SimpleFeature>
getFeatureWriter(Transaction transaction)
FeatureWriter<SimpleFeatureType,SimpleFeature>
getFeatureWriter(Filter filter, Transaction transaction)
FeatureWriter<SimpleFeatureType,SimpleFeature>
getFeatureWriterAppend(Transaction transaction)
SimpleFeatureType
getSchema()
FeatureType for the file being read.Name
getTypeName()
void
updateSchema(SimpleFeatureType featureType)
-
Methods inherited from class ContentDataStore
createContentState, dispose, ensureEntry, ensureFeatureStore, entry, getDataStoreFactory, getEntry, getFeatureFactory, getFeatureReader, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureTypeFactory, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getFilterFactory, getGeometryFactory, getInfo, getLockingManager, getLogger, getNames, getNamespaceURI, getSchema, getSchema, getTypeNames, name, removeEntry, removeSchema, removeSchema, setDataStoreFactory, setFeatureFactory, setFeatureTypeFactory, setFilterFactory, setGeometryFactory, setNamespaceURI, updateSchema, updateSchema
-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface DataAccess
dispose, getInfo, getNames, getSchema, removeSchema, updateSchema
-
Methods inherited from interface DataStore
getFeatureReader, getFeatureSource, getFeatureSource, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getLockingManager, getSchema, getTypeNames, removeSchema, updateSchema
-
-
-
-
Constructor Detail
-
CSVDataStore
public CSVDataStore(CSVFileState csvFileState, CSVStrategy csvStrategy)
-
-
Method Detail
-
getTypeName
public Name getTypeName()
-
createTypeNames
protected List<Name> createTypeNames() throws IOException
Description copied from class:ContentDataStore
Creates a set of qualified names corresponding to the types that the datastore provides.Namespaces may be left
null
for data stores which do not support namespace qualified type names.- Specified by:
createTypeNames
in classContentDataStore
- Returns:
- A list of
Name
. - Throws:
IOException
- Any errors occuring connecting to data.
-
createFeatureSource
protected ContentFeatureSource createFeatureSource(ContentEntry entry) throws IOException
Description copied from class:ContentDataStore
Instantiates new feature source for the entry.Subclasses should override this method to return a specific subclass of
ContentFeatureSource
.- Specified by:
createFeatureSource
in classContentDataStore
- Parameters:
entry
- The entry.- Returns:
- An new instance of
ContentFeatureSource
for the entry. - Throws:
IOException
-
getSchema
public SimpleFeatureType getSchema() throws IOException
Description copied from interface:FileDataStore
FeatureType for the file being read.This is the same as getSchema( getTypeName[0] )
- Specified by:
getSchema
in interfaceFileDataStore
- Returns:
- FeatureType of the file being read
- Throws:
IOException
- See Also:
DataStore.getSchema(java.lang.String)
-
updateSchema
public void updateSchema(SimpleFeatureType featureType) throws IOException
- Specified by:
updateSchema
in interfaceFileDataStore
- Throws:
IOException
- See Also:
DataStore.updateSchema(java.lang.String,SimpleFeatureType)
-
getFeatureSource
public SimpleFeatureSource getFeatureSource() throws IOException
- Specified by:
getFeatureSource
in interfaceFileDataStore
- Throws:
IOException
- See Also:
DataStore.getFeatureSource(java.lang.String)
-
getFeatureReader
public FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader() throws IOException
- Specified by:
getFeatureReader
in interfaceFileDataStore
- Throws:
IOException
- See Also:
DataStore#getFeatureReader(java.lang.String)
-
getFeatureWriter
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriter(Filter filter, Transaction transaction) throws IOException
- Specified by:
getFeatureWriter
in interfaceFileDataStore
- Throws:
IOException
- See Also:
DataStore#getFeatureWriter(Filter,Transaction)
-
getFeatureWriter
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriter(Transaction transaction) throws IOException
- Specified by:
getFeatureWriter
in interfaceFileDataStore
- Throws:
IOException
- See Also:
DataStore.getFeatureWriter(java.lang.String, Transaction)
-
getFeatureWriterAppend
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriterAppend(Transaction transaction) throws IOException
- Specified by:
getFeatureWriterAppend
in interfaceFileDataStore
- Throws:
IOException
- See Also:
DataStore.getFeatureWriterAppend(java.lang.String, Transaction)
-
getCSVStrategy
public CSVStrategy getCSVStrategy()
-
createSchema
public void createSchema(SimpleFeatureType featureType) throws IOException
Description copied from class:ContentDataStore
Creates a new schema in the datastore.This implementation throws a
UnsupportedOperationException
. Subclasses should override to support schema creation.- Specified by:
createSchema
in interfaceDataAccess<SimpleFeatureType,SimpleFeature>
- Overrides:
createSchema
in classContentDataStore
- Parameters:
featureType
- FetureType to add to DataStore- Throws:
IOException
- If featureType cannot be created- See Also:
DataAccess.createSchema(FeatureType)
-
-