Package org.apache.sis.metadata.sql
Class MetadataFallback
java.lang.Object
org.apache.sis.metadata.sql.MetadataSource
org.apache.sis.metadata.sql.MetadataFallback
- All Implemented Interfaces:
AutoCloseable
A fallback providing hard-coded values of metadata entities.
Used when connection to the spatial metadata cannot be established.
- Since:
- 1.0
- Version:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final MetadataFallback
The unique instance of this fallback.Fields inherited from class org.apache.sis.metadata.sql.MetadataSource
catalog, ID_COLUMN, NAME_POLICY, standard
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Ignored.(package private) static org.opengis.metadata.citation.Citation
createCitation
(String key) Returns the build-in citation for the given primary key, ornull
.<T> T
Returns a hard-coded metadata filled with the data referenced by the specified identifier.Searches for the given metadata in the hard-coded list.Methods inherited from class org.apache.sis.metadata.sql.MetadataSource
asValueMap, closeExpired, connection, extractFromCollection, getCodeList, getExistingColumns, getLookupInfo, getProvided, getTableName, getWarningFilter, helper, install, proxy, readColumn, schema, search, setWarningFilter, toStorableValue, warning
-
Field Details
-
INSTANCE
The unique instance of this fallback.
-
-
Constructor Details
-
MetadataFallback
private MetadataFallback()Creates the singleton.
-
-
Method Details
-
search
Searches for the given metadata in the hard-coded list.- Overrides:
search
in classMetadataSource
- Parameters:
metadata
- the metadata to search for.- Returns:
- the identifier of the given metadata, or
null
if none.
-
lookup
Returns a hard-coded metadata filled with the data referenced by the specified identifier. Alternatively, this method can also return aCodeList
orEnum
element.- Overrides:
lookup
in classMetadataSource
- Type Parameters:
T
- the parameterized type of thetype
argument.- Parameters:
type
- the interface to implement, orCodeList
or someEnum
types.identifier
- the identifier of hard-coded values for the metadata entity to be returned.- Returns:
- an implementation of the required interface, or the code list element.
-
createCitation
Returns the build-in citation for the given primary key, ornull
. The content in this method should be consistent with the content provided in the"Citations.sql"
script (this is verified by JUnit tests).- Parameters:
key
- the primary key of the desired citation.- Returns:
- the requested citation, or
null
if unknown.
-
close
public void close()Ignored.- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classMetadataSource
-