java.lang.Object
java.lang.Throwable
java.lang.Exception
org.json.simple.DeserializationException
- All Implemented Interfaces:
Serializable
DeserializationException explains how and where the problem occurs in the source JSON text during deserialization.
- See Also:
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe kinds of exceptions that can trigger a DeserializationException.Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intPositionprivate final DeserializationException.ProblemsProblem typeprivate static final longPinned for serialized-form compatibility.private final ObjectUnexpected objectConstructor Summary
ConstructorsConstructorDescriptionDeserializationException(int position, DeserializationException.Problems problemType, Object unexpectedObject) Instantiates a DeserializationException without assumptions.Method Summary
All MethodsModifier and TypeMethodDescriptionBuilds the recovery advice for the problem type, naming the position.intHelps debug the location of a problem.Helps find an appropriate solution for a problem.Helps identify the problem.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Field Details
serialVersionUID
private static final long serialVersionUIDPinned for serialized-form compatibility.- See Also:
position
private final int positionPositionproblemType
Problem typeunexpectedObject
Unexpected object
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
Builds the recovery advice for the problem type, naming the position.- Overrides:
getMessagein classThrowable
getPosition
public int getPosition()Helps debug the location of a problem.- Returns:
- an index of the string character the error type occurred at.
getProblemType
Helps find an appropriate solution for a problem.- Returns:
- the enumeration for how the exception occurred.
getUnexpectedObject
Helps identify the problem.- Returns:
- a representation of what caused the exception.