4
4
import java .util .Locale ;
5
5
import java .util .TimeZone ;
6
6
7
- import com .fasterxml .jackson .annotation .JsonAutoDetect ;
8
- import com .fasterxml .jackson .annotation .PropertyAccessor ;
9
7
import com .fasterxml .jackson .core .Base64Variant ;
10
8
import com .fasterxml .jackson .databind .*;
11
9
import com .fasterxml .jackson .databind .introspect .AnnotationIntrospectorPair ;
12
10
import com .fasterxml .jackson .databind .introspect .ClassIntrospector ;
13
- import com .fasterxml .jackson .databind .introspect .VisibilityChecker ;
14
11
import com .fasterxml .jackson .databind .jsontype .TypeResolverBuilder ;
15
12
import com .fasterxml .jackson .databind .type .TypeFactory ;
16
13
import com .fasterxml .jackson .databind .util .StdDateFormat ;
@@ -54,17 +51,6 @@ public final class BaseSettings
54
51
*/
55
52
protected final AnnotationIntrospector _annotationIntrospector ;
56
53
57
- /**
58
- * Object used for determining whether specific property elements
59
- * (method, constructors, fields) can be auto-detected based on
60
- * their visibility (access modifiers). Can be changed to allow
61
- * different minimum visibility levels for auto-detection. Note
62
- * that this is the global handler; individual types (classes)
63
- * can further override active checker used (using
64
- * {@link JsonAutoDetect} annotation)
65
- */
66
- protected final VisibilityChecker <?> _visibilityChecker ;
67
-
68
54
/**
69
55
* Custom property naming strategy in use, if any.
70
56
*/
@@ -145,13 +131,12 @@ public final class BaseSettings
145
131
*/
146
132
147
133
public BaseSettings (ClassIntrospector ci , AnnotationIntrospector ai ,
148
- VisibilityChecker <?> vc , PropertyNamingStrategy pns , TypeFactory tf ,
134
+ PropertyNamingStrategy pns , TypeFactory tf ,
149
135
TypeResolverBuilder <?> typer , DateFormat dateFormat , HandlerInstantiator hi ,
150
136
Locale locale , TimeZone tz , Base64Variant defaultBase64 )
151
137
{
152
138
_classIntrospector = ci ;
153
139
_annotationIntrospector = ai ;
154
- _visibilityChecker = vc ;
155
140
_propertyNamingStrategy = pns ;
156
141
_typeFactory = tf ;
157
142
_typeResolverBuilder = typer ;
@@ -172,7 +157,7 @@ public BaseSettings withClassIntrospector(ClassIntrospector ci) {
172
157
if (_classIntrospector == ci ) {
173
158
return this ;
174
159
}
175
- return new BaseSettings (ci , _annotationIntrospector , _visibilityChecker , _propertyNamingStrategy , _typeFactory ,
160
+ return new BaseSettings (ci , _annotationIntrospector , _propertyNamingStrategy , _typeFactory ,
176
161
_typeResolverBuilder , _dateFormat , _handlerInstantiator , _locale ,
177
162
_timeZone , _defaultBase64 );
178
163
}
@@ -181,7 +166,7 @@ public BaseSettings withAnnotationIntrospector(AnnotationIntrospector ai) {
181
166
if (_annotationIntrospector == ai ) {
182
167
return this ;
183
168
}
184
- return new BaseSettings (_classIntrospector , ai , _visibilityChecker , _propertyNamingStrategy , _typeFactory ,
169
+ return new BaseSettings (_classIntrospector , ai , _propertyNamingStrategy , _typeFactory ,
185
170
_typeResolverBuilder , _dateFormat , _handlerInstantiator , _locale ,
186
171
_timeZone , _defaultBase64 );
187
172
}
@@ -193,29 +178,22 @@ public BaseSettings withInsertedAnnotationIntrospector(AnnotationIntrospector ai
193
178
public BaseSettings withAppendedAnnotationIntrospector (AnnotationIntrospector ai ) {
194
179
return withAnnotationIntrospector (AnnotationIntrospectorPair .create (_annotationIntrospector , ai ));
195
180
}
196
-
197
- public BaseSettings withVisibilityChecker (VisibilityChecker <?> vc ) {
198
- if (_visibilityChecker == vc ) {
199
- return this ;
200
- }
201
- return new BaseSettings (_classIntrospector , _annotationIntrospector , vc , _propertyNamingStrategy , _typeFactory ,
202
- _typeResolverBuilder , _dateFormat , _handlerInstantiator , _locale ,
203
- _timeZone , _defaultBase64 );
204
- }
205
181
182
+ /*
206
183
public BaseSettings withVisibility(PropertyAccessor forMethod, JsonAutoDetect.Visibility visibility) {
207
184
return new BaseSettings(_classIntrospector, _annotationIntrospector,
208
185
_visibilityChecker.withVisibility(forMethod, visibility),
209
186
_propertyNamingStrategy, _typeFactory,
210
187
_typeResolverBuilder, _dateFormat, _handlerInstantiator, _locale,
211
188
_timeZone, _defaultBase64);
212
189
}
190
+ */
213
191
214
192
public BaseSettings withPropertyNamingStrategy (PropertyNamingStrategy pns ) {
215
193
if (_propertyNamingStrategy == pns ) {
216
194
return this ;
217
195
}
218
- return new BaseSettings (_classIntrospector , _annotationIntrospector , _visibilityChecker , pns , _typeFactory ,
196
+ return new BaseSettings (_classIntrospector , _annotationIntrospector , pns , _typeFactory ,
219
197
_typeResolverBuilder , _dateFormat , _handlerInstantiator , _locale ,
220
198
_timeZone , _defaultBase64 );
221
199
}
@@ -224,7 +202,7 @@ public BaseSettings withTypeFactory(TypeFactory tf) {
224
202
if (_typeFactory == tf ) {
225
203
return this ;
226
204
}
227
- return new BaseSettings (_classIntrospector , _annotationIntrospector , _visibilityChecker , _propertyNamingStrategy , tf ,
205
+ return new BaseSettings (_classIntrospector , _annotationIntrospector , _propertyNamingStrategy , tf ,
228
206
_typeResolverBuilder , _dateFormat , _handlerInstantiator , _locale ,
229
207
_timeZone , _defaultBase64 );
230
208
}
@@ -233,7 +211,7 @@ public BaseSettings withTypeResolverBuilder(TypeResolverBuilder<?> typer) {
233
211
if (_typeResolverBuilder == typer ) {
234
212
return this ;
235
213
}
236
- return new BaseSettings (_classIntrospector , _annotationIntrospector , _visibilityChecker , _propertyNamingStrategy , _typeFactory ,
214
+ return new BaseSettings (_classIntrospector , _annotationIntrospector , _propertyNamingStrategy , _typeFactory ,
237
215
typer , _dateFormat , _handlerInstantiator , _locale ,
238
216
_timeZone , _defaultBase64 );
239
217
}
@@ -247,7 +225,7 @@ public BaseSettings withDateFormat(DateFormat df) {
247
225
if ((df != null ) && hasExplicitTimeZone ()) {
248
226
df = _force (df , _timeZone );
249
227
}
250
- return new BaseSettings (_classIntrospector , _annotationIntrospector , _visibilityChecker , _propertyNamingStrategy , _typeFactory ,
228
+ return new BaseSettings (_classIntrospector , _annotationIntrospector , _propertyNamingStrategy , _typeFactory ,
251
229
_typeResolverBuilder , df , _handlerInstantiator , _locale ,
252
230
_timeZone , _defaultBase64 );
253
231
}
@@ -256,7 +234,7 @@ public BaseSettings withHandlerInstantiator(HandlerInstantiator hi) {
256
234
if (_handlerInstantiator == hi ) {
257
235
return this ;
258
236
}
259
- return new BaseSettings (_classIntrospector , _annotationIntrospector , _visibilityChecker , _propertyNamingStrategy , _typeFactory ,
237
+ return new BaseSettings (_classIntrospector , _annotationIntrospector , _propertyNamingStrategy , _typeFactory ,
260
238
_typeResolverBuilder , _dateFormat , hi , _locale ,
261
239
_timeZone , _defaultBase64 );
262
240
}
@@ -265,7 +243,7 @@ public BaseSettings with(Locale l) {
265
243
if (_locale == l ) {
266
244
return this ;
267
245
}
268
- return new BaseSettings (_classIntrospector , _annotationIntrospector , _visibilityChecker , _propertyNamingStrategy , _typeFactory ,
246
+ return new BaseSettings (_classIntrospector , _annotationIntrospector , _propertyNamingStrategy , _typeFactory ,
269
247
_typeResolverBuilder , _dateFormat , _handlerInstantiator , l ,
270
248
_timeZone , _defaultBase64 );
271
249
}
@@ -286,7 +264,7 @@ public BaseSettings with(TimeZone tz)
286
264
287
265
DateFormat df = _force (_dateFormat , tz );
288
266
return new BaseSettings (_classIntrospector , _annotationIntrospector ,
289
- _visibilityChecker , _propertyNamingStrategy , _typeFactory ,
267
+ _propertyNamingStrategy , _typeFactory ,
290
268
_typeResolverBuilder , df , _handlerInstantiator , _locale ,
291
269
tz , _defaultBase64 );
292
270
}
@@ -299,7 +277,7 @@ public BaseSettings with(Base64Variant base64) {
299
277
return this ;
300
278
}
301
279
return new BaseSettings (_classIntrospector , _annotationIntrospector ,
302
- _visibilityChecker , _propertyNamingStrategy , _typeFactory ,
280
+ _propertyNamingStrategy , _typeFactory ,
303
281
_typeResolverBuilder , _dateFormat , _handlerInstantiator , _locale ,
304
282
_timeZone , base64 );
305
283
}
@@ -318,10 +296,6 @@ public AnnotationIntrospector getAnnotationIntrospector() {
318
296
return _annotationIntrospector ;
319
297
}
320
298
321
- public VisibilityChecker <?> getVisibilityChecker () {
322
- return _visibilityChecker ;
323
- }
324
-
325
299
public PropertyNamingStrategy getPropertyNamingStrategy () {
326
300
return _propertyNamingStrategy ;
327
301
}
0 commit comments