PageRenderTime 3822ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/QingTingFanBianYi/src/com/alibaba/fastjson/parser/ParserConfig.java

https://gitlab.com/qt-prometheus/qt-prometheus
Java | 522 lines | 498 code | 20 blank | 4 comment | 102 complexity | 269174f6bd84d24f306ce4866d9cfc74 MD5 | raw file
  1. package com.alibaba.fastjson.parser;
  2. import com.alibaba.fastjson.JSONArray;
  3. import com.alibaba.fastjson.JSONException;
  4. import com.alibaba.fastjson.JSONObject;
  5. import com.alibaba.fastjson.annotation.JSONType;
  6. import com.alibaba.fastjson.asm.ASMException;
  7. import com.alibaba.fastjson.parser.deserializer.ASMDeserializerFactory;
  8. import com.alibaba.fastjson.parser.deserializer.ASMJavaBeanDeserializer;
  9. import com.alibaba.fastjson.parser.deserializer.ASMJavaBeanDeserializer.InnerJavaBeanDeserializer;
  10. import com.alibaba.fastjson.parser.deserializer.ArrayDeserializer;
  11. import com.alibaba.fastjson.parser.deserializer.ArrayListTypeFieldDeserializer;
  12. import com.alibaba.fastjson.parser.deserializer.AtomicIntegerArrayDeserializer;
  13. import com.alibaba.fastjson.parser.deserializer.AtomicLongArrayDeserializer;
  14. import com.alibaba.fastjson.parser.deserializer.AutowiredObjectDeserializer;
  15. import com.alibaba.fastjson.parser.deserializer.BigDecimalDeserializer;
  16. import com.alibaba.fastjson.parser.deserializer.BigIntegerDeserializer;
  17. import com.alibaba.fastjson.parser.deserializer.BooleanDeserializer;
  18. import com.alibaba.fastjson.parser.deserializer.BooleanFieldDeserializer;
  19. import com.alibaba.fastjson.parser.deserializer.CalendarDeserializer;
  20. import com.alibaba.fastjson.parser.deserializer.CharArrayDeserializer;
  21. import com.alibaba.fastjson.parser.deserializer.CharacterDeserializer;
  22. import com.alibaba.fastjson.parser.deserializer.CharsetDeserializer;
  23. import com.alibaba.fastjson.parser.deserializer.ClassDerializer;
  24. import com.alibaba.fastjson.parser.deserializer.CollectionDeserializer;
  25. import com.alibaba.fastjson.parser.deserializer.ColorDeserializer;
  26. import com.alibaba.fastjson.parser.deserializer.DateDeserializer;
  27. import com.alibaba.fastjson.parser.deserializer.DateFormatDeserializer;
  28. import com.alibaba.fastjson.parser.deserializer.DefaultFieldDeserializer;
  29. import com.alibaba.fastjson.parser.deserializer.EnumDeserializer;
  30. import com.alibaba.fastjson.parser.deserializer.FieldDeserializer;
  31. import com.alibaba.fastjson.parser.deserializer.FileDeserializer;
  32. import com.alibaba.fastjson.parser.deserializer.FloatDeserializer;
  33. import com.alibaba.fastjson.parser.deserializer.FontDeserializer;
  34. import com.alibaba.fastjson.parser.deserializer.InetAddressDeserializer;
  35. import com.alibaba.fastjson.parser.deserializer.InetSocketAddressDeserializer;
  36. import com.alibaba.fastjson.parser.deserializer.IntegerDeserializer;
  37. import com.alibaba.fastjson.parser.deserializer.IntegerFieldDeserializer;
  38. import com.alibaba.fastjson.parser.deserializer.JSONArrayDeserializer;
  39. import com.alibaba.fastjson.parser.deserializer.JSONObjectDeserializer;
  40. import com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer;
  41. import com.alibaba.fastjson.parser.deserializer.JavaObjectDeserializer;
  42. import com.alibaba.fastjson.parser.deserializer.LocaleDeserializer;
  43. import com.alibaba.fastjson.parser.deserializer.LongDeserializer;
  44. import com.alibaba.fastjson.parser.deserializer.LongFieldDeserializer;
  45. import com.alibaba.fastjson.parser.deserializer.MapDeserializer;
  46. import com.alibaba.fastjson.parser.deserializer.NumberDeserializer;
  47. import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;
  48. import com.alibaba.fastjson.parser.deserializer.PatternDeserializer;
  49. import com.alibaba.fastjson.parser.deserializer.PointDeserializer;
  50. import com.alibaba.fastjson.parser.deserializer.RectangleDeserializer;
  51. import com.alibaba.fastjson.parser.deserializer.ReferenceDeserializer;
  52. import com.alibaba.fastjson.parser.deserializer.SqlDateDeserializer;
  53. import com.alibaba.fastjson.parser.deserializer.StackTraceElementDeserializer;
  54. import com.alibaba.fastjson.parser.deserializer.StringDeserializer;
  55. import com.alibaba.fastjson.parser.deserializer.StringFieldDeserializer;
  56. import com.alibaba.fastjson.parser.deserializer.ThrowableDeserializer;
  57. import com.alibaba.fastjson.parser.deserializer.TimeDeserializer;
  58. import com.alibaba.fastjson.parser.deserializer.TimeZoneDeserializer;
  59. import com.alibaba.fastjson.parser.deserializer.TimestampDeserializer;
  60. import com.alibaba.fastjson.parser.deserializer.URIDeserializer;
  61. import com.alibaba.fastjson.parser.deserializer.URLDeserializer;
  62. import com.alibaba.fastjson.parser.deserializer.UUIDDeserializer;
  63. import com.alibaba.fastjson.util.ASMUtils;
  64. import com.alibaba.fastjson.util.DeserializeBeanInfo;
  65. import com.alibaba.fastjson.util.FieldInfo;
  66. import com.alibaba.fastjson.util.IdentityHashMap;
  67. import com.alibaba.fastjson.util.ServiceLoader;
  68. import java.io.Closeable;
  69. import java.io.File;
  70. import java.io.Serializable;
  71. import java.lang.ref.SoftReference;
  72. import java.lang.ref.WeakReference;
  73. import java.lang.reflect.Field;
  74. import java.lang.reflect.Modifier;
  75. import java.lang.reflect.ParameterizedType;
  76. import java.lang.reflect.Type;
  77. import java.lang.reflect.TypeVariable;
  78. import java.lang.reflect.WildcardType;
  79. import java.math.BigDecimal;
  80. import java.math.BigInteger;
  81. import java.net.Inet4Address;
  82. import java.net.Inet6Address;
  83. import java.net.InetAddress;
  84. import java.net.InetSocketAddress;
  85. import java.net.URI;
  86. import java.net.URL;
  87. import java.nio.charset.Charset;
  88. import java.sql.Time;
  89. import java.sql.Timestamp;
  90. import java.text.SimpleDateFormat;
  91. import java.util.ArrayList;
  92. import java.util.Calendar;
  93. import java.util.Collection;
  94. import java.util.Collections;
  95. import java.util.HashMap;
  96. import java.util.HashSet;
  97. import java.util.Iterator;
  98. import java.util.LinkedHashMap;
  99. import java.util.List;
  100. import java.util.Locale;
  101. import java.util.Map;
  102. import java.util.Set;
  103. import java.util.TimeZone;
  104. import java.util.TreeMap;
  105. import java.util.UUID;
  106. import java.util.concurrent.ConcurrentHashMap;
  107. import java.util.concurrent.ConcurrentMap;
  108. import java.util.concurrent.atomic.AtomicBoolean;
  109. import java.util.concurrent.atomic.AtomicInteger;
  110. import java.util.concurrent.atomic.AtomicIntegerArray;
  111. import java.util.concurrent.atomic.AtomicLong;
  112. import java.util.concurrent.atomic.AtomicLongArray;
  113. import java.util.concurrent.atomic.AtomicReference;
  114. import java.util.regex.Pattern;
  115. public class ParserConfig
  116. {
  117. private static ParserConfig global = new ParserConfig();
  118. private boolean asmEnable;
  119. private final IdentityHashMap<Type, ObjectDeserializer> derializers = new IdentityHashMap();
  120. private final Set<Class<?>> primitiveClasses = new HashSet();
  121. protected final SymbolTable symbolTable;
  122. public ParserConfig()
  123. {
  124. boolean bool;
  125. if (!ASMUtils.isAndroid())
  126. bool = true;
  127. while (true)
  128. {
  129. this.asmEnable = bool;
  130. this.symbolTable = new SymbolTable();
  131. this.primitiveClasses.add(Boolean.TYPE);
  132. this.primitiveClasses.add(Boolean.class);
  133. this.primitiveClasses.add(Character.TYPE);
  134. this.primitiveClasses.add(Character.class);
  135. this.primitiveClasses.add(Byte.TYPE);
  136. this.primitiveClasses.add(Byte.class);
  137. this.primitiveClasses.add(Short.TYPE);
  138. this.primitiveClasses.add(Short.class);
  139. this.primitiveClasses.add(Integer.TYPE);
  140. this.primitiveClasses.add(Integer.class);
  141. this.primitiveClasses.add(Long.TYPE);
  142. this.primitiveClasses.add(Long.class);
  143. this.primitiveClasses.add(Float.TYPE);
  144. this.primitiveClasses.add(Float.class);
  145. this.primitiveClasses.add(Double.TYPE);
  146. this.primitiveClasses.add(Double.class);
  147. this.primitiveClasses.add(BigInteger.class);
  148. this.primitiveClasses.add(BigDecimal.class);
  149. this.primitiveClasses.add(String.class);
  150. this.primitiveClasses.add(java.util.Date.class);
  151. this.primitiveClasses.add(java.sql.Date.class);
  152. this.primitiveClasses.add(Time.class);
  153. this.primitiveClasses.add(Timestamp.class);
  154. this.derializers.put(SimpleDateFormat.class, DateFormatDeserializer.instance);
  155. this.derializers.put(Timestamp.class, TimestampDeserializer.instance);
  156. this.derializers.put(java.sql.Date.class, SqlDateDeserializer.instance);
  157. this.derializers.put(Time.class, TimeDeserializer.instance);
  158. this.derializers.put(java.util.Date.class, DateDeserializer.instance);
  159. this.derializers.put(Calendar.class, CalendarDeserializer.instance);
  160. this.derializers.put(JSONObject.class, JSONObjectDeserializer.instance);
  161. this.derializers.put(JSONArray.class, JSONArrayDeserializer.instance);
  162. this.derializers.put(Map.class, MapDeserializer.instance);
  163. this.derializers.put(HashMap.class, MapDeserializer.instance);
  164. this.derializers.put(LinkedHashMap.class, MapDeserializer.instance);
  165. this.derializers.put(TreeMap.class, MapDeserializer.instance);
  166. this.derializers.put(ConcurrentMap.class, MapDeserializer.instance);
  167. this.derializers.put(ConcurrentHashMap.class, MapDeserializer.instance);
  168. this.derializers.put(Collection.class, CollectionDeserializer.instance);
  169. this.derializers.put(List.class, CollectionDeserializer.instance);
  170. this.derializers.put(ArrayList.class, CollectionDeserializer.instance);
  171. this.derializers.put(Object.class, JavaObjectDeserializer.instance);
  172. this.derializers.put(String.class, StringDeserializer.instance);
  173. this.derializers.put(Character.TYPE, CharacterDeserializer.instance);
  174. this.derializers.put(Character.class, CharacterDeserializer.instance);
  175. this.derializers.put(Byte.TYPE, NumberDeserializer.instance);
  176. this.derializers.put(Byte.class, NumberDeserializer.instance);
  177. this.derializers.put(Short.TYPE, NumberDeserializer.instance);
  178. this.derializers.put(Short.class, NumberDeserializer.instance);
  179. this.derializers.put(Integer.TYPE, IntegerDeserializer.instance);
  180. this.derializers.put(Integer.class, IntegerDeserializer.instance);
  181. this.derializers.put(Long.TYPE, LongDeserializer.instance);
  182. this.derializers.put(Long.class, LongDeserializer.instance);
  183. this.derializers.put(BigInteger.class, BigIntegerDeserializer.instance);
  184. this.derializers.put(BigDecimal.class, BigDecimalDeserializer.instance);
  185. this.derializers.put(Float.TYPE, FloatDeserializer.instance);
  186. this.derializers.put(Float.class, FloatDeserializer.instance);
  187. this.derializers.put(Double.TYPE, NumberDeserializer.instance);
  188. this.derializers.put(Double.class, NumberDeserializer.instance);
  189. this.derializers.put(Boolean.TYPE, BooleanDeserializer.instance);
  190. this.derializers.put(Boolean.class, BooleanDeserializer.instance);
  191. this.derializers.put(Class.class, ClassDerializer.instance);
  192. this.derializers.put([C.class, CharArrayDeserializer.instance);
  193. this.derializers.put(AtomicBoolean.class, BooleanDeserializer.instance);
  194. this.derializers.put(AtomicInteger.class, IntegerDeserializer.instance);
  195. this.derializers.put(AtomicLong.class, LongDeserializer.instance);
  196. this.derializers.put(AtomicReference.class, ReferenceDeserializer.instance);
  197. this.derializers.put(WeakReference.class, ReferenceDeserializer.instance);
  198. this.derializers.put(SoftReference.class, ReferenceDeserializer.instance);
  199. this.derializers.put(UUID.class, UUIDDeserializer.instance);
  200. this.derializers.put(TimeZone.class, TimeZoneDeserializer.instance);
  201. this.derializers.put(Locale.class, LocaleDeserializer.instance);
  202. this.derializers.put(InetAddress.class, InetAddressDeserializer.instance);
  203. this.derializers.put(Inet4Address.class, InetAddressDeserializer.instance);
  204. this.derializers.put(Inet6Address.class, InetAddressDeserializer.instance);
  205. this.derializers.put(InetSocketAddress.class, InetSocketAddressDeserializer.instance);
  206. this.derializers.put(File.class, FileDeserializer.instance);
  207. this.derializers.put(URI.class, URIDeserializer.instance);
  208. this.derializers.put(URL.class, URLDeserializer.instance);
  209. this.derializers.put(Pattern.class, PatternDeserializer.instance);
  210. this.derializers.put(Charset.class, CharsetDeserializer.instance);
  211. this.derializers.put(Number.class, NumberDeserializer.instance);
  212. this.derializers.put(AtomicIntegerArray.class, AtomicIntegerArrayDeserializer.instance);
  213. this.derializers.put(AtomicLongArray.class, AtomicLongArrayDeserializer.instance);
  214. this.derializers.put(StackTraceElement.class, StackTraceElementDeserializer.instance);
  215. this.derializers.put(Serializable.class, JavaObjectDeserializer.instance);
  216. this.derializers.put(Cloneable.class, JavaObjectDeserializer.instance);
  217. this.derializers.put(Comparable.class, JavaObjectDeserializer.instance);
  218. this.derializers.put(Closeable.class, JavaObjectDeserializer.instance);
  219. try
  220. {
  221. this.derializers.put(Class.forName("java.awt.Point"), PointDeserializer.instance);
  222. this.derializers.put(Class.forName("java.awt.Font"), FontDeserializer.instance);
  223. this.derializers.put(Class.forName("java.awt.Rectangle"), RectangleDeserializer.instance);
  224. this.derializers.put(Class.forName("java.awt.Color"), ColorDeserializer.instance);
  225. return;
  226. bool = false;
  227. }
  228. catch (Throwable localThrowable)
  229. {
  230. }
  231. }
  232. }
  233. public static Field getField(Class<?> paramClass, String paramString)
  234. {
  235. Object localObject2 = getField0(paramClass, paramString);
  236. Object localObject1 = localObject2;
  237. if (localObject2 == null)
  238. localObject1 = getField0(paramClass, "_" + paramString);
  239. localObject2 = localObject1;
  240. if (localObject1 == null)
  241. localObject2 = getField0(paramClass, "m_" + paramString);
  242. return localObject2;
  243. }
  244. private static Field getField0(Class<?> paramClass, String paramString)
  245. {
  246. Field[] arrayOfField = paramClass.getDeclaredFields();
  247. int j = arrayOfField.length;
  248. int i = 0;
  249. while (i < j)
  250. {
  251. Field localField = arrayOfField[i];
  252. if (paramString.equals(localField.getName()))
  253. return localField;
  254. i += 1;
  255. }
  256. if ((paramClass.getSuperclass() != null) && (paramClass.getSuperclass() != Object.class))
  257. return getField(paramClass.getSuperclass(), paramString);
  258. return null;
  259. }
  260. public static ParserConfig getGlobalInstance()
  261. {
  262. return global;
  263. }
  264. public FieldDeserializer createFieldDeserializer(ParserConfig paramParserConfig, Class<?> paramClass, FieldInfo paramFieldInfo)
  265. {
  266. boolean bool = this.asmEnable;
  267. if (!Modifier.isPublic(paramClass.getModifiers()))
  268. bool = false;
  269. if (paramFieldInfo.getFieldClass() == Class.class)
  270. bool = false;
  271. if (ASMDeserializerFactory.getInstance().isExternalClass(paramClass))
  272. bool = false;
  273. if (!bool)
  274. return createFieldDeserializerWithoutASM(paramParserConfig, paramClass, paramFieldInfo);
  275. try
  276. {
  277. FieldDeserializer localFieldDeserializer = ASMDeserializerFactory.getInstance().createFieldDeserializer(paramParserConfig, paramClass, paramFieldInfo);
  278. return localFieldDeserializer;
  279. }
  280. catch (Throwable localThrowable)
  281. {
  282. }
  283. return createFieldDeserializerWithoutASM(paramParserConfig, paramClass, paramFieldInfo);
  284. }
  285. public FieldDeserializer createFieldDeserializerWithoutASM(ParserConfig paramParserConfig, Class<?> paramClass, FieldInfo paramFieldInfo)
  286. {
  287. Class localClass = paramFieldInfo.getFieldClass();
  288. if ((localClass == Boolean.TYPE) || (localClass == Boolean.class))
  289. return new BooleanFieldDeserializer(paramParserConfig, paramClass, paramFieldInfo);
  290. if ((localClass == Integer.TYPE) || (localClass == Integer.class))
  291. return new IntegerFieldDeserializer(paramParserConfig, paramClass, paramFieldInfo);
  292. if ((localClass == Long.TYPE) || (localClass == Long.class))
  293. return new LongFieldDeserializer(paramParserConfig, paramClass, paramFieldInfo);
  294. if (localClass == String.class)
  295. return new StringFieldDeserializer(paramParserConfig, paramClass, paramFieldInfo);
  296. if ((localClass == List.class) || (localClass == ArrayList.class))
  297. return new ArrayListTypeFieldDeserializer(paramParserConfig, paramClass, paramFieldInfo);
  298. return new DefaultFieldDeserializer(paramParserConfig, paramClass, paramFieldInfo);
  299. }
  300. public ObjectDeserializer createJavaBeanDeserializer(Class<?> paramClass, Type paramType)
  301. {
  302. boolean bool2 = this.asmEnable;
  303. boolean bool1 = bool2;
  304. if (bool2)
  305. {
  306. bool1 = bool2;
  307. if (!Modifier.isPublic(paramClass.getModifiers()))
  308. bool1 = false;
  309. }
  310. if (paramClass.getTypeParameters().length != 0)
  311. bool1 = false;
  312. bool2 = bool1;
  313. if (ASMDeserializerFactory.getInstance().isExternalClass(paramClass))
  314. bool2 = false;
  315. bool1 = bool2;
  316. Object localObject1;
  317. if (bool2)
  318. {
  319. bool1 = bool2;
  320. if (paramClass.isInterface())
  321. bool1 = false;
  322. localObject1 = DeserializeBeanInfo.computeSetters(paramClass, paramType);
  323. if (((DeserializeBeanInfo)localObject1).getFieldList().size() > 200)
  324. bool1 = false;
  325. bool2 = bool1;
  326. if (((DeserializeBeanInfo)localObject1).getDefaultConstructor() == null)
  327. {
  328. bool2 = bool1;
  329. if (!paramClass.isInterface())
  330. bool2 = false;
  331. }
  332. localObject1 = ((DeserializeBeanInfo)localObject1).getFieldList().iterator();
  333. }
  334. while (true)
  335. {
  336. bool1 = bool2;
  337. Object localObject2;
  338. if (((Iterator)localObject1).hasNext())
  339. {
  340. localObject2 = (FieldInfo)((Iterator)localObject1).next();
  341. if (!((FieldInfo)localObject2).isGetOnly())
  342. break label230;
  343. }
  344. for (bool1 = false; ; bool1 = false)
  345. {
  346. bool2 = bool1;
  347. if (bool1)
  348. {
  349. bool2 = bool1;
  350. if (paramClass.isMemberClass())
  351. {
  352. bool2 = bool1;
  353. if (!Modifier.isStatic(paramClass.getModifiers()))
  354. bool2 = false;
  355. }
  356. }
  357. if (bool2)
  358. break label279;
  359. return new JavaBeanDeserializer(this, paramClass, paramType);
  360. label230: localObject2 = ((FieldInfo)localObject2).getFieldClass();
  361. if (Modifier.isPublic(((Class)localObject2).getModifiers()))
  362. break;
  363. }
  364. if ((((Class)localObject2).isMemberClass()) && (!Modifier.isStatic(((Class)localObject2).getModifiers())))
  365. bool2 = false;
  366. }
  367. try
  368. {
  369. label279: localObject1 = ASMDeserializerFactory.getInstance().createJavaBeanDeserializer(this, paramClass, paramType);
  370. return localObject1;
  371. }
  372. catch (ASMException localASMException)
  373. {
  374. return new JavaBeanDeserializer(this, paramClass, paramType);
  375. }
  376. catch (Exception paramType)
  377. {
  378. }
  379. throw new JSONException("create asm deserializer error, " + paramClass.getName(), paramType);
  380. }
  381. public IdentityHashMap<Type, ObjectDeserializer> getDerializers()
  382. {
  383. return this.derializers;
  384. }
  385. public ObjectDeserializer getDeserializer(FieldInfo paramFieldInfo)
  386. {
  387. return getDeserializer(paramFieldInfo.getFieldClass(), paramFieldInfo.getFieldType());
  388. }
  389. public ObjectDeserializer getDeserializer(Class<?> paramClass, Type paramType)
  390. {
  391. Object localObject1 = (ObjectDeserializer)this.derializers.get(paramType);
  392. if (localObject1 != null)
  393. return localObject1;
  394. localObject1 = paramType;
  395. if (paramType == null)
  396. localObject1 = paramClass;
  397. paramType = (ObjectDeserializer)this.derializers.get(localObject1);
  398. if (paramType != null)
  399. return paramType;
  400. Object localObject2 = (JSONType)paramClass.getAnnotation(JSONType.class);
  401. if (localObject2 != null)
  402. {
  403. localObject2 = ((JSONType)localObject2).mappingTo();
  404. if (localObject2 != Void.class)
  405. return getDeserializer((Class)localObject2, (Type)localObject2);
  406. }
  407. if (((localObject1 instanceof WildcardType)) || ((localObject1 instanceof TypeVariable)) || ((localObject1 instanceof ParameterizedType)))
  408. paramType = (ObjectDeserializer)this.derializers.get(paramClass);
  409. if (paramType != null)
  410. return paramType;
  411. paramType = Thread.currentThread().getContextClassLoader();
  412. try
  413. {
  414. paramType = ServiceLoader.load(AutowiredObjectDeserializer.class, paramType).iterator();
  415. while (paramType.hasNext())
  416. {
  417. localObject2 = (AutowiredObjectDeserializer)paramType.next();
  418. Iterator localIterator = ((AutowiredObjectDeserializer)localObject2).getAutowiredFor().iterator();
  419. while (localIterator.hasNext())
  420. {
  421. Type localType = (Type)localIterator.next();
  422. this.derializers.put(localType, localObject2);
  423. }
  424. }
  425. }
  426. catch (Exception paramType)
  427. {
  428. paramType = (ObjectDeserializer)this.derializers.get(localObject1);
  429. if (paramType != null)
  430. return paramType;
  431. if (!paramClass.isEnum())
  432. break label260;
  433. }
  434. paramClass = new EnumDeserializer(paramClass);
  435. while (true)
  436. {
  437. putDeserializer((Type)localObject1, paramClass);
  438. return paramClass;
  439. label260: if (paramClass.isArray())
  440. return ArrayDeserializer.instance;
  441. if ((paramClass == Set.class) || (paramClass == HashSet.class) || (paramClass == Collection.class) || (paramClass == List.class) || (paramClass == ArrayList.class))
  442. paramClass = CollectionDeserializer.instance;
  443. else if (Collection.class.isAssignableFrom(paramClass))
  444. paramClass = CollectionDeserializer.instance;
  445. else if (Map.class.isAssignableFrom(paramClass))
  446. paramClass = MapDeserializer.instance;
  447. else if (Throwable.class.isAssignableFrom(paramClass))
  448. paramClass = new ThrowableDeserializer(this, paramClass);
  449. else
  450. paramClass = createJavaBeanDeserializer(paramClass, (Type)localObject1);
  451. }
  452. }
  453. public ObjectDeserializer getDeserializer(Type paramType)
  454. {
  455. Object localObject = (ObjectDeserializer)this.derializers.get(paramType);
  456. if (localObject != null)
  457. return localObject;
  458. if ((paramType instanceof Class))
  459. return getDeserializer((Class)paramType, paramType);
  460. if ((paramType instanceof ParameterizedType))
  461. {
  462. localObject = ((ParameterizedType)paramType).getRawType();
  463. if ((localObject instanceof Class))
  464. return getDeserializer((Class)localObject, paramType);
  465. return getDeserializer((Type)localObject);
  466. }
  467. return JavaObjectDeserializer.instance;
  468. }
  469. public Map<String, FieldDeserializer> getFieldDeserializers(Class<?> paramClass)
  470. {
  471. paramClass = getDeserializer(paramClass);
  472. if ((paramClass instanceof JavaBeanDeserializer))
  473. return ((JavaBeanDeserializer)paramClass).getFieldDeserializerMap();
  474. if ((paramClass instanceof ASMJavaBeanDeserializer))
  475. return ((ASMJavaBeanDeserializer)paramClass).getInnterSerializer().getFieldDeserializerMap();
  476. return Collections.emptyMap();
  477. }
  478. public SymbolTable getSymbolTable()
  479. {
  480. return this.symbolTable;
  481. }
  482. public boolean isAsmEnable()
  483. {
  484. return this.asmEnable;
  485. }
  486. public boolean isPrimitive(Class<?> paramClass)
  487. {
  488. return this.primitiveClasses.contains(paramClass);
  489. }
  490. public void putDeserializer(Type paramType, ObjectDeserializer paramObjectDeserializer)
  491. {
  492. this.derializers.put(paramType, paramObjectDeserializer);
  493. }
  494. public void setAsmEnable(boolean paramBoolean)
  495. {
  496. this.asmEnable = paramBoolean;
  497. }
  498. }
  499. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  500. * Qualified Name: com.alibaba.fastjson.parser.ParserConfig
  501. * JD-Core Version: 0.6.2
  502. */