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 MetadataFallbackThe 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 TypeMethodDescriptionvoidclose()Ignored.(package private) static org.opengis.metadata.citation.CitationcreateCitation(String key) Returns the build-in citation for the given primary key, ornull.<T> TReturns 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:
searchin classMetadataSource- Parameters:
metadata- the metadata to search for.- Returns:
- the identifier of the given metadata, or
nullif none.
-
lookup
Returns a hard-coded metadata filled with the data referenced by the specified identifier. Alternatively, this method can also return aCodeListorEnumelement.- Overrides:
lookupin classMetadataSource- Type Parameters:
T- the parameterized type of thetypeargument.- Parameters:
type- the interface to implement, orCodeListor someEnumtypes.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
nullif unknown.
-
close
public void close()Ignored.- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classMetadataSource
-