Class JsonException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.github.cliftonlabs.json_simple.JsonException
-
- All Implemented Interfaces:
java.io.Serializable
public class JsonException extends java.lang.Exception
JsonException explains how and where the problem occurs in the source JSON text during deserialization.- Since:
- 3.0.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JsonException.Problems
The kinds of exceptions that can trigger a JsonException.
-
Constructor Summary
Constructors Constructor Description JsonException(int position, JsonException.Problems problemType, java.lang.Object unexpectedObject)
Instantiates a JsonException without assumptions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getMessage()
int
getPosition()
Helps debug the location of a problem.JsonException.Problems
getProblemType()
Helps find an appropriate solution for a problem.java.lang.Object
getUnexpectedObject()
Helps identify the problem.
-
-
-
Constructor Detail
-
JsonException
public JsonException(int position, JsonException.Problems problemType, java.lang.Object unexpectedObject)
Instantiates a JsonException without assumptions.- Parameters:
position
- where the exception occurred.problemType
- how the exception occurred.unexpectedObject
- what caused the exception.
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
- Overrides:
getMessage
in classjava.lang.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 JsonException.Problems getProblemType()
Helps find an appropriate solution for a problem.- Returns:
- the enumeration for how the exception occurred.
-
getUnexpectedObject
public java.lang.Object getUnexpectedObject()
Helps identify the problem.- Returns:
- a representation of what caused the exception.
-
-