Package org.json.simple

# Class DeserializationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.json.simple.DeserializationException

All Implemented Interfaces:
  `Serializable`

public class DeserializationException extends Exception
DeserializationException explains how and where the problem occurs in the source JSON text during deserialization.

Since:
  2.0.0
See Also:
  - Serialized Form

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`DeserializationException.Problems`
The kinds of exceptions that can trigger a DeserializationException.

## Constructor Summary

Constructors
Constructor
Description
`DeserializationException(int position, DeserializationException.Problems problemType, Object unexpectedObject)`
Instantiates a DeserializationException without assumptions.

## Method Summary

Modifier and Type
Method
Description
`String`
`getMessage()`
`int`
`getPosition()`
Helps debug the location of a problem.
`DeserializationException.Problems`
`getProblemType()`
Helps find an appropriate solution for a problem.
`Object`
`getUnexpectedObject()`
Helps identify the problem.

### Methods inherited from class java.lang.Throwable

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

### Methods inherited from class java.lang.Object

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

## Constructor Details

### DeserializationException

public DeserializationException(int position, DeserializationException.Problems problemType, Object unexpectedObject)
Instantiates a DeserializationException without assumptions.

Parameters:
  `position` - where the exception occurred.
  `problemType` - how the exception occurred.
  `unexpectedObject` - what caused the exception.

## Method Details

### getMessage

public String getMessage()

Overrides:
  `getMessage` in class `Throwable`

### getPosition

public int getPosition()
Helps debug the location of a problem.

Returns:
  an index of the string character the error type occurred at.

### getProblemType

public DeserializationException.Problems getProblemType()
Helps find an appropriate solution for a problem.

Returns:
  the enumeration for how the exception occurred.

### getUnexpectedObject

public Object getUnexpectedObject()
Helps identify the problem.

Returns:
  a representation of what caused the exception.