14
14
*/
15
15
public abstract class SubtypeResolver
16
16
{
17
+ /*
18
+ /**********************************************************
19
+ /* Methods for registering external subtype definitions
20
+ /**********************************************************
21
+ */
22
+
17
23
/**
18
24
* Method for registering specified subtypes (possibly including type
19
25
* names); for type entries without name, non-qualified class name
@@ -23,22 +29,107 @@ public abstract class SubtypeResolver
23
29
24
30
public abstract void registerSubtypes (Class <?>... classes );
25
31
32
+ /*
33
+ /**********************************************************
34
+ /* Subtype resolution
35
+ /**********************************************************
36
+ */
37
+
38
+ /**
39
+ * Method for finding out all reachable subtypes for a property specified
40
+ * by given element (method or field),
41
+ * such that access is by type,
42
+ * typically needed for serialization (converting from type to type name).
43
+ *
44
+ * @param baseType Effective property base type to use; may differ from
45
+ * actual type of property; for structured types it is content (value) type and NOT
46
+ * structured type.
47
+ *
48
+ * @since 2.6
49
+ */
50
+ public Collection <NamedType > collectAndResolveSubtypesByClass (MapperConfig <?> config ,
51
+ AnnotatedMember property , JavaType baseType ) {
52
+ // for backwards compatibility...
53
+ return collectAndResolveSubtypes (property , config ,
54
+ config .getAnnotationIntrospector (), baseType );
55
+ }
56
+
57
+ /**
58
+ * Method for finding out all reachable subtypes for given type,
59
+ * such that access is by type,
60
+ * typically needed for serialization (converting from type to type name).
61
+ *
62
+ * @param baseType Effective property base type to use; may differ from
63
+ * actual type of property; for structured types it is content (value) type and NOT
64
+ * structured type.
65
+ *
66
+ * @since 2.6
67
+ */
68
+ public Collection <NamedType > collectAndResolveSubtypesByClass (MapperConfig <?> config ,
69
+ AnnotatedClass baseType ) {
70
+ // for backwards compatibility...
71
+ return collectAndResolveSubtypes (baseType , config , config .getAnnotationIntrospector ());
72
+ }
73
+
26
74
/**
27
75
* Method for finding out all reachable subtypes for a property specified
28
- * by given element (method or field)
76
+ * by given element (method or field),
77
+ * such that access is by type id,
78
+ * typically needed for deserialization (converting from type id to type).
29
79
*
30
80
* @param baseType Effective property base type to use; may differ from
31
81
* actual type of property; for structured types it is content (value) type and NOT
32
82
* structured type.
33
83
*
34
- * @since 2.1
84
+ * @since 2.6
85
+ */
86
+ public Collection <NamedType > collectAndResolveSubtypesByName (MapperConfig <?> config ,
87
+ AnnotatedMember property , JavaType baseType ) {
88
+ // for backwards compatibility...
89
+ return collectAndResolveSubtypes (property , config ,
90
+ config .getAnnotationIntrospector (), baseType );
91
+ }
92
+
93
+ /**
94
+ * Method for finding out all reachable subtypes for given type,
95
+ * such that access is by type id,
96
+ * typically needed for deserialization (converting from type id to type).
97
+ *
98
+ * @param baseType Effective property base type to use; may differ from
99
+ * actual type of property; for structured types it is content (value) type and NOT
100
+ * structured type.
101
+ *
102
+ * @since 2.6
103
+ */
104
+ public Collection <NamedType > collectAndResolveSubtypesByName (MapperConfig <?> config ,
105
+ AnnotatedClass baseType ) {
106
+ // for backwards compatibility...
107
+ return collectAndResolveSubtypes (baseType , config , config .getAnnotationIntrospector ());
108
+ }
109
+
110
+ /*
111
+ /**********************************************************
112
+ /* Deprecated methods
113
+ /**********************************************************
114
+ */
115
+
116
+ /**
117
+ * @deprecated Since 2.6 Use either
118
+ * {@link #collectAndResolveSubtypesByClass(MapperConfig, AnnotatedMember, JavaType)}
119
+ * or {@link #collectAndResolveSubtypesByName(MapperConfig, AnnotatedMember, JavaType)}
120
+ * instead.
35
121
*/
122
+ @ Deprecated
36
123
public abstract Collection <NamedType > collectAndResolveSubtypes (AnnotatedMember property ,
37
124
MapperConfig <?> config , AnnotationIntrospector ai , JavaType baseType );
38
125
39
126
/**
40
- * Method for finding out all reachable subtypes for given type.
127
+ * @deprecated Since 2.6 Use either
128
+ * {@link #collectAndResolveSubtypesByClass(MapperConfig, AnnotatedClass)}
129
+ * or {@link #collectAndResolveSubtypesByName(MapperConfig, AnnotatedClass)}
130
+ * instead.
41
131
*/
42
- public abstract Collection <NamedType > collectAndResolveSubtypes (AnnotatedClass basetype ,
132
+ @ Deprecated
133
+ public abstract Collection <NamedType > collectAndResolveSubtypes (AnnotatedClass baseType ,
43
134
MapperConfig <?> config , AnnotationIntrospector ai );
44
135
}
0 commit comments