Class MetadataFallback

java.lang.Object
org.apache.sis.metadata.sql.MetadataSource
org.apache.sis.metadata.sql.MetadataFallback
All Implemented Interfaces:
AutoCloseable

final class MetadataFallback extends MetadataSource
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 Details

    • INSTANCE

      static final MetadataFallback INSTANCE
      The unique instance of this fallback.
  • Constructor Details

    • MetadataFallback

      private MetadataFallback()
      Creates the singleton.
  • Method Details

    • search

      public String search(Object metadata)
      Searches for the given metadata in the hard-coded list.
      Overrides:
      search in class MetadataSource
      Parameters:
      metadata - the metadata to search for.
      Returns:
      the identifier of the given metadata, or null if none.
    • lookup

      public <T> T lookup(Class<T> type, String identifier)
      Returns a hard-coded metadata filled with the data referenced by the specified identifier. Alternatively, this method can also return a CodeList or Enum element.
      Overrides:
      lookup in class MetadataSource
      Type Parameters:
      T - the parameterized type of the type argument.
      Parameters:
      type - the interface to implement, or CodeList or some Enum 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

      static org.opengis.metadata.citation.Citation createCitation(String key)
      Returns the build-in citation for the given primary key, or null. 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 interface AutoCloseable
      Overrides:
      close in class MetadataSource