Package org.codehaus.jackson.map
Class JsonMappingException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.codehaus.jackson.JsonProcessingException
org.codehaus.jackson.map.JsonMappingException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
UnrecognizedPropertyException
Checked exception used to signal fatal problems with mapping of
content.
One additional feature is the ability to denote relevant path of references (during serialization/deserialization) to help in troubleshooting.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Simple bean class used to contain references. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedList<JsonMappingException.Reference>
Path through which problem that triggering throwing of this exception was reached.Fields inherited from class org.codehaus.jackson.JsonProcessingException
mLocation
-
Constructor Summary
ConstructorsConstructorDescriptionJsonMappingException
(String msg, Throwable rootCause) JsonMappingException
(String msg, JsonLocation loc) JsonMappingException
(String msg, JsonLocation loc, Throwable rootCause) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
static JsonMappingException
from
(JsonParser jp, String msg) static JsonMappingException
from
(JsonParser jp, String msg, Throwable problem) Method is overridden so that we can properly inject description of problem path, if such is defined.getPath()
void
prependPath
(Object referrer, int index) Method called to prepend a reference information in front of current pathvoid
prependPath
(Object referrer, String fieldName) Method called to prepend a reference information in front of current pathvoid
toString()
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.static JsonMappingException
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.Methods inherited from class org.codehaus.jackson.JsonProcessingException
getLocation
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
_path
Path through which problem that triggering throwing of this exception was reached.
-
-
Constructor Details
-
JsonMappingException
-
JsonMappingException
-
JsonMappingException
-
JsonMappingException
-
-
Method Details
-
from
-
from
-
wrapWithPath
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. This version of method is called when the reference is through a non-indexed object, such as a Map or POJO/bean. -
wrapWithPath
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. This version of method is called when the reference is through an index, which happens with arrays and Collections. -
wrapWithPath
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. -
getPath
-
prependPath
Method called to prepend a reference information in front of current path -
prependPath
Method called to prepend a reference information in front of current path -
prependPath
-
getMessage
Method is overridden so that we can properly inject description of problem path, if such is defined.- Overrides:
getMessage
in classJsonProcessingException
-
toString
- Overrides:
toString
in classJsonProcessingException
-
_appendPathDesc
-