@@ -41,6 +41,7 @@ public static Class<?>[] types() {
41
41
TimeZone .class ,
42
42
InetAddress .class ,
43
43
InetSocketAddress .class ,
44
+ StringBuilder .class ,
44
45
};
45
46
}
46
47
@@ -85,6 +86,8 @@ public static Std findDeserializer(Class<?> rawType)
85
86
kind = Std .STD_INET_ADDRESS ;
86
87
} else if (rawType == InetSocketAddress .class ) {
87
88
kind = Std .STD_INET_SOCKET_ADDRESS ;
89
+ } else if (rawType == StringBuilder .class ) {
90
+ kind = Std .STD_STRING_BUILDER ;
88
91
} else {
89
92
return null ;
90
93
}
@@ -199,6 +202,7 @@ public static class Std extends FromStringDeserializer<Object>
199
202
public final static int STD_TIME_ZONE = 10 ;
200
203
public final static int STD_INET_ADDRESS = 11 ;
201
204
public final static int STD_INET_SOCKET_ADDRESS = 12 ;
205
+ public final static int STD_STRING_BUILDER = 13 ;
202
206
203
207
protected final int _kind ;
204
208
@@ -276,6 +280,8 @@ protected Object _deserialize(String value, DeserializationContext ctxt) throws
276
280
}
277
281
// host or unbracketed IPv6, without port number
278
282
return new InetSocketAddress (value , 0 );
283
+ case STD_STRING_BUILDER :
284
+ return new StringBuilder (value );
279
285
}
280
286
throw new IllegalArgumentException ();
281
287
}
@@ -290,10 +296,12 @@ protected Object _deserializeFromEmptyString() throws IOException {
290
296
if (_kind == STD_LOCALE ) {
291
297
return Locale .ROOT ;
292
298
}
299
+ if (_kind == STD_STRING_BUILDER ) {
300
+ return new StringBuilder ();
301
+ }
293
302
return super ._deserializeFromEmptyString ();
294
303
}
295
304
296
-
297
305
protected int _firstHyphenOrUnderscore (String str )
298
306
{
299
307
for (int i = 0 , end = str .length (); i < end ; ++i ) {
0 commit comments