package sh.calaba.org.codehaus.jackson.map.module; import java.lang.reflect.Modifier; import java.util.*; import sh.calaba.org.codehaus.jackson.map.AbstractTypeResolver; import sh.calaba.org.codehaus.jackson.map.DeserializationConfig; import sh.calaba.org.codehaus.jackson.map.type.ClassKey; import sh.calaba.org.codehaus.jackson.type.JavaType; /** * Simple {@link AbstractTypeResolver} implementation, which is * based on static mapping from abstract super types into * sub types (concrete or abstract), but retaining generic * parameterization. * Can be used for things like specifying which implementation of * {@link java.util.Collection} to use: *
* SimpleAbstractTypeResolver resolver = new SimpleAbstractTypeResolver(); * // To make all properties declared as Collection, List, to LinkedList * resolver.addMapping(Collection.class, LinkedList.class); * resolver.addMapping(List.class, LinkedList.class); ** Can also be used as an alternative to per-class annotations when defining * concrete implementations; however, only works with abstract types (since * this is only called for abstract types) * * @since 1.8 */ public class SimpleAbstractTypeResolver extends AbstractTypeResolver { /** * Mappings from super types to subtypes */ protected final HashMap
superType
* is abstract (since resolver is never called for concrete classes);
* as well as to ensure that there is supertype/subtype relationship
* (to ensure there won't be cycles during resolution).
*
* @param superType Abstract type to resolve
* @param subType Sub-class of superType, to map superTo to
*
* @return This resolver, to allow chaining of initializations
*/
public