org.geotools.coverage.io
Class MetadataException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by javax.imageio.IIOException
                  extended by org.geotools.coverage.io.MetadataException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AmbiguousMetadataException, MissingMetadataException

public class MetadataException
extends javax.imageio.IIOException

The base class for error related to grid coverage's metadata. This exception is thrown by the helper class MetadataBuilder.

Since:
2.2
Version:
$Id: MetadataException.java 30965 2008-07-09 10:04:21Z cedricbr $
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form

Constructor Summary
MetadataException(java.lang.Exception cause, TextMetadataParser.Key key, java.lang.String alias)
          Constructs an exception from the specified cause.
MetadataException(java.lang.String message)
          Constructs an exception with the specified message and no key.
MetadataException(java.lang.String message, TextMetadataParser.Key key, java.lang.String alias)
          Constructs an exception with the specified message.
MetadataException(java.lang.String message, java.lang.Throwable cause)
          Constructs an exception with the specified message and exception as its cause.
 
Method Summary
 java.lang.String getMetadataAlias()
          Returns the alias used for the key getMetadataKey().
 TextMetadataParser.Key getMetadataKey()
          Returns the metadata key which has raised this exception.
 java.lang.String toString()
          Returns a string representation of this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetadataException

public MetadataException(java.lang.String message)
Constructs an exception with the specified message and no key.

Parameters:
message - The message, or null if none.

MetadataException

public MetadataException(java.lang.String message,
                         java.lang.Throwable cause)
Constructs an exception with the specified message and exception as its cause.

Parameters:
message - The message, or null if none.
cause - The cause for this exception.

MetadataException

public MetadataException(java.lang.String message,
                         TextMetadataParser.Key key,
                         java.lang.String alias)
Constructs an exception with the specified message. This exception is usually raised because no value was defined for the key key, or the value was ambiguous.

Parameters:
message - The message, or null if none.
key - The metadata key which was the cause for this exception, or null if none. This is a format neutral key, for example TextMetadataParser.DATUM.
alias - The alias used for for the key key, or null if none. This is usually the name used in the external file parsed.

MetadataException

public MetadataException(java.lang.Exception cause,
                         TextMetadataParser.Key key,
                         java.lang.String alias)
Constructs an exception from the specified cause.

Parameters:
cause - The cause for this exception.
key - The metadata key which was the cause for this exception, or null if none. This is a format neutral key, for example TextMetadataParser.DATUM.
alias - The alias used for for the key key, or null if none. This is usually the name used in the external file parsed.
Method Detail

getMetadataKey

public TextMetadataParser.Key getMetadataKey()
Returns the metadata key which has raised this exception. This exception has usually been raised because no value was defined for this key, or the value was ambiguous.

Returns:
The metadata key, or null if none.

getMetadataAlias

public java.lang.String getMetadataAlias()
Returns the alias used for the key getMetadataKey(). This is usually the name used in the external file to be parsed. The alias is format-dependent, while the key (as returned by getMetadataKey()) if format neutral.

Returns:
The alias, or null if none.

toString

public java.lang.String toString()
Returns a string representation of this exception. This implementation is similar to Throwable.toString(), except that the string will includes key and alias names if they are defined. The localized message, if any, may be written on the next line. Example:
 org.geotools.coverage.io.MissingMetadataException(key="YMaximum", alias="ULY"):
 Aucune valeur n'est définie pour la propriété "ULY".
 

Overrides:
toString in class java.lang.Throwable


Copyright © 1996-2010 Geotools. All Rights Reserved.