Package org.geotools.geopkg
Class GeoPkgExtension
- Object
-
- GeoPkgExtension
-
- Direct Known Subclasses:
GeoPkgMetadataExtension
,GeoPkgSchemaExtension
public class GeoPkgExtension extends Object
Base class for GeoPackage extensions, containing the share-able functionality
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GeoPkgExtension.Association
static class
GeoPkgExtension.Scope
Extension scope
-
Field Summary
Fields Modifier and Type Field Description protected String
definition
protected GeoPackage
geoPackage
protected String
name
protected GeoPkgExtension.Scope
scope
-
Constructor Summary
Constructors Modifier Constructor Description protected
GeoPkgExtension(String name, String definition, GeoPkgExtension.Scope scope, GeoPackage geoPackage)
Creates a new geopackage extension.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<GeoPkgExtension.Association>
getAssociations()
Returns the list ofGeoPkgExtension.Association
between this extension and table/columns in the databaseprotected Connection
getConnection()
Grabs a connection from the GeoPackage data sourceString
getDefinition()
The definition, normally a URL pointing to a specprotected long
getGeneratedKey(PreparedStatement ps)
Helper that returns the key generated by an insert, run with the provided prepared statementString
getName()
The extension name, as registered with OGCGeoPkgExtension.Scope
getScope()
The scope of the extensionboolean
isRegistered()
Returns true if the extension has at least one registration in the geopkg_extensions table.protected boolean
isRegistered(Connection cx)
-
-
-
Field Detail
-
name
protected final String name
-
definition
protected final String definition
-
scope
protected final GeoPkgExtension.Scope scope
-
geoPackage
protected final GeoPackage geoPackage
-
-
Constructor Detail
-
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 OGCdefinition
- The definition, normally a URL pointing to a specscope
- The scope, read/write or write/onlygeoPackage
- The GeoPackage providing access to the contents of the file
-
-
Method Detail
-
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 ofGeoPkgExtension.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
-
-