org.geotoolkit.image.io
Interface WarningProducer

All Superinterfaces:
Localized
All Known Implementing Classes:
AsciiGridReader, AsciiGridWriter, DimensionIdentification, DimensionSet, DimensionSlice, FileImageReader, FileImageWriter, ImageReaderAdapter, ImageReaderAdapter, ImageWriterAdapter, MetadataNodeAccessor, MetadataNodeParser, NetcdfImageReader, NetcdfImageWriter, NetcdfMetadata, NetcdfMetadataReader, NetcdfMetadataWriter, RawImageReader, RawTiffImageReader, SpatialImageReader, SpatialImageReadParam, SpatialImageWriteParam, SpatialImageWriter, SpatialMetadata, StreamImageReader, StreamImageWriter, TextImageReader, TextImageWriter, TextMatrixImageReader, TextMatrixImageWriter, TextRecordImageReader, WorldFileImageReader, WorldFileImageWriter

public interface WarningProducer
extends Localized

Interface for objects that may produce warnings for recoverable failures. The warnings are encapsulated in LogRecord objects and given to the warningOccurred method. The (sometime indirect) result of a call to warningOccurred is one of the following choices:

  1. If there is at least one listener (IIOReadWarningListener or IIOWriteWarningListener) is reachable directly or indirectly, then the logging message is given to those listeners.

  2. Otherwise the record is logged using the LOGGER declared in this interface.

In many cases the warningOccured method delegates its work to an other WarningProducer until an ImageReader or ImageWriter is found. For example the chain of delegations can be as below:

  1. ReferencingBuilder
  2. MetadataNodeParser.warningOccurred(LogRecord)
  3. SpatialMetadata.warningOccurred(LogRecord)
  4. SpatialImageReader.warningOccurred(LogRecord)
  5. ImageReader.processWarningOccurred(String)
  6. IIOReadWarningListener.warningOccurred(ImageReader, String)


Localization
Warnings are localized for a locale typically inferred from the image reader or writer. The locale can be specified by a call to the setLocale method defined in the ImageReader or ImageWriter class.

Since:
3.08
Version:
3.08
Author:
Martin Desruisseaux (Geomatys)
See Also:
SpatialImageReader.warningOccurred(LogRecord), SpatialImageWriter.warningOccurred(LogRecord), SpatialMetadata.warningOccurred(LogRecord), MetadataNodeParser.warningOccurred(LogRecord)
Module:
coverage/geotk-coverageio (download)    View source code for this class

Field Summary
static Logger LOGGER
          The logger to use as a fallback when no warning listener can be reach.
 
Method Summary
 boolean warningOccurred(LogRecord record)
          Invoked when a warning occurred.
 
Methods inherited from interface Localized
getLocale
 

Field Detail

LOGGER

static final Logger LOGGER
The logger to use as a fallback when no warning listener can be reach.

Method Detail

warningOccurred

boolean warningOccurred(LogRecord record)
Invoked when a warning occurred. This method is typically invoked by the class implementing this WarningProducer interface. However it can also be invoked by other classes that forward their warnings, like below:
ReferencingBuilderMetadataNodeParserSpatialMetadata → (SpatialImageReader or SpatialImageWriter)
This method is public for allowing such forwarding.

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.


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