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

https://gitlab.com/qt-prometheus/qt-prometheus · Java · 82 lines · 73 code · 5 blank · 4 comment · 19 complexity · a8b5ccd2e5f19af98615b479ccedc960 MD5 · raw file

  1. package com.alibaba.fastjson.parser.deserializer;
  2. import com.alibaba.fastjson.JSON;
  3. import com.alibaba.fastjson.JSONException;
  4. import com.alibaba.fastjson.parser.DefaultJSONParser;
  5. import com.alibaba.fastjson.parser.JSONLexer;
  6. import java.awt.Point;
  7. import java.lang.reflect.Type;
  8. public class PointDeserializer
  9. implements ObjectDeserializer
  10. {
  11. public static final PointDeserializer instance = new PointDeserializer();
  12. public <T> T deserialze(DefaultJSONParser paramDefaultJSONParser, Type paramType, Object paramObject)
  13. {
  14. paramType = paramDefaultJSONParser.getLexer();
  15. if (paramType.token() == 8)
  16. {
  17. paramType.nextToken(16);
  18. return null;
  19. }
  20. if ((paramType.token() != 12) && (paramType.token() != 16))
  21. throw new JSONException("syntax error");
  22. paramType.nextToken();
  23. int j = 0;
  24. int i = 0;
  25. while (true)
  26. {
  27. if (paramType.token() == 13)
  28. {
  29. paramType.nextToken();
  30. return new Point(j, i);
  31. }
  32. if (paramType.token() != 4)
  33. break label216;
  34. paramObject = paramType.stringVal();
  35. if (!JSON.DEFAULT_TYPE_KEY.equals(paramObject))
  36. break;
  37. paramDefaultJSONParser.acceptType("java.awt.Point");
  38. }
  39. paramType.nextTokenWithColon(2);
  40. int k;
  41. int m;
  42. if (paramType.token() == 2)
  43. {
  44. k = paramType.intValue();
  45. paramType.nextToken();
  46. if (!paramObject.equalsIgnoreCase("x"))
  47. break label258;
  48. m = i;
  49. }
  50. while (true)
  51. {
  52. j = k;
  53. i = m;
  54. if (paramType.token() != 16)
  55. break;
  56. paramType.nextToken(4);
  57. j = k;
  58. i = m;
  59. break;
  60. label216: throw new JSONException("syntax error");
  61. throw new JSONException("syntax error : " + paramType.tokenName());
  62. label258: if (!paramObject.equalsIgnoreCase("y"))
  63. break label278;
  64. m = k;
  65. k = j;
  66. }
  67. label278: throw new JSONException("syntax error, " + paramObject);
  68. }
  69. public int getFastMatchToken()
  70. {
  71. return 12;
  72. }
  73. }
  74. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  75. * Qualified Name: com.alibaba.fastjson.parser.deserializer.PointDeserializer
  76. * JD-Core Version: 0.6.2
  77. */