15
15
import com .fasterxml .jackson .databind .ser .BeanSerializerModifier ;
16
16
17
17
/**
18
- * Vanilla {@link com.fasterxml.jackson.databind.Module} implementation that allows registration
19
- * of serializers and deserializers, bean serializer
18
+ * Simple {@link com.fasterxml.jackson.databind.Module} implementation that allows
19
+ * registration of serializers and deserializers, serializer
20
20
* and deserializer modifiers, registration of subtypes and mix-ins
21
21
* as well as some other commonly
22
22
* needed aspects (addition of custom {@link AbstractTypeResolver}s,
23
23
* {@link com.fasterxml.jackson.databind.deser.ValueInstantiator}s).
24
24
* <p>
25
25
* NOTE: that [de]serializers are registered as "default" [de]serializers.
26
26
* As a result, they will have lower priority than the ones indicated through annotations on
27
- * both Class and property-associated annotations -- for example,
27
+ * both {@code Class} and property-associated annotations -- for example,
28
28
* {@link com.fasterxml.jackson.databind.annotation.JsonDeserialize}.<br>
29
- * In cases where both module-based [de]serializers and annotation-based [de]serializers are registered,
30
- * the [de]serializer specified by the annotation will take precedence.
29
+ * In cases where both module-based [de]serializers and annotation-based
30
+ * [de]serializers are registered, the [de]serializer specified by annotations
31
+ * will take precedence.
31
32
*<p>
32
33
* NOTE: although it is not expected that sub-types should need to
33
34
* override {@link #setupModule(SetupContext)} method, if they choose
34
35
* to do so they MUST call {@code super.setupModule(context);}
35
36
* to ensure that registration works as expected.
36
37
*<p>
37
38
* WARNING: when registering {@link JsonSerializer}s and {@link JsonDeserializer}s,
38
- * only type erased {@code Class} is compared: this means that usually you should
39
+ * only type- erased {@code Class} is compared: this means that usually you should
39
40
* NOT use this implementation for registering structured types such as
40
41
* {@link java.util.Collection}s or {@link java.util.Map}s: this because parametric
41
42
* type information will not be considered and you may end up having "wrong" handler
@@ -229,7 +230,7 @@ public SimpleModule(String name, Version version,
229
230
@ Override
230
231
public Object getTypeId ()
231
232
{
232
- // 07-Jun-2021, tatu: [databind#3110] Return Type Id if name was
233
+ // 07-Jun-2021, tatu: [databind#3110] Return name as Type Id if name was
233
234
// explicitly given
234
235
if (_hasExplicitName ) {
235
236
return _name ;
@@ -243,7 +244,8 @@ public Object getTypeId()
243
244
return _name ;
244
245
}
245
246
// And for what it is worth, this should usually do the same and we could
246
- // in fact always just return `_name`. But leaving as-is for now.
247
+ // in fact always just return `_name`. But leaving as-is for now:
248
+ // will essentially return {@code getClass().getName()}.
247
249
return super .getTypeId ();
248
250
}
249
251
0 commit comments