org.geotools.referencing.wkt
Class UnformattableObjectException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by java.lang.UnsupportedOperationException
                  extended by org.geotools.referencing.wkt.UnformattableObjectException
All Implemented Interfaces:
java.io.Serializable

public class UnformattableObjectException
extends java.lang.UnsupportedOperationException

Thrown by Formattable.toWKT() when an object can't be formatted as WKT. A formatting may fails because an object is too complex for the WKT format capability (for example an engineering CRS with different unit for each axis), or because only some specific implementations can be formatted as WKT.

Since:
2.0
Version:
$Id: UnformattableObjectException.java 30641 2008-06-12 17:42:27Z acuster $
Author:
Martin Desruisseaux (IRD)
See Also:
Formatter.setInvalidWKT(java.lang.Class), Serialized Form

Constructor Summary
UnformattableObjectException(java.lang.String message)
          Deprecated. Replaced by UnformattableObjectException(String, Class).
UnformattableObjectException(java.lang.String message, java.lang.Class unformattable)
          Constructs an exception with the specified detail message.
 
Method Summary
 java.lang.String getMessage()
          Returns the detail message.
 java.lang.Class getUnformattableClass()
          Returns the type of the object that can't be formatted.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnformattableObjectException

public UnformattableObjectException(java.lang.String message)
Deprecated. Replaced by UnformattableObjectException(String, Class).

Constructs an exception with the specified detail message.

Parameters:
message - The detail message.

UnformattableObjectException

public UnformattableObjectException(java.lang.String message,
                                    java.lang.Class unformattable)
Constructs an exception with the specified detail message.

Parameters:
message - The detail message. If null, a default message will be created.
unformattable - The type of the object that can't be formatted.
Since:
2.4
Method Detail

getUnformattableClass

public java.lang.Class getUnformattableClass()
Returns the type of the object that can't be formatted. This is often an OpenGIS interface rather than the implementation class. For example if a engineering CRS uses different unit for each axis, then this method may return CoordinateReferenceSystem.class. It doesn't mean that no CRS can be formatted; only that a particular instance of it can't. Other possible classes are ImageDatum, ProjectedCRS, etc.

Since:
2.4

getMessage

public java.lang.String getMessage()
Returns the detail message. A default message is formatted if none was specified at construction time.

Overrides:
getMessage in class java.lang.Throwable


Copyright © 1996-2010 Geotools. All Rights Reserved.