|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectMetadataSource
public class MetadataSource
A connection to a metadata database. The metadata database can be created
using one of the scripts suggested in GeoAPI, for example
create.sql
.
Then, in order to get for example a telephone number, the following code
may be used.
whereimport org.opengis.metadata.citation.Telephone; ... Connection connection = ... MetadataSource source = new MetadataSource(connection); Telephone telephone = (Telephone) source.getEntry(Telephone.class, id);
id
is the primary key value for the desired record in the
CI_Telephone
table.
modules/library/metadata (gt-metadata.jar)
Constructor Summary | |
---|---|
MetadataSource(Connection connection)
Creates a new metadata source. |
Method Summary | |
---|---|
void |
close()
Close all connections used in this object. |
Object |
getEntry(Class type,
String identifier)
Returns an implementation of the specified metadata interface filled with the data referenced by the specified identifier. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetadataSource(Connection connection)
connection
- The connection to the database.Method Detail |
---|
public Object getEntry(Class type, String identifier) throws SQLException
CodeList
element.
type
- The interface to implement (e.g.
Citation
), or
the CodeList
.identifier
- The identifier used in order to locate the record for
the metadata entity to be created. This is usually the primary key
of the record to search for.
SQLException
- if a SQL query failed.public void close() throws SQLException
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |