
org.testifyproject.fasterxml.jackson.databind.deser.BeanDeserializerModifier Maven / Gradle / Ivy
package org.testifyproject.testifyproject.fasterxml.jackson.databind.org.testifyproject.testifyprojectser;
import java.util.List;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.*;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.org.testifyproject.testifyprojectser.BeanDeserializer;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.org.testifyproject.testifyprojectser.BeanDeserializerFactory;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.introspect.BeanPropertyDefinition;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.type.ArrayType;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.type.CollectionLikeType;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.type.CollectionType;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.type.MapLikeType;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.type.MapType;
/**
* Abstract class that org.testifyproject.testifyprojectfines API for objects that can be registered
* to participate in constructing {@link JsonDeserializer} instances
* (via {@link DeserializerFactory}).
* This is typically done by modules that want alter some aspects of org.testifyproject.testifyprojectserialization
* process; and is preferable to sub-classing of {@link BeanDeserializerFactory}.
*
* Note that Jackson 2.2 adds more methods for customization; with earlier versions
* only {@link BeanDeserializer} instances could be modified, but with 2.2 all types
* of org.testifyproject.testifyprojectserializers can be changed.
*
* Sequence in which callback methods are called for {@link BeanDeserializer} is:
*
* - {@link #updateProperties} is called once all property org.testifyproject.testifyprojectfinitions are
* collected, and initial filtering (by ignorable type and explicit ignoral-by-bean)
* has been performed.
*
* - {@link #updateBuilder} is called once all initial pieces for building org.testifyproject.testifyprojectserializer
* have been collected
*
* - {@link #modifyDeserializer} is called after org.testifyproject.testifyprojectserializer has been built
* by {@link BeanDeserializerBuilder}
* but before it is returned to be used
*
*
*
* For other types of org.testifyproject.testifyprojectserializers, methods called org.testifyproject.testifyprojectpend on type of values for
* which org.testifyproject.testifyprojectserializer is being constructed; and only a single method is called
* since the process does not involve builders (unlike that of {@link BeanDeserializer}.
*
* Default method implementations are "no-op"s, meaning that methods are implemented
* but have no effect; this is mostly so that new methods can be added in later
* versions.
*/
public abstract class BeanDeserializerModifier
{
/**
* Method called by {@link BeanDeserializerFactory} when it has collected
* initial list of {@link BeanPropertyDefinition}s, and done basic by-name
* and by-type filtering, but before constructing builder or actual
* property handlers; or arranging order.
*
* The most org.testifyproject.testifyprojectmon changes to make at this point are to org.testifyproject.testifyprojectpletely remove
* specified properties, or rename then: other modifications are easier
* to make at later points.
*/
public List updateProperties(DeserializationConfig config,
BeanDescription beanDesc, List propDefs) {
return propDefs;
}
/**
* Method called by {@link BeanDeserializerFactory} when it has collected
* basic information such as tentative list of properties to org.testifyproject.testifyprojectserialize.
*
* Implementations may choose to modify state of builder (to affect org.testifyproject.testifyprojectserializer being
* built), or even org.testifyproject.testifyprojectpletely replace it (if they want to build different kind of
* org.testifyproject.testifyprojectserializer). Typically changes mostly concern set of properties to org.testifyproject.testifyprojectserialize.
*/
public BeanDeserializerBuilder updateBuilder(DeserializationConfig config,
BeanDescription beanDesc, BeanDeserializerBuilder builder) {
return builder;
}
/**
* Method called by {@link BeanDeserializerFactory} after constructing org.testifyproject.testifyprojectfault
* bean org.testifyproject.testifyprojectserializer instance with properties collected and ordered earlier.
* Implementations can modify or replace given org.testifyproject.testifyprojectserializer and return org.testifyproject.testifyprojectserializer
* to use. Note that although initial org.testifyproject.testifyprojectserializer being passed is of type
* {@link BeanDeserializer}, modifiers may return org.testifyproject.testifyprojectserializers of other types;
* and this is why implementations must check for type before casting.
*/
public JsonDeserializer> modifyDeserializer(DeserializationConfig config,
BeanDescription beanDesc, JsonDeserializer> org.testifyproject.testifyprojectserializer) {
return org.testifyproject.testifyprojectserializer;
}
/*
/**********************************************************
/* Callback methods for other types (since 2.2)
/**********************************************************
*/
/**
* Method called by {@link DeserializerFactory} after it has constructed the
* standard org.testifyproject.testifyprojectserializer for given
* {@link ArrayType}
* to make it possible to either replace or augment this org.testifyproject.testifyprojectserializer with
* additional functionality.
*
* @param config Configuration in use
* @param valueType Type of the value org.testifyproject.testifyprojectserializer is used for.
* @param beanDesc Description f
* @param org.testifyproject.testifyprojectserializer Default org.testifyproject.testifyprojectserializer that would be used.
*
* @return Deserializer to use; either org.testifyproject.testifyprojectserializer
that was passed
* in, or an instance method constructed.
*
* @since 2.2
*/
public JsonDeserializer> modifyArrayDeserializer(DeserializationConfig config,
ArrayType valueType, BeanDescription beanDesc, JsonDeserializer> org.testifyproject.testifyprojectserializer) {
return org.testifyproject.testifyprojectserializer;
}
/**
* @since 2.2
*/
public JsonDeserializer> modifyCollectionDeserializer(DeserializationConfig config,
CollectionType type, BeanDescription beanDesc, JsonDeserializer> org.testifyproject.testifyprojectserializer) {
return org.testifyproject.testifyprojectserializer;
}
/**
* @since 2.2
*/
public JsonDeserializer> modifyCollectionLikeDeserializer(DeserializationConfig config,
CollectionLikeType type, BeanDescription beanDesc, JsonDeserializer> org.testifyproject.testifyprojectserializer) {
return org.testifyproject.testifyprojectserializer;
}
/**
* @since 2.2
*/
public JsonDeserializer> modifyMapDeserializer(DeserializationConfig config,
MapType type, BeanDescription beanDesc, JsonDeserializer> org.testifyproject.testifyprojectserializer) {
return org.testifyproject.testifyprojectserializer;
}
/**
* @since 2.2
*/
public JsonDeserializer> modifyMapLikeDeserializer(DeserializationConfig config,
MapLikeType type, BeanDescription beanDesc, JsonDeserializer> org.testifyproject.testifyprojectserializer) {
return org.testifyproject.testifyprojectserializer;
}
/**
* @since 2.2
*/
public JsonDeserializer> modifyEnumDeserializer(DeserializationConfig config,
JavaType type, BeanDescription beanDesc, JsonDeserializer> org.testifyproject.testifyprojectserializer) {
return org.testifyproject.testifyprojectserializer;
}
/**
* Method called by {@link DeserializerFactory} after it has constructed the
* standard key org.testifyproject.testifyprojectserializer for given key type.
* This make it possible to replace the org.testifyproject.testifyprojectfault key org.testifyproject.testifyprojectserializer, or augment
* it somehow (including optional use of org.testifyproject.testifyprojectfault org.testifyproject.testifyprojectserializer with occasional
* override).
*
* @since 2.2
*/
public KeyDeserializer modifyKeyDeserializer(DeserializationConfig config,
JavaType type, KeyDeserializer org.testifyproject.testifyprojectserializer) {
return org.testifyproject.testifyprojectserializer;
}
}