Package org.apache.sis.io.wkt

# Class UnparsableObjectException

Object
Throwable
Exception
ParseException
UnparsableObjectException

All Implemented Interfaces:
  `Serializable`, `LocalizedException`

public class UnparsableObjectException extends ParseException implements LocalizedException
Thrown when a Well Known Text (WKT) can not be parsed.

## Localization

This exception may contain the error message in two languages:

- `getMessage()` returns the message in the default locale. In a client-server architecture, this is typically the locale on the server side.
- `getLocalizedMessage()` returns the message in the locale given in argument to the `WKTFormat` constructor. In a client-server architecture, it is presumably the locale on the client side.

Since:
  0.8
See Also:
  - Serialized Form

Defined in the `sis-referencing` module

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UnparsableObjectException(String message, int errorOffset)`
  Creates an exception with the specified details message.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `InternationalString`
  `getInternationalMessage()`
  If this exception is capable to return the message in various locales, returns that message.
  `String`
  `getLocalizedMessage()`
  Returns a localized version of the exception message, typically for final user.
  `String`
  `getMessage()`
  Returns the exception message in the default locale, typically for system administrator.
  `UnparsableObjectException`
  `initCause(Throwable cause)`
  Initializes the cause of this throwable to the specified value.

  ### Methods inherited from class ParseException

  `getErrorOffset`

  ### Methods inherited from class Throwable

  `addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### UnparsableObjectException

    public UnparsableObjectException(String message, int errorOffset)
    Creates an exception with the specified details message.
    Parameters:
      `message` - the detail message in the default locale.
      `errorOffset` - the position where the error is found while parsing.

- ## Method Details

  - ### getMessage

    public String getMessage()
    Returns the exception message in the default locale, typically for system administrator.
    Specified by:
      `getMessage` in interface `LocalizedException`
    Overrides:
      `getMessage` in class `Throwable`
    Returns:
      the message of this exception.

  - ### getLocalizedMessage

    public String getLocalizedMessage()
    Returns a localized version of the exception message, typically for final user. This is often the same message than the one returned by `getMessage()`, but may in some occasions be in a different language if `WKTFormat` has been constructed with a different locale.
    Specified by:
      `getLocalizedMessage` in interface `LocalizedException`
    Overrides:
      `getLocalizedMessage` in class `Throwable`
    Returns:
      the localized message of this exception.

  - ### getInternationalMessage

    public InternationalString getInternationalMessage()
    If this exception is capable to return the message in various locales, returns that message. Otherwise returns `null`.
    Specified by:
      `getInternationalMessage` in interface `LocalizedException`
    Returns:
      the exception message, or `null` if this exception can not produce international message.

  - ### initCause

    public UnparsableObjectException initCause(Throwable cause)
    Initializes the cause of this throwable to the specified value.
    Overrides:
      `initCause` in class `Throwable`
    Parameters:
      `cause` - the cause saved for later retrieval by the `Throwable​.getCause()` method.
    Returns:
      a reference to this `UnparsableObjectException` instance.