Class GeoPkgExtension

Object
GeoPkgExtension
Direct Known Subclasses:
GeoPkgMetadataExtension, GeoPkgSchemaExtension

public class GeoPkgExtension extends Object
Base class for GeoPackage extensions, containing the share-able functionality
  • Field Details

  • Constructor Details

    • GeoPkgExtension

      protected GeoPkgExtension(String name, String definition, GeoPkgExtension.Scope scope, GeoPackage geoPackage)
      Creates a new geopackage extension. By itself, it only allows to access the associated tables.
      Parameters:
      name - The extension name, as registered with OGC
      definition - The definition, normally a URL pointing to a spec
      scope - The scope, read/write or write/only
      geoPackage - The GeoPackage providing access to the contents of the file
  • Method Details

    • getName

      public String getName()
      The extension name, as registered with OGC
    • getDefinition

      public String getDefinition()
      The definition, normally a URL pointing to a spec
    • getScope

      public GeoPkgExtension.Scope getScope()
      The scope of the extension
      Returns:
    • isRegistered

      public boolean isRegistered() throws IOException
      Returns true if the extension has at least one registration in the geopkg_extensions table. If not registered, the GeoPackage does not really have this extension, but the class could be used to create one (this behavior is extension specific and delegated to sub-classes).
      Throws:
      IOException
    • isRegistered

      protected boolean isRegistered(Connection cx) throws SQLException
      Throws:
      SQLException
    • getAssociations

      public List<GeoPkgExtension.Association> getAssociations() throws IOException
      Returns the list of GeoPkgExtension.Association between this extension and table/columns in the database
      Throws:
      IOException
    • getConnection

      protected Connection getConnection() throws SQLException
      Grabs a connection from the GeoPackage data source
      Throws:
      SQLException
    • getGeneratedKey

      protected long getGeneratedKey(PreparedStatement ps) throws SQLException
      Helper that returns the key generated by an insert, run with the provided prepared statement
      Throws:
      SQLException