org.geotools.data.shapefile
Class ShapefileDataStoreFactory

java.lang.Object
  extended byorg.geotools.data.shapefile.ShapefileDataStoreFactory
All Implemented Interfaces:
DataStoreFactorySpi, Factory, FileDataStoreFactorySpi

public class ShapefileDataStoreFactory
extends java.lang.Object
implements FileDataStoreFactorySpi

Implementation of the DataStore service provider interface for Shapefiles.

Version:
$Id: ShapefileDataStoreFactory.java 17700 2006-01-22 23:30:39Z desruisseaux $
Author:
Chris Holmes, TOPP

Nested Class Summary
 
Nested classes inherited from class org.geotools.data.DataStoreFactorySpi
DataStoreFactorySpi.Param
 
Field Summary
static DataStoreFactorySpi.Param MEMORY_MAPPED
           
static DataStoreFactorySpi.Param NAMESPACEP
           
static DataStoreFactorySpi.Param URLP
           
 
Constructor Summary
ShapefileDataStoreFactory()
           
 
Method Summary
 boolean canProcess(java.util.Map params)
          Takes a list of params which describes how to access a restore and determins if it can be read by the Shapefile Datastore.
 boolean canProcess(java.net.URL f)
          DOCUMENT ME!
 DataStore createDataStore(java.util.Map params)
          Returns an instance of a ShapeFileDataStore iff the restore pointed to by params actualy is a Shapefile.
 DataStore createDataStore(java.net.URL url)
          DOCUMENT ME!
 DataStore createDataStore(java.net.URL url, boolean memorymapped)
           
 DataStore createNewDataStore(java.util.Map params)
          Not implemented yet.
 java.lang.String getDescription()
          Describes the type of data the datastore returned by this factory works with.
 java.lang.String getDisplayName()
          Name suitable for display to end user.
 java.lang.String[] getFileExtensions()
          DOCUMENT ME!
 java.util.Map getImplementationHints()
          Returns the implementation hints.
 DataStoreFactorySpi.Param[] getParametersInfo()
          Describe parameters.
 java.lang.String getTypeName(java.net.URL url)
          DOCUMENT ME!
 boolean isAvailable()
          Test to see if this datastore is available, if it has all the appropriate libraries to construct a datastore.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URLP

public static final DataStoreFactorySpi.Param URLP

NAMESPACEP

public static final DataStoreFactorySpi.Param NAMESPACEP

MEMORY_MAPPED

public static final DataStoreFactorySpi.Param MEMORY_MAPPED
Constructor Detail

ShapefileDataStoreFactory

public ShapefileDataStoreFactory()
Method Detail

canProcess

public boolean canProcess(java.util.Map params)
Takes a list of params which describes how to access a restore and determins if it can be read by the Shapefile Datastore.

Specified by:
canProcess in interface DataStoreFactorySpi
Parameters:
params - A set of params describing the location of a restore. Files should be pointed to by a 'url' param.
Returns:
true iff params contains a url param which points to a file ending in shp

createDataStore

public DataStore createDataStore(java.util.Map params)
                          throws java.io.IOException
Returns an instance of a ShapeFileDataStore iff the restore pointed to by params actualy is a Shapefile.

Specified by:
createDataStore in interface DataStoreFactorySpi
Parameters:
params - A param list with information on the location of a restore. For shapefiles this should contain a 'url' param which points to a file which ends in shp.
Returns:
DataStore A ShapefileDatastore
Throws:
java.io.IOException - DOCUMENT ME!
DataSourceException - Thrown if the datastore which is created cannot be attached to the restore specified in params.

createNewDataStore

public DataStore createNewDataStore(java.util.Map params)
                             throws java.io.IOException
Not implemented yet.

Specified by:
createNewDataStore in interface DataStoreFactorySpi
Parameters:
params -
Returns:
Throws:
java.io.IOException
java.io.IOException - DOCUMENT ME!
java.lang.UnsupportedOperationException

getDisplayName

public java.lang.String getDisplayName()
Description copied from interface: DataStoreFactorySpi
Name suitable for display to end user.

A non localized display name for this data store type.

Specified by:
getDisplayName in interface DataStoreFactorySpi
Returns:
A short name suitable for display in a user interface.

getDescription

public java.lang.String getDescription()
Describes the type of data the datastore returned by this factory works with.

Specified by:
getDescription in interface DataStoreFactorySpi
Returns:
String a human readable description of the type of restore supported by this datastore.

isAvailable

public boolean isAvailable()
Test to see if this datastore is available, if it has all the appropriate libraries to construct a datastore. This datastore just returns true for now.

Specified by:
isAvailable in interface DataStoreFactorySpi
Returns:
true if and only if this factory is available to create DataStores.
Task:
REVISIT: I'm just adding this method to compile, maintainer should revisit to check for any libraries that may be necessary for datastore creations.

getParametersInfo

public DataStoreFactorySpi.Param[] getParametersInfo()
Describe parameters.

Specified by:
getParametersInfo in interface DataStoreFactorySpi
Returns:
See Also:
DataStoreFactorySpi.getParametersInfo()

getFileExtensions

public java.lang.String[] getFileExtensions()
Description copied from interface: FileDataStoreFactorySpi
DOCUMENT ME!

Specified by:
getFileExtensions in interface FileDataStoreFactorySpi
Returns:
An ordered list of file extensions which can be read by this dataStore.
See Also:
org.geotools.data.dir.FileDataStoreFactorySpi#getFileExtensions()

canProcess

public boolean canProcess(java.net.URL f)
Description copied from interface: FileDataStoreFactorySpi
DOCUMENT ME!

Specified by:
canProcess in interface FileDataStoreFactorySpi
Parameters:
f - URL a url to a real file (may not be local)
Returns:
True when this dataStore can resolve and read the data specified by the URL.
See Also:
org.geotools.data.dir.FileDataStoreFactorySpi#canProcess(java.net.URL)

createDataStore

public DataStore createDataStore(java.net.URL url)
                          throws java.io.IOException
Description copied from interface: FileDataStoreFactorySpi
DOCUMENT ME!

Specified by:
createDataStore in interface FileDataStoreFactorySpi
Parameters:
url - A URL to the data location for the single featureType of this DataStore
Returns:
Returns an AbstractFileDataStore created from the data source provided.
Throws:
java.io.IOException
See Also:
org.geotools.data.dir.FileDataStoreFactorySpi#createDataStore(java.net.URL)

createDataStore

public DataStore createDataStore(java.net.URL url,
                                 boolean memorymapped)
                          throws java.io.IOException
Throws:
java.io.IOException
See Also:
org.geotools.data.dir.FileDataStoreFactorySpi#createDataStore(java.net.URL)

getTypeName

public java.lang.String getTypeName(java.net.URL url)
                             throws java.io.IOException
Description copied from interface: FileDataStoreFactorySpi
DOCUMENT ME!

Specified by:
getTypeName in interface FileDataStoreFactorySpi
Parameters:
url - The location of the datum to parse into features
Returns:
Returns the typename of the datum specified (on occasion this may involve starting the parse as well to get the FeatureType -- may not be instantanious).
Throws:
java.io.IOException
See Also:
org.geotools.data.dir.FileDataStoreFactorySpi#getTypeName(java.net.URL)

getImplementationHints

public java.util.Map getImplementationHints()
Returns the implementation hints. The default implementation returns en empty map.

Specified by:
getImplementationHints in interface Factory
Returns:
The map of hints, or an empty map if none.


Copyright © GeoTools. All Rights Reserved.