Interface ILcdMetadataDecoder

All Known Implementing Classes:
TLcdCompositeMetadataDecoder, TLcdECWModelDecoder, TLcdGDALModelDecoder, TLcdISO19139MetadataDecoder, TLcdS57CatalogueModelDecoder, TLcdS57ModelDecoder, TLcdS57UnifiedModelDecoder, TLcdS63CatalogueModelDecoder, TLcdS63ModelDecoder, TLcdS63UnifiedModelDecoder

public interface ILcdMetadataDecoder
This interface defines the ability to decode TLcdISO19115Metadata from a source name. The source name can be that of a dedicated metadata file, or it can be the source name of a data set.

Some data formats do not include the metadata in their data files. For these formats, additional metadata file(s) may be placed next to the data file. The method findAndDecodeMetadata(String) can be used to discover these metadata file(s).

The TLcdISO19139MetadataDecoder is an implementation of this interface which allows decoding ISO-19115 metadata from an ISO-19139 XML source.

Since:
2014.0
See Also:
  • Method Details

    • canDecodeMetadata

      boolean canDecodeMetadata(String aSourceName)
      Tells whether this metadata decoder can likely decode metadata for a given source name.
      • If true, it is likely that decodeMetadata(String) will return a non-null TLcdISO19115Metadata object, but it is not a guarantee. The result is optimistic.
      • If false, it is guaranteed that decodeMetadata(String) will throw an exception or return null.
      Parameters:
      aSourceName - the source name to decode metadata for
      Returns:
      true if this metadata decoder can decode metadata for the given source name, false otherwise
    • decodeMetadata

      TLcdISO19115Metadata decodeMetadata(String aSourceName) throws IOException
      Decodes the metadata from a given source name as an ISO-19115 metadata object.

      Note that even if canDecodeMetadata(String) returns true, this method may yet not be able to decode the given source name. While returning null is allowed when this decoder couldn't decode the given source name, implementors are advised to throw an error instead.

      Parameters:
      aSourceName - the source name to decode metadata from
      Returns:
      a metadata object
      Throws:
      IOException - if the metadata cannot be decoded for some reason
    • findAndDecodeMetadata

      default ILcdMetadataDecoder.MetadataWithSource findAndDecodeMetadata(String aSourceName) throws IOException
      Searches metadata files for a given source name and decodes them as an ISO-19115 metadata object. The given source name points to a data set, not to a dedicated metadata file. A return value of null indicates that this decoder could not find dedicated metadata files for the given source name.

      This method returns a ILcdMetadataDecoder.MetadataWithSource, which combines the decoded metadata together with the names of the dedicated metadata files which were used for decoding the TLcdISO19115Metadata object. If not null, the decoded metadata should be the result of calling the decodeMetadata(String) method, passing one of these dedicated metadata files.

      The default implementation returns null.

      Parameters:
      aSourceName - a data source for which to find and decode the metadata
      Returns:
      the decoded TLcdISO19115Metadata and the location of the metadata file(s) from which the metadata was decoded, or null if no metadata files could be found.
      Throws:
      IOException - if the found metadata cannot be decoded for some reason
      Since:
      2022.1