/QingTingFanBianYi/src/com/alibaba/fastjson/parser/deserializer/ASMJavaBeanDeserializer.java

https://gitlab.com/qt-prometheus/qt-prometheus · Java · 117 lines · 96 code · 17 blank · 4 comment · 6 complexity · 62089b01856bc572784ac1a28536e141 MD5 · raw file

  1. package com.alibaba.fastjson.parser.deserializer;
  2. import com.alibaba.fastjson.parser.DefaultJSONParser;
  3. import com.alibaba.fastjson.parser.JSONLexer;
  4. import com.alibaba.fastjson.parser.ParserConfig;
  5. import com.alibaba.fastjson.util.FieldInfo;
  6. import java.lang.reflect.Type;
  7. import java.util.Iterator;
  8. import java.util.Map;
  9. import java.util.Map.Entry;
  10. import java.util.Set;
  11. public abstract class ASMJavaBeanDeserializer
  12. implements ObjectDeserializer
  13. {
  14. protected InnerJavaBeanDeserializer serializer;
  15. public ASMJavaBeanDeserializer(ParserConfig paramParserConfig, Class<?> paramClass)
  16. {
  17. this.serializer = new InnerJavaBeanDeserializer(paramParserConfig, paramClass, null);
  18. this.serializer.getFieldDeserializerMap();
  19. }
  20. public FieldDeserializer createFieldDeserializer(ParserConfig paramParserConfig, Class<?> paramClass, FieldInfo paramFieldInfo)
  21. {
  22. return paramParserConfig.createFieldDeserializer(paramParserConfig, paramClass, paramFieldInfo);
  23. }
  24. public Object createInstance(DefaultJSONParser paramDefaultJSONParser)
  25. {
  26. return this.serializer.createInstance(paramDefaultJSONParser, this.serializer.getClazz());
  27. }
  28. public abstract Object createInstance(DefaultJSONParser paramDefaultJSONParser, Type paramType);
  29. public <T> T deserialze(DefaultJSONParser paramDefaultJSONParser, Type paramType, Object paramObject)
  30. {
  31. return this.serializer.deserialze(paramDefaultJSONParser, paramType, paramObject);
  32. }
  33. public int getFastMatchToken()
  34. {
  35. return this.serializer.getFastMatchToken();
  36. }
  37. public FieldDeserializer getFieldDeserializer(String paramString)
  38. {
  39. return (FieldDeserializer)this.serializer.getFieldDeserializerMap().get(paramString);
  40. }
  41. public Type getFieldType(String paramString)
  42. {
  43. return ((FieldDeserializer)this.serializer.getFieldDeserializerMap().get(paramString)).getFieldType();
  44. }
  45. public InnerJavaBeanDeserializer getInnterSerializer()
  46. {
  47. return this.serializer;
  48. }
  49. public boolean parseField(DefaultJSONParser paramDefaultJSONParser, String paramString, Object paramObject, Type paramType, Map<String, Object> paramMap)
  50. {
  51. JSONLexer localJSONLexer = paramDefaultJSONParser.getLexer();
  52. Object localObject2 = this.serializer.getFieldDeserializerMap();
  53. FieldDeserializer localFieldDeserializer = (FieldDeserializer)((Map)localObject2).get(paramString);
  54. Object localObject1 = localFieldDeserializer;
  55. if (localFieldDeserializer == null)
  56. {
  57. localObject2 = ((Map)localObject2).entrySet().iterator();
  58. do
  59. {
  60. localObject1 = localFieldDeserializer;
  61. if (!((Iterator)localObject2).hasNext())
  62. break;
  63. localObject1 = (Map.Entry)((Iterator)localObject2).next();
  64. }
  65. while (!((String)((Map.Entry)localObject1).getKey()).equalsIgnoreCase(paramString));
  66. localObject1 = (FieldDeserializer)((Map.Entry)localObject1).getValue();
  67. }
  68. if (localObject1 == null)
  69. {
  70. this.serializer.parseExtra(paramDefaultJSONParser, paramObject, paramString);
  71. return false;
  72. }
  73. localJSONLexer.nextTokenWithColon(((FieldDeserializer)localObject1).getFastMatchToken());
  74. ((FieldDeserializer)localObject1).parseField(paramDefaultJSONParser, paramObject, paramType, paramMap);
  75. return true;
  76. }
  77. public Object parseRest(DefaultJSONParser paramDefaultJSONParser, Type paramType, Object paramObject1, Object paramObject2)
  78. {
  79. return this.serializer.deserialze(paramDefaultJSONParser, paramType, paramObject1, paramObject2);
  80. }
  81. public final class InnerJavaBeanDeserializer extends JavaBeanDeserializer
  82. {
  83. private InnerJavaBeanDeserializer(Class<?> arg2)
  84. {
  85. super(localClass);
  86. }
  87. public FieldDeserializer createFieldDeserializer(ParserConfig paramParserConfig, Class<?> paramClass, FieldInfo paramFieldInfo)
  88. {
  89. return ASMJavaBeanDeserializer.this.createFieldDeserializer(paramParserConfig, paramClass, paramFieldInfo);
  90. }
  91. public boolean parseField(DefaultJSONParser paramDefaultJSONParser, String paramString, Object paramObject, Type paramType, Map<String, Object> paramMap)
  92. {
  93. return ASMJavaBeanDeserializer.this.parseField(paramDefaultJSONParser, paramString, paramObject, paramType, paramMap);
  94. }
  95. }
  96. }
  97. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  98. * Qualified Name: com.alibaba.fastjson.parser.deserializer.ASMJavaBeanDeserializer
  99. * JD-Core Version: 0.6.2
  100. */