PageRenderTime 68ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://gitlab.com/qt-prometheus/qt-prometheus
Java | 40 lines | 32 code | 4 blank | 4 comment | 3 complexity | 71cc783d0e3366398d9f2063a947db52 MD5 | raw file
  1. package com.alibaba.fastjson.serializer;
  2. import com.alibaba.fastjson.JSON;
  3. import java.awt.Point;
  4. import java.io.IOException;
  5. import java.lang.reflect.Type;
  6. public class PointSerializer
  7. implements ObjectSerializer
  8. {
  9. public static final PointSerializer instance = new PointSerializer();
  10. public void write(JSONSerializer paramJSONSerializer, Object paramObject1, Object paramObject2, Type paramType)
  11. throws IOException
  12. {
  13. paramJSONSerializer = paramJSONSerializer.getWriter();
  14. paramObject1 = (Point)paramObject1;
  15. if (paramObject1 == null)
  16. {
  17. paramJSONSerializer.writeNull();
  18. return;
  19. }
  20. char c = '{';
  21. if (paramJSONSerializer.isEnabled(SerializerFeature.WriteClassName))
  22. {
  23. paramJSONSerializer.write('{');
  24. paramJSONSerializer.writeFieldName(JSON.DEFAULT_TYPE_KEY);
  25. paramJSONSerializer.writeString(Point.class.getName());
  26. c = ',';
  27. }
  28. paramJSONSerializer.writeFieldValue(c, "x", paramObject1.getX());
  29. paramJSONSerializer.writeFieldValue(',', "y", paramObject1.getY());
  30. paramJSONSerializer.write('}');
  31. }
  32. }
  33. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  34. * Qualified Name: com.alibaba.fastjson.serializer.PointSerializer
  35. * JD-Core Version: 0.6.2
  36. */