Class JacksonException.Reference

java.lang.Object
tools.jackson.core.JacksonException.Reference
All Implemented Interfaces:
Serializable
Enclosing class:
JacksonException

public static class JacksonException.Reference extends Object implements Serializable
Simple bean class used to contain references. References can be added to indicate execution/reference path that lead to the problem that caused this exception to be thrown.
Since:
3.0 (in 2.x was part of databind-level exceptions only)
See Also:
  • Field Details

    • _from

      protected transient Object _from
    • _propertyName

      protected String _propertyName
      Name of property (for POJO) or key (for Maps) that is part of the reference. May be null for Collection types (which generally have _index defined), or when resolving Map classes without (yet) having an instance to operate on.
    • _index

      protected int _index
      Index within a Collection instance that contained the reference; used if index is relevant and available. If either not applicable, or not available, -1 is used to denote "not known" (or not relevant).
    • _desc

      protected String _desc
      Lazily-constructed description of this instance; needed mostly to allow JDK serialization to work in case where _from is non-serializable (and has to be dropped) but we still want to pass actual description along.
  • Constructor Details

    • Reference

      protected Reference()
      Default constructor for deserialization purposes
    • Reference

      public Reference(Object from)
    • Reference

      public Reference(Object from, String propertyName)
    • Reference

      public Reference(Object from, int index)
  • Method Details

    • from

      public Object from()
      Object through which reference was resolved. Can be either actual instance (usually the case for serialization), or Class (usually the case for deserialization).

      Note that this the accessor is not a getter on purpose as we cannot (in general) serialize/deserialize this reference

    • getPropertyName

      public String getPropertyName()
    • getIndex

      public int getIndex()
    • getDescription

      public String getDescription()
    • toString

      public String toString()
      Overrides:
      toString in class Object