@@ -30,9 +30,12 @@ public class DeserializeBeanInfo {
3030 private final List <FieldInfo > fieldList = new ArrayList <FieldInfo >();
3131 private final List <FieldInfo > sortedFieldList = new ArrayList <FieldInfo >();
3232
33+ private int parserFeatures = 0 ;
34+
3335 public DeserializeBeanInfo (Class <?> clazz ){
3436 super ();
3537 this .clazz = clazz ;
38+ this .parserFeatures = TypeUtils .getParserFeatures (clazz );
3639 }
3740
3841 public Constructor <?> getDefaultConstructor () {
@@ -125,7 +128,8 @@ public static DeserializeBeanInfo computeSetters(Class<?> clazz, Type type) {
125128 Field field = TypeUtils .getField (clazz , fieldAnnotation .name ());
126129 final int ordinal = fieldAnnotation .ordinal ();
127130 final int serialzeFeatures = SerializerFeature .of (fieldAnnotation .serialzeFeatures ());
128- FieldInfo fieldInfo = new FieldInfo (fieldAnnotation .name (), clazz , fieldClass , fieldType , field , ordinal , serialzeFeatures );
131+ FieldInfo fieldInfo = new FieldInfo (fieldAnnotation .name (), clazz , fieldClass , fieldType , field ,
132+ ordinal , serialzeFeatures );
129133 beanInfo .add (fieldInfo );
130134 }
131135 return beanInfo ;
@@ -199,10 +203,10 @@ public static DeserializeBeanInfo computeSetters(Class<?> clazz, Type type) {
199203 if (!annotation .deserialize ()) {
200204 continue ;
201205 }
202-
206+
203207 ordinal = annotation .ordinal ();
204208 serialzeFeatures = SerializerFeature .of (annotation .serialzeFeatures ());
205-
209+
206210 if (annotation .name ().length () != 0 ) {
207211 String propertyName = annotation .name ();
208212 beanInfo .add (new FieldInfo (propertyName , method , null , clazz , type , ordinal , serialzeFeatures ));
@@ -228,7 +232,7 @@ public static DeserializeBeanInfo computeSetters(Class<?> clazz, Type type) {
228232 propertyName = methodName .substring (4 );
229233 } else if (c3 == 'f' ) {
230234 propertyName = methodName .substring (3 );
231- } else if (methodName .length ()>= 5 && Character .isUpperCase (methodName .charAt (4 ))){
235+ } else if (methodName .length () >= 5 && Character .isUpperCase (methodName .charAt (4 ))) {
232236 propertyName = TypeUtils .decapitalize (methodName .substring (3 ));
233237 } else {
234238 continue ;
@@ -242,11 +246,11 @@ public static DeserializeBeanInfo computeSetters(Class<?> clazz, Type type) {
242246
243247 if (field != null ) {
244248 JSONField fieldAnnotation = field .getAnnotation (JSONField .class );
245-
249+
246250 if (fieldAnnotation != null ) {
247251 ordinal = fieldAnnotation .ordinal ();
248252 serialzeFeatures = SerializerFeature .of (fieldAnnotation .serialzeFeatures ());
249-
253+
250254 if (fieldAnnotation .name ().length () != 0 ) {
251255 propertyName = fieldAnnotation .name ();
252256 beanInfo .add (new FieldInfo (propertyName , method , field , clazz , type , ordinal , serialzeFeatures ));
@@ -285,7 +289,7 @@ public static DeserializeBeanInfo computeSetters(Class<?> clazz, Type type) {
285289 if (fieldAnnotation != null ) {
286290 ordinal = fieldAnnotation .ordinal ();
287291 serialzeFeatures = SerializerFeature .of (fieldAnnotation .serialzeFeatures ());
288-
292+
289293 if (fieldAnnotation .name ().length () != 0 ) {
290294 propertyName = fieldAnnotation .name ();
291295 }
@@ -400,4 +404,8 @@ public static Method getFactoryMethod(Class<?> clazz) {
400404 return factoryMethod ;
401405 }
402406
407+
408+ public int getParserFeatures () {
409+ return parserFeatures ;
410+ }
403411}
0 commit comments