org.geotoolkit.io.wkt
Class UnformattableObjectException

Object
  extended by Throwable
      extended by Exception
          extended by RuntimeException
              extended by UnsupportedOperationException
                  extended by UnformattableObjectException
All Implemented Interfaces:
Serializable

public class UnformattableObjectException
extends UnsupportedOperationException

Thrown by FormattableObject.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:
3.16
Author:
Martin Desruisseaux (IRD)
See Also:
Formatter.setInvalidWKT(java.lang.Class), Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

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

Constructor Detail

UnformattableObjectException

public UnformattableObjectException(Class<?> unformattable)
Constructs an exception with a default detail message.

Parameters:
unformattable - The type of the object that can't be formatted.
Since:
3.00

UnformattableObjectException

public UnformattableObjectException(String message,
                                    Class<?> unformattable)
Constructs an exception with the specified detail message. If the given message is null, then a default message will be created for the given class.

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

getUnformattableClass

public 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.

Returns:
The class of the object that can't be formatted.
Since:
2.4


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