public class JsonMappingException extends JsonProcessingException
One additional feature is the ability to denote relevant path of references (during serialization/deserialization) to help in troubleshooting.
Modifier and Type | Class and Description |
---|---|
static class |
JsonMappingException.Reference
Simple bean class used to contain references.
|
Modifier and Type | Field and Description |
---|---|
protected LinkedList<JsonMappingException.Reference> |
_path
Path through which problem that triggering throwing of
this exception was reached.
|
mLocation
Constructor and Description |
---|
JsonMappingException(String msg) |
JsonMappingException(String msg,
JsonLocation loc) |
JsonMappingException(String msg,
JsonLocation loc,
Throwable rootCause) |
JsonMappingException(String msg,
Throwable rootCause) |
Modifier and Type | Method and Description |
---|---|
protected void |
_appendPathDesc(StringBuilder sb) |
static JsonMappingException |
from(JsonParser jp,
String msg) |
static JsonMappingException |
from(JsonParser jp,
String msg,
Throwable problem) |
String |
getMessage()
Method is overridden so that we can properly inject description
of problem path, if such is defined.
|
List<JsonMappingException.Reference> |
getPath() |
void |
prependPath(JsonMappingException.Reference r) |
void |
prependPath(Object referrer,
int index)
Method called to prepend a reference information in front of
current path
|
void |
prependPath(Object referrer,
String fieldName)
Method called to prepend a reference information in front of
current path
|
String |
toString() |
static JsonMappingException |
wrapWithPath(Throwable src,
JsonMappingException.Reference ref)
Method that can be called to either create a new JsonMappingException
(if underlying exception is not a JsonMappingException), or augment
given exception with given path/reference information.
|
static JsonMappingException |
wrapWithPath(Throwable src,
Object refFrom,
int index)
Method that can be called to either create a new JsonMappingException
(if underlying exception is not a JsonMappingException), or augment
given exception with given path/reference information.
|
static JsonMappingException |
wrapWithPath(Throwable src,
Object refFrom,
String refFieldName)
Method that can be called to either create a new JsonMappingException
(if underlying exception is not a JsonMappingException), or augment
given exception with given path/reference information.
|
getLocation
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
protected LinkedList<JsonMappingException.Reference> _path
public JsonMappingException(String msg)
public JsonMappingException(String msg, JsonLocation loc)
public JsonMappingException(String msg, JsonLocation loc, Throwable rootCause)
public static JsonMappingException from(JsonParser jp, String msg)
public static JsonMappingException from(JsonParser jp, String msg, Throwable problem)
public static JsonMappingException wrapWithPath(Throwable src, Object refFrom, String refFieldName)
public static JsonMappingException wrapWithPath(Throwable src, Object refFrom, int index)
public static JsonMappingException wrapWithPath(Throwable src, JsonMappingException.Reference ref)
public List<JsonMappingException.Reference> getPath()
public void prependPath(Object referrer, String fieldName)
public void prependPath(Object referrer, int index)
public void prependPath(JsonMappingException.Reference r)
public String getMessage()
getMessage
in class JsonProcessingException
public String toString()
toString
in class JsonProcessingException
protected void _appendPathDesc(StringBuilder sb)