/QingTingFanBianYi/src/com/alibaba/fastjson/serializer/NumberFieldSerializer.java

https://gitlab.com/qt-prometheus/qt-prometheus · Java · 40 lines · 31 code · 5 blank · 4 comment · 3 complexity · e277afa513c6f7ac9cfa41e190634c1e MD5 · raw file

  1. package com.alibaba.fastjson.serializer;
  2. import com.alibaba.fastjson.util.FieldInfo;
  3. final class NumberFieldSerializer extends FieldSerializer
  4. {
  5. public NumberFieldSerializer(FieldInfo paramFieldInfo)
  6. {
  7. super(paramFieldInfo);
  8. }
  9. public void writeProperty(JSONSerializer paramJSONSerializer, Object paramObject)
  10. throws Exception
  11. {
  12. writePrefix(paramJSONSerializer);
  13. writeValue(paramJSONSerializer, paramObject);
  14. }
  15. public void writeValue(JSONSerializer paramJSONSerializer, Object paramObject)
  16. throws Exception
  17. {
  18. paramJSONSerializer = paramJSONSerializer.getWriter();
  19. if (paramObject == null)
  20. {
  21. if (paramJSONSerializer.isEnabled(SerializerFeature.WriteNullNumberAsZero))
  22. {
  23. paramJSONSerializer.write('0');
  24. return;
  25. }
  26. paramJSONSerializer.writeNull();
  27. return;
  28. }
  29. paramJSONSerializer.append(paramObject.toString());
  30. }
  31. }
  32. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  33. * Qualified Name: com.alibaba.fastjson.serializer.NumberFieldSerializer
  34. * JD-Core Version: 0.6.2
  35. */