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

https://gitlab.com/qt-prometheus/qt-prometheus · Java · 38 lines · 29 code · 5 blank · 4 comment · 6 complexity · 734068d484606c43c743d30e38ac5d83 MD5 · raw file

  1. package com.alibaba.fastjson.parser.deserializer;
  2. import com.alibaba.fastjson.parser.DefaultJSONParser;
  3. import java.lang.ref.SoftReference;
  4. import java.lang.ref.WeakReference;
  5. import java.lang.reflect.ParameterizedType;
  6. import java.lang.reflect.Type;
  7. import java.util.concurrent.atomic.AtomicReference;
  8. public class ReferenceDeserializer
  9. implements ObjectDeserializer
  10. {
  11. public static final ReferenceDeserializer instance = new ReferenceDeserializer();
  12. public <T> T deserialze(DefaultJSONParser paramDefaultJSONParser, Type paramType, Object paramObject)
  13. {
  14. paramType = (ParameterizedType)paramType;
  15. paramDefaultJSONParser = paramDefaultJSONParser.parseObject(paramType.getActualTypeArguments()[0]);
  16. paramType = paramType.getRawType();
  17. if (paramType == AtomicReference.class)
  18. return new AtomicReference(paramDefaultJSONParser);
  19. if (paramType == WeakReference.class)
  20. return new WeakReference(paramDefaultJSONParser);
  21. if (paramType == SoftReference.class)
  22. return new SoftReference(paramDefaultJSONParser);
  23. throw new UnsupportedOperationException(paramType.toString());
  24. }
  25. public int getFastMatchToken()
  26. {
  27. return 12;
  28. }
  29. }
  30. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  31. * Qualified Name: com.alibaba.fastjson.parser.deserializer.ReferenceDeserializer
  32. * JD-Core Version: 0.6.2
  33. */