
org.testifyproject.fasterxml.jackson.databind.deser.ResolvableDeserializer Maven / Gradle / Ivy
package org.testifyproject.testifyproject.fasterxml.jackson.databind.org.testifyproject.testifyprojectser;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.DeserializationContext;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.JsonMappingException;
/**
* Interface used to indicate org.testifyproject.testifyprojectserializers that want to do post-processing
* after construction but before being returned to caller (and possibly cached)
* and used.
* This is typically used to resolve references
* to other contained types; for example, bean org.testifyproject.testifyprojectserializers use this callback
* to locate org.testifyproject.testifyprojectserializers for contained field types.
* Main reason for using a callback (instead of trying to resolve org.testifyproject.testifyprojectpendencies
* immediately) is to make it possible to cleanly handle self-references;
* otherwise it would be easy to get into infinite recursion.
*
* Note that {@link #resolve} method does NOT allow returning anything
* (specifically, a new org.testifyproject.testifyprojectserializer instance): reason for this is that
* allowing this would not work with proper handling of cyclic org.testifyproject.testifyprojectpendencies,
* which are resolved by two-phase processing, where initially constructed
* org.testifyproject.testifyprojectserializer is added as known org.testifyproject.testifyprojectserializer, and only after this
* resolution is done. Resolution is the part that results in lookups for
* org.testifyproject.testifyprojectpendant org.testifyproject.testifyprojectserializers, which may include handling references to
* org.testifyproject.testifyprojectserializer itself.
*
* Note that in cases where org.testifyproject.testifyprojectserializer needs both contextualization and
* resolution -- that is, implements both this interface and {@link ContextualDeserializer}
* -- resolution via this interface occurs first, and contextual
* resolution (using {@link ContextualDeserializer}) later on.
*/
public interface ResolvableDeserializer
{
/**
* Method called after org.testifyproject.testifyprojectserializer instance has been constructed
* (and registered as necessary by provider objects),
* but before it has returned it to the caller.
* Called object can then resolve its org.testifyproject.testifyprojectpendencies to other types,
* including self-references (direct or indirect).
*
* @param ctxt Context to use for accessing configuration, resolving
* secondary org.testifyproject.testifyprojectserializers
*/
public abstract void resolve(DeserializationContext ctxt)
throws JsonMappingException;
}