Class DataSource

java.lang.Object
com.vividsolutions.jump.io.datasource.DataSource
Direct Known Subclasses:
DataStoreQueryDataSource, InstallDummyReaderPlugIn.DummyDataSource, ReaderWriterFileDataSource

public abstract class DataSource extends Object
A file, database, web service, or other source of data. To be savable to a project file, a DataSource must not be an anonymous class (because the class name is recorded in the project file) and it must have a parameterless constructor (so it can be reconstructed by simply being instantiated and having #setProperties called).
  • Field Details

    • FILE_KEY

      @Deprecated public static final String FILE_KEY
      Deprecated.
      Filename property, used for file-based DataSources
      See Also:
    • URI_KEY

      public static final String URI_KEY
      Uri property, a more generic datasource source description
      See Also:
    • COMPRESSED_KEY

      public static final String COMPRESSED_KEY
      A property used when the datasource is wrapped into a compressed file
      See Also:
    • CHARSET_KEY

      public static final String CHARSET_KEY
      A property used to define the datasource encoding
      See Also:
    • COORDINATE_SYSTEM_REGISTRY

      public static final String COORDINATE_SYSTEM_REGISTRY
      A property used to define the Spatial Referebce System registry (ex. EPSG) May replace COORDINATE_SYSTEM_KEY and be used in conjunction with COORDINATE_SYSTEM_CODE and the new cts library
      See Also:
    • COORDINATE_SYSTEM_CODE

      public static final String COORDINATE_SYSTEM_CODE
      A property used to define the Spatial Reference System code (ex. 4326) May replace COORDINATE_SYSTEM_KEY and be used in conjonction with COORDINATE_SYSTEM_REGISTRY and the new cts library
      See Also:
    • COORDINATE_SYSTEM_KEY

      public static final String COORDINATE_SYSTEM_KEY
      Coordinate-system property, used for files and other DataSources that have a single CoordinateSystem
      See Also:
  • Constructor Details

    • DataSource

      public DataSource()
  • Method Details

    • setProperties

      public void setProperties(Map<String,Object> properties)
      Sets properties required to open a DataSource, such as username, password, filename, coordinate system, etc. Called by DataSourceQueryChoosers.
      Parameters:
      properties - the map containing properties for this DataSource
    • getProperties

      public Map<String,Object> getProperties()
    • getConnection

      public abstract Connection getConnection()
      Creates a new Connection to this DataSource.
      Returns:
      a Connection to connect to this DataSource
    • isReadable

      public boolean isReadable()
    • isWritable

      public boolean isWritable()
    • isDisabled

      public boolean isDisabled()
    • setDisabled

      public void setDisabled(boolean onOff)
    • installCoordinateSystem

      public FeatureCollection installCoordinateSystem(FeatureCollection queryResult, CoordinateSystemRegistry registry)