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 classGeoPkgExtension.Associationstatic classGeoPkgExtension.ScopeExtension scope
-
Field Summary
Fields Modifier and Type Field Description protected Stringdefinitionprotected GeoPackagegeoPackageprotected Stringnameprotected GeoPkgExtension.Scopescope
-
Constructor Summary
Constructors Modifier Constructor Description protectedGeoPkgExtension(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.Associationbetween this extension and table/columns in the databaseprotected ConnectiongetConnection()Grabs a connection from the GeoPackage data sourceStringgetDefinition()The definition, normally a URL pointing to a specprotected longgetGeneratedKey(PreparedStatement ps)Helper that returns the key generated by an insert, run with the provided prepared statementStringgetName()The extension name, as registered with OGCGeoPkgExtension.ScopegetScope()The scope of the extensionbooleanisRegistered()Returns true if the extension has at least one registration in the geopkg_extensions table.protected booleanisRegistered(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 IOExceptionReturns 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.Associationbetween 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
-
-