org.geotoolkit.image.io.metadata
Class MetadataTranscoder<T>

Object
  extended by MetadataTranscoder<T>
Type Parameters:
T - The type of metadata object produced by this transcoder.
All Implemented Interfaces:
WarningProducer, Localized
Direct Known Subclasses:
NetcdfTranscoder

public abstract class MetadataTranscoder<T>
extends Object
implements WarningProducer

Base class for objects providing transcoding capabilities from/to a metadata object. The metadata object is typically the ISO 19115 Metadata, but not necessarily.

Since:
3.20
Version:
3.20
Author:
Martin Desruisseaux (Geomatys)
See Also:
ImageTranscoder
Module:
coverage/geotk-coverageio (download)    View source code for this class

Field Summary
 
Fields inherited from interface WarningProducer
LOGGER
 
Constructor Summary
protected MetadataTranscoder(WarningProducer owner)
          Creates a new transcoder for the given source or destination.
 
Method Summary
 Locale getLocale()
          Returns the locale to use for formatting warnings.
abstract  T readMetadata()
          Creates an ISO Metadata object from the information known to this transcoder.
 boolean warningOccurred(LogRecord record)
          Invoked when a warning occurred.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataTranscoder

protected MetadataTranscoder(WarningProducer owner)
Creates a new transcoder for the given source or destination.

Parameters:
owner - Typically the SpatialImageReader or SpatialImageWriter object using this transcoder, or null.
Method Detail

readMetadata

public abstract T readMetadata()
                        throws IOException
Creates an ISO Metadata object from the information known to this transcoder.

Returns:
The ISO metadata object.
Throws:
IOException - If an I/O operation was necessary but failed.

warningOccurred

public boolean warningOccurred(LogRecord record)
Invoked when a warning occurred. The default implementation delegates to the object given at construction time if any, or logs to the WarningProducer.LOGGER otherwise.

Specified by:
warningOccurred in interface WarningProducer
Parameters:
record - The warning that occurred.
Returns:
true if the message has been sent to at least one warning listener, or false if it has been sent to the logging system as a fallback.

getLocale

public Locale getLocale()
Returns the locale to use for formatting warnings. The default implementation delegates to the object given at construction time, or returns null if none.

Note that overriding this method does not guaranteed that warnings will be produced with the new locale. The actually used locale depends on which class produced the warning message.

Specified by:
getLocale in interface Localized
Returns:
The locale, or null if not explicitly defined.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.