Class CollectedProblem

java.lang.Object
tools.jackson.databind.exc.CollectedProblem

public final class CollectedProblem extends Object
Immutable value object capturing details about a single deserialization problem encountered during error-collecting mode.

Contents: Each problem records:

  • path - RFC 6901 JSON Pointer to the problematic field (e.g., "/items/2/price")
  • message - Human-readable error description
  • targetType - Expected Java type (may be null)
  • location - Source location in JSON (line/column)
  • rawValue - Original value from JSON that caused the error (truncated if > 200 chars)
  • token - JSON token type at error location

Truncation: String values longer than #MAX_RAW_VALUE_LENGTH (currently: 200) characters are truncated with "..." suffix to prevent memory issues.

Unknown properties: For unknown property errors, rawValue is null since the property name is already in the path.

Immutability: All instances are immutable and thread-safe.

Since:
3.1
See Also:
  • Constructor Details

    • CollectedProblem

      public CollectedProblem(tools.jackson.core.JsonPointer path, String message, JavaType targetType, tools.jackson.core.TokenStreamLocation location, Object rawValue, tools.jackson.core.JsonToken token)
  • Method Details

    • getPath

      public tools.jackson.core.JsonPointer getPath()
      Returns:
      JSON Pointer path to the problematic field (e.g., "/items/1/date"). Empty string ("") for root-level problems.
    • getMessage

      public String getMessage()
      Returns:
      Human-readable error message
    • getTargetType

      public JavaType getTargetType()
      Returns:
      Expected Java type for the field (may be null)
    • getLocation

      public tools.jackson.core.TokenStreamLocation getLocation()
      Returns:
      Location in source JSON where problem occurred (may be null)
    • getRawValue

      public Object getRawValue()
      Returns:
      Raw value from JSON that caused the problem (may be null or truncated). For unknown properties, this is null; use the path to identify the property name.
    • getToken

      public tools.jackson.core.JsonToken getToken()
      Returns:
      JSON token type at the error location (may be null)
    • toString

      public String toString()
      Overrides:
      toString in class Object