Class JSONObjectException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
com.fasterxml.jackson.core.JacksonException
com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.jr.ob.JSONObjectException
All Implemented Interfaces:
Serializable

public class JSONObjectException extends com.fasterxml.jackson.core.JsonProcessingException
Standard exception exposed by this package; equivalent of com.fasterxml.jackson.databind.JsonMappingException (and, in fact, much of implementation came from that class, but had to be cut-n-pasted since we do not depend on databind package).
See Also:
  • Field Details

  • Constructor Details

    • JSONObjectException

      public JSONObjectException(String msg)
    • JSONObjectException

      public JSONObjectException(String msg, Throwable rootCause)
    • JSONObjectException

      public JSONObjectException(String msg, com.fasterxml.jackson.core.JsonLocation loc)
    • JSONObjectException

      public JSONObjectException(String msg, com.fasterxml.jackson.core.JsonLocation loc, Throwable rootCause)
  • Method Details

    • from

      public static JSONObjectException from(com.fasterxml.jackson.core.JsonParser p, String msg)
    • from

      public static JSONObjectException from(com.fasterxml.jackson.core.JsonParser p, String msg, Object... args)
    • from

      public static JSONObjectException from(com.fasterxml.jackson.core.JsonParser p, Throwable problem, String msg, Object... args)
    • fromUnexpectedIOE

      public static JSONObjectException fromUnexpectedIOE(IOException src)
      Factory method used when "upgrading" an IOException into JSONObjectException: usually only needed to comply with a signature.
    • wrapWithPath

      public static JSONObjectException 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. This version of method is called when the reference is through a non-indexed object, such as a Map or POJO/bean.
    • wrapWithPath

      public static JSONObjectException 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. This version of method is called when the reference is through an index, which happens with arrays and Collections.
    • wrapWithPath

      public static JSONObjectException wrapWithPath(Throwable src, JSONObjectException.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.
    • getPath

      Method for accessing full structural path within type hierarchy down to problematic property.
    • getPathReference

      public String getPathReference()
      Method for accesing description of path that lead to the problem that triggered this exception
    • getPathReference

      public StringBuilder getPathReference(StringBuilder sb)
    • prependPath

      public void prependPath(Object referrer, String fieldName)
      Method called to prepend a reference information in front of current path
    • prependPath

      public void prependPath(Object referrer, int index)
      Method called to prepend a reference information in front of current path
    • prependPath

      public void prependPath(JSONObjectException.Reference r)
    • getLocalizedMessage

      public String getLocalizedMessage()
      Overrides:
      getLocalizedMessage in class Throwable
    • getMessage

      public String getMessage()
      Method is overridden so that we can properly inject description of problem path, if such is defined.
      Overrides:
      getMessage in class com.fasterxml.jackson.core.JsonProcessingException
    • _buildMessage

      protected String _buildMessage()
    • toString

      public String toString()
      Overrides:
      toString in class com.fasterxml.jackson.core.JsonProcessingException
    • _appendPathDesc

      protected void _appendPathDesc(StringBuilder sb)