@@ -24,7 +24,7 @@ public StdSubtypeResolver() { }
24
24
25
25
/*
26
26
/**********************************************************
27
- /* Public API
27
+ /* Subtype registration
28
28
/**********************************************************
29
29
*/
30
30
@@ -46,14 +46,18 @@ public void registerSubtypes(Class<?>... classes) {
46
46
}
47
47
registerSubtypes (types );
48
48
}
49
-
50
- /**
51
- * @deprecated Since 2.6
49
+
50
+ /*
51
+ /**********************************************************
52
+ /* Resolution by class (serialization)
53
+ /**********************************************************
52
54
*/
55
+
53
56
@ Override
54
- public Collection <NamedType > collectAndResolveSubtypes ( AnnotatedMember property ,
55
- MapperConfig <?> config , AnnotationIntrospector ai , JavaType baseType )
57
+ public Collection <NamedType > collectAndResolveSubtypesByClass ( MapperConfig <?> config ,
58
+ AnnotatedMember property , JavaType baseType )
56
59
{
60
+ final AnnotationIntrospector ai = config .getAnnotationIntrospector ();
57
61
// for backwards compatibility, must allow null here:
58
62
Class <?> rawBase = (baseType == null ) ? property .getRawType () : baseType .getRawClass ();
59
63
@@ -88,9 +92,10 @@ public Collection<NamedType> collectAndResolveSubtypes(AnnotatedMember property,
88
92
}
89
93
90
94
@ Override
91
- public Collection <NamedType > collectAndResolveSubtypes ( AnnotatedClass type ,
92
- MapperConfig <?> config , AnnotationIntrospector ai )
95
+ public Collection <NamedType > collectAndResolveSubtypesByClass ( MapperConfig <?> config ,
96
+ AnnotatedClass type )
93
97
{
98
+ final AnnotationIntrospector ai = config .getAnnotationIntrospector ();
94
99
HashMap <NamedType , NamedType > subtypes = new HashMap <NamedType , NamedType >();
95
100
// [JACKSON-257] then consider registered subtypes (which have precedence over annotations)
96
101
if (_registeredSubtypes != null ) {
@@ -109,12 +114,54 @@ public Collection<NamedType> collectAndResolveSubtypes(AnnotatedClass type,
109
114
return new ArrayList <NamedType >(subtypes .values ());
110
115
}
111
116
117
+ /*
118
+ /**********************************************************
119
+ /* Resolution by class (deserialization)
120
+ /**********************************************************
121
+ */
122
+
123
+ @ Override
124
+ public Collection <NamedType > collectAndResolveSubtypesByName (MapperConfig <?> config ,
125
+ AnnotatedMember property , JavaType baseType )
126
+ {
127
+ // !!! TODO: implement properly
128
+ return collectAndResolveSubtypesByClass (config , property , baseType );
129
+ }
130
+
131
+ @ Override
132
+ public Collection <NamedType > collectAndResolveSubtypesByName (MapperConfig <?> config ,
133
+ AnnotatedClass type )
134
+ {
135
+ // !!! TODO: implement properly
136
+ return collectAndResolveSubtypesByClass (config , type );
137
+ }
138
+
139
+ /*
140
+ /**********************************************************
141
+ /* Deprecated method overrides
142
+ /**********************************************************
143
+ */
144
+
145
+ @ Override
146
+ public Collection <NamedType > collectAndResolveSubtypes (AnnotatedMember property ,
147
+ MapperConfig <?> config , AnnotationIntrospector ai , JavaType baseType )
148
+ {
149
+ return collectAndResolveSubtypesByClass (config , property , baseType );
150
+ }
151
+
152
+ @ Override
153
+ public Collection <NamedType > collectAndResolveSubtypes (AnnotatedClass type ,
154
+ MapperConfig <?> config , AnnotationIntrospector ai )
155
+ {
156
+ return collectAndResolveSubtypesByClass (config , type );
157
+ }
158
+
112
159
/*
113
160
/**********************************************************
114
161
/* Internal methods
115
162
/**********************************************************
116
163
*/
117
-
164
+
118
165
/**
119
166
* Method called to find subtypes for a specific type (class)
120
167
*/
0 commit comments