Skip to content

Commit ea9c999

Browse files
committed
Refactor type resolver (TypeSerializer, TypeDeserializer) construction, remove from AnnotationIntrospector, add TypeResolverProvider
1 parent 75b1bd3 commit ea9c999

28 files changed

+713
-546
lines changed

src/main/java/com/fasterxml/jackson/databind/AnnotationIntrospector.java

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import com.fasterxml.jackson.databind.deser.ValueInstantiator;
1616
import com.fasterxml.jackson.databind.introspect.*;
1717
import com.fasterxml.jackson.databind.jsontype.NamedType;
18-
import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder;
1918
import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
2019
import com.fasterxml.jackson.databind.util.Converter;
2120
import com.fasterxml.jackson.databind.util.NameTransformer;
@@ -175,7 +174,7 @@ public boolean isAnnotationBundle(Annotation ann) {
175174
/* Annotations for Object Id handling
176175
/**********************************************************************
177176
*/
178-
177+
179178
/**
180179
* Method for checking whether given annotated thing
181180
* (type, or accessor) indicates that values
@@ -298,8 +297,21 @@ public VisibilityChecker findAutoDetectVisibility(AnnotatedClass ac, VisibilityC
298297
*
299298
* @since 3.0
300299
*/
301-
public JsonTypeInfo.Value findPolymorphicTypeInfo(MapperConfig<?> config,
302-
Annotated ann) {
300+
public JsonTypeInfo.Value findPolymorphicTypeInfo(MapperConfig<?> config, Annotated ann) {
301+
return null;
302+
}
303+
304+
/**
305+
* @since 3.0
306+
*/
307+
public Object findTypeResolverBuilder(MapperConfig<?> config, Annotated ann) {
308+
return null;
309+
}
310+
311+
/**
312+
* @since 3.0
313+
*/
314+
public Object findTypeIdResolver(MapperConfig<?> config, Annotated ann) {
303315
return null;
304316
}
305317

@@ -316,10 +328,12 @@ public JsonTypeInfo.Value findPolymorphicTypeInfo(MapperConfig<?> config,
316328
*
317329
* @return Type resolver builder for given type, if one found; null if none
318330
*/
331+
/*
319332
public TypeResolverBuilder<?> findTypeResolver(MapperConfig<?> config,
320333
Annotated ann, JavaType baseType, JsonTypeInfo.Value typeInfo) {
321334
return null;
322335
}
336+
*/
323337

324338
/**
325339
* Method for checking if given property entity (field or method) has annotations
@@ -335,10 +349,12 @@ public TypeResolverBuilder<?> findTypeResolver(MapperConfig<?> config,
335349
* @return Type resolver builder for properties of given entity, if one found;
336350
* null if none
337351
*/
352+
/*
338353
public TypeResolverBuilder<?> findPropertyTypeResolver(MapperConfig<?> config,
339354
Annotated ann, JavaType baseType, JsonTypeInfo.Value typeInfo) {
340355
return null;
341356
}
357+
*/
342358

343359
/**
344360
* Method for checking if given structured property entity (field or method that
@@ -355,11 +371,13 @@ public TypeResolverBuilder<?> findPropertyTypeResolver(MapperConfig<?> config,
355371
*
356372
* @return Type resolver builder for values contained in properties of given entity,
357373
* if one found; null if none
358-
*/
374+
*/
375+
/*
359376
public TypeResolverBuilder<?> findPropertyContentTypeResolver(MapperConfig<?> config,
360377
Annotated ann, JavaType containerType, JsonTypeInfo.Value typeInfo) {
361378
return null;
362379
}
380+
*/
363381

364382
/**
365383
* Method for locating annotation-specified subtypes related to annotated
@@ -370,21 +388,21 @@ public TypeResolverBuilder<?> findPropertyContentTypeResolver(MapperConfig<?> co
370388
*
371389
* @param a Annotated entity (class, field/method) to check for annotations
372390
*/
373-
public List<NamedType> findSubtypes(Annotated a) { return null; }
391+
public List<NamedType> findSubtypes(MapperConfig<?> config, Annotated a) { return null; }
374392

375393
/**
376394
* Method for checking if specified type has explicit name.
377395
*
378396
* @param ac Class to check for type name annotations
379397
*/
380-
public String findTypeName(AnnotatedClass ac) { return null; }
398+
public String findTypeName(MapperConfig<?> config, AnnotatedClass ac) { return null; }
381399

382400
/**
383401
* Method for checking whether given accessor claims to represent
384402
* type id: if so, its value may be used as an override,
385403
* instead of generated type id.
386404
*/
387-
public Boolean isTypeId(AnnotatedMember member) { return null; }
405+
public Boolean isTypeId(MapperConfig<?> config, AnnotatedMember member) { return null; }
388406

389407
/*
390408
/**********************************************************

0 commit comments

Comments
 (0)