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

https://gitlab.com/qt-prometheus/qt-prometheus · Java · 104 lines · 95 code · 5 blank · 4 comment · 20 complexity · bd12fd1272667be41bc5c73eb1bba751 MD5 · raw file

  1. package com.alibaba.fastjson.parser.deserializer;
  2. import com.alibaba.fastjson.JSONException;
  3. import com.alibaba.fastjson.parser.DefaultJSONParser;
  4. import com.alibaba.fastjson.parser.JSONLexer;
  5. import java.awt.Rectangle;
  6. import java.lang.reflect.Type;
  7. public class RectangleDeserializer
  8. implements ObjectDeserializer
  9. {
  10. public static final RectangleDeserializer instance = new RectangleDeserializer();
  11. public <T> T deserialze(DefaultJSONParser paramDefaultJSONParser, Type paramType, Object paramObject)
  12. {
  13. paramDefaultJSONParser = paramDefaultJSONParser.getLexer();
  14. if (paramDefaultJSONParser.token() == 8)
  15. {
  16. paramDefaultJSONParser.nextToken();
  17. return null;
  18. }
  19. if ((paramDefaultJSONParser.token() != 12) && (paramDefaultJSONParser.token() != 16))
  20. throw new JSONException("syntax error");
  21. paramDefaultJSONParser.nextToken();
  22. int k = 0;
  23. int j = 0;
  24. int m = 0;
  25. int n = 0;
  26. if (paramDefaultJSONParser.token() == 13)
  27. {
  28. paramDefaultJSONParser.nextToken();
  29. return new Rectangle(k, j, m, n);
  30. }
  31. int i;
  32. int i3;
  33. int i2;
  34. int i1;
  35. if (paramDefaultJSONParser.token() == 4)
  36. {
  37. paramType = paramDefaultJSONParser.stringVal();
  38. paramDefaultJSONParser.nextTokenWithColon(2);
  39. if (paramDefaultJSONParser.token() != 2)
  40. break label243;
  41. i = paramDefaultJSONParser.intValue();
  42. paramDefaultJSONParser.nextToken();
  43. if (!paramType.equalsIgnoreCase("x"))
  44. break label253;
  45. i3 = j;
  46. i2 = i;
  47. i1 = m;
  48. i = n;
  49. }
  50. while (true)
  51. {
  52. n = i;
  53. m = i1;
  54. k = i2;
  55. j = i3;
  56. if (paramDefaultJSONParser.token() != 16)
  57. break;
  58. paramDefaultJSONParser.nextToken(4);
  59. n = i;
  60. m = i1;
  61. k = i2;
  62. j = i3;
  63. break;
  64. throw new JSONException("syntax error");
  65. label243: throw new JSONException("syntax error");
  66. label253: if (paramType.equalsIgnoreCase("y"))
  67. {
  68. i3 = i;
  69. i = n;
  70. i1 = m;
  71. i2 = k;
  72. }
  73. else if (paramType.equalsIgnoreCase("width"))
  74. {
  75. i1 = i;
  76. i = n;
  77. i2 = k;
  78. i3 = j;
  79. }
  80. else
  81. {
  82. if (!paramType.equalsIgnoreCase("height"))
  83. break label333;
  84. i1 = m;
  85. i2 = k;
  86. i3 = j;
  87. }
  88. }
  89. label333: throw new JSONException("syntax error, " + paramType);
  90. }
  91. public int getFastMatchToken()
  92. {
  93. return 12;
  94. }
  95. }
  96. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  97. * Qualified Name: com.alibaba.fastjson.parser.deserializer.RectangleDeserializer
  98. * JD-Core Version: 0.6.2
  99. */