@@ -18,7 +18,7 @@ public enum MapperFeature implements ConfigFeature
18
18
{
19
19
/*
20
20
/******************************************************
21
- /* Introspection features
21
+ /* General introspection features
22
22
/******************************************************
23
23
*/
24
24
@@ -32,6 +32,43 @@ public enum MapperFeature implements ConfigFeature
32
32
*/
33
33
USE_ANNOTATIONS (true ),
34
34
35
+ /**
36
+ * Feature that determines whether otherwise regular "getter"
37
+ * methods (but only ones that handle Collections and Maps,
38
+ * not getters of other type)
39
+ * can be used for purpose of getting a reference to a Collection
40
+ * and Map to modify the property, without requiring a setter
41
+ * method.
42
+ * This is similar to how JAXB framework sets Collections and
43
+ * Maps: no setter is involved, just setter.
44
+ *<p>
45
+ * Note that such getters-as-setters methods have lower
46
+ * precedence than setters, so they are only used if no
47
+ * setter is found for the Map/Collection property.
48
+ *<p>
49
+ * Feature is enabled by default.
50
+ */
51
+ USE_GETTERS_AS_SETTERS (true ),
52
+
53
+ /**
54
+ * Feature that determines how <code>transient</code> modifier for fields
55
+ * is handled: if disabled, it is only taken to mean exclusion of the field
56
+ * as accessor; if true, it is taken to imply removal of the whole property.
57
+ *<p>
58
+ * Feature is disabled by default, meaning that existence of `transient`
59
+ * for a field does not necessarily lead to ignoral of getters or setters
60
+ * but just ignoring the use of field for access.
61
+ *
62
+ * @since 2.6
63
+ */
64
+ PROPAGATE_TRANSIENT_MARKER (false ),
65
+
66
+ /*
67
+ /******************************************************
68
+ /* Introspection-based property auto-detection
69
+ /******************************************************
70
+ */
71
+
35
72
/**
36
73
* Feature that determines whether "creator" methods are
37
74
* automatically detected by consider public constructors,
@@ -61,7 +98,7 @@ public enum MapperFeature implements ConfigFeature
61
98
*<p>
62
99
* Feature is enabled by default.
63
100
*/
64
- AUTO_DETECT_FIELDS (true ),
101
+ AUTO_DETECT_FIELDS (true ),
65
102
66
103
/**
67
104
* Feature that determines whether regular "getter" methods are
@@ -98,22 +135,22 @@ public enum MapperFeature implements ConfigFeature
98
135
*/
99
136
AUTO_DETECT_IS_GETTERS (true ),
100
137
101
- /**
102
- * Feature that determines whether "setter" methods are
103
- * automatically detected based on standard Bean naming convention
104
- * or not. If yes, then all public one-argument methods that
105
- * start with prefix "set"
106
- * are considered setters. If disabled, only methods explicitly
107
- * annotated are considered setters.
108
- *<p>
109
- * Note that this feature has lower precedence than per-class
110
- * annotations, and is only used if there isn't more granular
111
- * configuration available.
112
- *<P>
113
- * Feature is enabled by default.
114
- */
115
- AUTO_DETECT_SETTERS (true ),
116
-
138
+ /**
139
+ * Feature that determines whether "setter" methods are
140
+ * automatically detected based on standard Bean naming convention
141
+ * or not. If yes, then all public one-argument methods that
142
+ * start with prefix "set"
143
+ * are considered setters. If disabled, only methods explicitly
144
+ * annotated are considered setters.
145
+ *<p>
146
+ * Note that this feature has lower precedence than per-class
147
+ * annotations, and is only used if there isn't more granular
148
+ * configuration available.
149
+ *<P>
150
+ * Feature is enabled by default.
151
+ */
152
+ AUTO_DETECT_SETTERS (true ),
153
+
117
154
/**
118
155
* Feature that determines whether getters (getter methods)
119
156
* can be auto-detected if there is no matching mutator (setter,
@@ -126,22 +163,61 @@ public enum MapperFeature implements ConfigFeature
126
163
REQUIRE_SETTERS_FOR_GETTERS (false ),
127
164
128
165
/**
129
- * Feature that determines whether otherwise regular "getter"
130
- * methods (but only ones that handle Collections and Maps,
131
- * not getters of other type)
132
- * can be used for purpose of getting a reference to a Collection
133
- * and Map to modify the property, without requiring a setter
134
- * method.
135
- * This is similar to how JAXB framework sets Collections and
136
- * Maps: no setter is involved, just setter.
166
+ * Feature that determines whether member fields declared as 'final' may
167
+ * be auto-detected to be used mutators (used to change value of the logical
168
+ * property) or not. If enabled, 'final' access modifier has no effect, and
169
+ * such fields may be detected according to usual visibility and inference
170
+ * rules; if disabled, such fields are NOT used as mutators except if
171
+ * explicitly annotated for such use.
137
172
*<p>
138
- * Note that such getters-as-setters methods have lower
139
- * precedence than setters, so they are only used if no
140
- * setter is found for the Map/Collection property.
173
+ * Feature is enabled by default, for backwards compatibility reasons.
174
+ *
175
+ * @since 2.2
176
+ */
177
+ ALLOW_FINAL_FIELDS_AS_MUTATORS (true ),
178
+
179
+ /**
180
+ * Feature that determines whether member mutators (fields and
181
+ * setters) may be "pulled in" even if they are not visible,
182
+ * as long as there is a visible accessor (getter or field) with same name.
183
+ * For example: field "value" may be inferred as mutator,
184
+ * if there is visible or explicitly marked getter "getValue()".
185
+ * If enabled, inferring is enabled; otherwise (disabled) only visible and
186
+ * explicitly annotated accessors are ever used.
187
+ *<p>
188
+ * Note that 'getters' are never inferred and need to be either visible (including
189
+ * bean-style naming) or explicitly annotated.
141
190
*<p>
142
191
* Feature is enabled by default.
192
+ *
193
+ * @since 2.2
194
+ */
195
+ INFER_PROPERTY_MUTATORS (true ),
196
+
197
+ /**
198
+ * Feature that determines handling of <code>java.beans.ConstructorProperties<code>
199
+ * annotation: when enabled, it is considered as alias of
200
+ * {@link com.fasterxml.jackson.annotation.JsonCreator}, to mean that constructor
201
+ * should be considered a property-based Creator; when disabled, only constructor
202
+ * parameter name information is used, but constructor is NOT considered an explicit
203
+ * Creator (although may be discovered as one using other annotations or heuristics).
204
+ *<p>
205
+ * Feature is mostly used to help interoperability with frameworks like Lombok
206
+ * that may automatically generate <code>ConstructorProperties</code> annotation
207
+ * but without necessarily meaning that constructor should be used as Creator
208
+ * for deserialization.
209
+ *<p>
210
+ * Feature is enabled by default.
211
+ *
212
+ * @since 2.7
213
+ */
214
+ INFER_CREATOR_FROM_CONSTRUCTOR_PROPERTIES (true ),
215
+
216
+ /*
217
+ /******************************************************
218
+ /* Access modifier handling
219
+ /******************************************************
143
220
*/
144
- USE_GETTERS_AS_SETTERS (true ),
145
221
146
222
/**
147
223
* Feature that determines whether method and field access
@@ -187,51 +263,6 @@ public enum MapperFeature implements ConfigFeature
187
263
*/
188
264
OVERRIDE_PUBLIC_ACCESS_MODIFIERS (true ),
189
265
190
- /**
191
- * Feature that determines whether member mutators (fields and
192
- * setters) may be "pulled in" even if they are not visible,
193
- * as long as there is a visible accessor (getter or field) with same name.
194
- * For example: field "value" may be inferred as mutator,
195
- * if there is visible or explicitly marked getter "getValue()".
196
- * If enabled, inferring is enabled; otherwise (disabled) only visible and
197
- * explicitly annotated accessors are ever used.
198
- *<p>
199
- * Note that 'getters' are never inferred and need to be either visible (including
200
- * bean-style naming) or explicitly annotated.
201
- *<p>
202
- * Feature is enabled by default.
203
- *
204
- * @since 2.2
205
- */
206
- INFER_PROPERTY_MUTATORS (true ),
207
-
208
- /**
209
- * Feature that determines whether member fields declared as 'final' may
210
- * be auto-detected to be used mutators (used to change value of the logical
211
- * property) or not. If enabled, 'final' access modifier has no effect, and
212
- * such fields may be detected according to usual visibility and inference
213
- * rules; if disabled, such fields are NOT used as mutators except if
214
- * explicitly annotated for such use.
215
- *<p>
216
- * Feature is enabled by default, for backwards compatibility reasons.
217
- *
218
- * @since 2.2
219
- */
220
- ALLOW_FINAL_FIELDS_AS_MUTATORS (true ),
221
-
222
- /**
223
- * Feature that determines how <code>transient</code> modifier for fields
224
- * is handled: if disabled, it is only taken to mean exclusion of the field
225
- * as accessor; if true, removal of the whole property.
226
- *<p>
227
- * Feature is disabled by default, meaning that existence of `transient`
228
- * for a field does not necessarily lead to ignoral of getters or setters
229
- * but just ignoring the use of field for access.
230
- *
231
- * @since 2.6
232
- */
233
- PROPAGATE_TRANSIENT_MARKER (false ),
234
-
235
266
/*
236
267
/******************************************************
237
268
/* Type-handling features
0 commit comments