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

https://gitlab.com/qt-prometheus/qt-prometheus · Java · 46 lines · 37 code · 5 blank · 4 comment · 3 complexity · 623712b1342b0c8b3ff2869e413afa13 MD5 · raw file

  1. package com.alibaba.fastjson.parser.deserializer;
  2. import com.alibaba.fastjson.parser.DefaultJSONParser;
  3. import java.lang.reflect.Array;
  4. import java.lang.reflect.GenericArrayType;
  5. import java.lang.reflect.Type;
  6. import java.lang.reflect.TypeVariable;
  7. import java.util.ArrayList;
  8. import java.util.List;
  9. public class JavaObjectDeserializer
  10. implements ObjectDeserializer
  11. {
  12. public static final JavaObjectDeserializer instance = new JavaObjectDeserializer();
  13. public <T> T deserialze(DefaultJSONParser paramDefaultJSONParser, Type paramType, Object paramObject)
  14. {
  15. if ((paramType instanceof GenericArrayType))
  16. {
  17. paramObject = ((GenericArrayType)paramType).getGenericComponentType();
  18. paramType = paramObject;
  19. if ((paramObject instanceof TypeVariable))
  20. paramType = ((TypeVariable)paramObject).getBounds()[0];
  21. paramObject = new ArrayList();
  22. paramDefaultJSONParser.parseArray(paramType, paramObject);
  23. if ((paramType instanceof Class))
  24. {
  25. paramDefaultJSONParser = (Object[])Array.newInstance((Class)paramType, paramObject.size());
  26. paramObject.toArray(paramDefaultJSONParser);
  27. return paramDefaultJSONParser;
  28. }
  29. return paramObject.toArray();
  30. }
  31. return paramDefaultJSONParser.parse(paramObject);
  32. }
  33. public int getFastMatchToken()
  34. {
  35. return 12;
  36. }
  37. }
  38. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  39. * Qualified Name: com.alibaba.fastjson.parser.deserializer.JavaObjectDeserializer
  40. * JD-Core Version: 0.6.2
  41. */