• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.fasterxml.jackson.databind.annotation;
2 
3 import java.lang.annotation.*;
4 
5 import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder;
6 
7 /**
8  * Annotation that can be used to explicitly define custom resolver
9  * used for handling serialization and deserialization of type information,
10  * needed for handling of polymorphic types (or sometimes just for linking
11  * abstract types to concrete types)
12  *<p>
13  * NOTE: since 2.4, applicable to properties as well (should have been long time
14  *  ago, but problem only found then)
15  */
16 @Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, ElementType.PARAMETER})
17 @Retention(RetentionPolicy.RUNTIME)
18 @com.fasterxml.jackson.annotation.JacksonAnnotation
19 public @interface JsonTypeResolver
20 {
21     /**
22      * Defines implementation class of {@link TypeResolverBuilder} which is used to construct
23      * actual {@link com.fasterxml.jackson.databind.jsontype.TypeDeserializer} and {@link com.fasterxml.jackson.databind.jsontype.TypeDeserializer}
24      * instances that handle reading and writing addition type information needed to support polymorphic
25      * deserialization.
26      */
value()27     public Class<? extends TypeResolverBuilder<?>> value();
28 }
29