java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
tools.jackson.core.JacksonException
tools.jackson.databind.DatabindException
tools.jackson.databind.exc.DeferredBindingException
- All Implemented Interfaces:
Serializable
Exception that aggregates multiple recoverable deserialization problems
encountered during problem-collecting mode.
Usage: This exception is thrown by
ObjectReader.readValueCollectingProblems(...)
when one or more recoverable problems were collected during deserialization.
Enable problem collection via ObjectReader.problemCollectingReader().
Problem access: Each problem is captured as a CollectedProblem
containing the JSON Pointer path, error message, location, target type, raw value, and token.
Access problems via getProblems().
Limit handling: When the configured problem limit is reached, collection
stops and isLimitReached() returns true. This indicates additional
problems may exist beyond those collected.
Message formatting: The exception message shows:
- For 1 problem: the single error message
- For multiple: count + first 5 problems + "...and N more" suffix
- A "limit reached" note if applicable
Example:
try {
MyBean bean = reader.problemCollectingReader()
.readValueCollectingProblems(json);
} catch (DeferredBindingException e) {
for (CollectedProblem p : e.getProblems()) {
System.err.println("Error at " + p.getPath() + ": " + p.getMessage());
}
}
- Since:
- 3.1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.core.JacksonException
tools.jackson.core.JacksonException.Reference -
Field Summary
Fields inherited from class tools.jackson.core.JacksonException
_location, _path, _processor -
Constructor Summary
ConstructorsConstructorDescriptionDeferredBindingException(tools.jackson.core.JsonParser p, List<CollectedProblem> problems, boolean limitReached) -
Method Summary
Modifier and TypeMethodDescriptionintbooleanMethods inherited from class tools.jackson.databind.DatabindException
from, from, from, from, from, from, from, from, wrapWithPath, wrapWithPathMethods inherited from class tools.jackson.core.JacksonException
_appendPathDesc, _appendReferenceChain, _buildMessage, _exceptionMessage, clearLocation, getLocalizedMessage, getLocation, getMessage, getOriginalMessage, getPath, getPathReference, getPathReference, messageSuffix, prependPath, prependPath, prependPath, processor, toString, withCause, wrapWithPath, wrapWithPath, wrapWithPath, wrapWithPathMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
DeferredBindingException
public DeferredBindingException(tools.jackson.core.JsonParser p, List<CollectedProblem> problems, boolean limitReached)
-
-
Method Details
-
getProblems
- Returns:
- Unmodifiable list of all collected problems
-
getProblemCount
public int getProblemCount()- Returns:
- Number of problems collected
-
isLimitReached
public boolean isLimitReached()- Returns:
- true if error collection stopped due to reaching the configured limit
-