public interface ILcdMetadataDecoder
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.
TLcdISO19115Metadata
,
TLcdISO19139MetadataDecoder
Modifier and Type | Interface and Description |
---|---|
static class |
ILcdMetadataDecoder.MetadataWithSource
A
TLcdISO19115Metadata paired with the metadata source file(s) from which the metadata was decoded. |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeMetadata(String aSourceName)
Tells whether this metadata decoder can likely decode metadata for a given source name.
|
TLcdISO19115Metadata |
decodeMetadata(String aSourceName)
Decodes the metadata from a given source name as an ISO-19115 metadata object.
|
default ILcdMetadataDecoder.MetadataWithSource |
findAndDecodeMetadata(String aSourceName)
Searches metadata files for a given source name and decodes them as an ISO-19115 metadata object.
|
boolean canDecodeMetadata(String aSourceName)
true
, it is likely that decodeMetadata(String)
will return a non-null TLcdISO19115Metadata
object,
but it is not a guarantee. The result is optimistic.
false
, it is guaranteed that decodeMetadata(String)
will throw an exception or return null
.
aSourceName
- the source name to decode metadata fortrue
if this metadata decoder can decode metadata for the given source name, false
otherwiseTLcdISO19115Metadata decodeMetadata(String aSourceName) throws IOException
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.
aSourceName
- the source name to decode metadata fromIOException
- if the metadata cannot be decoded for some reasondefault ILcdMetadataDecoder.MetadataWithSource findAndDecodeMetadata(String aSourceName) throws IOException
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.
aSourceName
- a data source for which to find and decode the metadataTLcdISO19115Metadata
and the location of the metadata file(s) from which the metadata
was decoded, or null
if no metadata files could be found.IOException
- if the found metadata cannot be decoded for some reason