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

https://gitlab.com/qt-prometheus/qt-prometheus · Java · 37 lines · 30 code · 3 blank · 4 comment · 2 complexity · c0c27ba778be773cc95734f521946fb8 MD5 · raw file

  1. package com.alibaba.fastjson.serializer;
  2. import com.alibaba.fastjson.JSONObject;
  3. import java.io.IOException;
  4. import java.lang.reflect.Type;
  5. import java.util.Date;
  6. public class JSONLibDataFormatSerializer
  7. implements ObjectSerializer
  8. {
  9. public void write(JSONSerializer paramJSONSerializer, Object paramObject1, Object paramObject2, Type paramType)
  10. throws IOException
  11. {
  12. if (paramObject1 == null)
  13. {
  14. paramJSONSerializer.getWriter().writeNull();
  15. return;
  16. }
  17. paramObject1 = (Date)paramObject1;
  18. paramObject2 = new JSONObject();
  19. paramObject2.put("date", Integer.valueOf(paramObject1.getDate()));
  20. paramObject2.put("day", Integer.valueOf(paramObject1.getDay()));
  21. paramObject2.put("hours", Integer.valueOf(paramObject1.getHours()));
  22. paramObject2.put("minutes", Integer.valueOf(paramObject1.getMinutes()));
  23. paramObject2.put("month", Integer.valueOf(paramObject1.getMonth()));
  24. paramObject2.put("seconds", Integer.valueOf(paramObject1.getSeconds()));
  25. paramObject2.put("time", Long.valueOf(paramObject1.getTime()));
  26. paramObject2.put("timezoneOffset", Integer.valueOf(paramObject1.getTimezoneOffset()));
  27. paramObject2.put("year", Integer.valueOf(paramObject1.getYear()));
  28. paramJSONSerializer.write(paramObject2);
  29. }
  30. }
  31. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  32. * Qualified Name: com.alibaba.fastjson.serializer.JSONLibDataFormatSerializer
  33. * JD-Core Version: 0.6.2
  34. */