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

https://gitlab.com/qt-prometheus/qt-prometheus · Java · 66 lines · 57 code · 5 blank · 4 comment · 9 complexity · 484ce06f227f05cd3402ccd273f24949 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.lang.reflect.Type;
  6. import java.net.InetAddress;
  7. import java.net.InetSocketAddress;
  8. public class InetSocketAddressDeserializer
  9. implements ObjectDeserializer
  10. {
  11. public static final InetSocketAddressDeserializer instance = new InetSocketAddressDeserializer();
  12. public <T> T deserialze(DefaultJSONParser paramDefaultJSONParser, Type paramType, Object paramObject)
  13. {
  14. paramObject = paramDefaultJSONParser.getLexer();
  15. if (paramObject.token() == 8)
  16. {
  17. paramObject.nextToken();
  18. return null;
  19. }
  20. paramDefaultJSONParser.accept(12);
  21. paramType = null;
  22. int i = 0;
  23. String str = paramObject.stringVal();
  24. paramObject.nextToken(17);
  25. if (str.equals("address"))
  26. {
  27. paramDefaultJSONParser.accept(17);
  28. paramType = (InetAddress)paramDefaultJSONParser.parseObject(InetAddress.class);
  29. }
  30. while (true)
  31. {
  32. if (paramObject.token() != 16)
  33. break label164;
  34. paramObject.nextToken();
  35. break;
  36. if (str.equals("port"))
  37. {
  38. paramDefaultJSONParser.accept(17);
  39. if (paramObject.token() != 2)
  40. throw new JSONException("port is not int");
  41. i = paramObject.intValue();
  42. paramObject.nextToken();
  43. }
  44. else
  45. {
  46. paramDefaultJSONParser.accept(17);
  47. paramDefaultJSONParser.parse();
  48. }
  49. }
  50. label164: paramDefaultJSONParser.accept(13);
  51. return new InetSocketAddress(paramType, i);
  52. }
  53. public int getFastMatchToken()
  54. {
  55. return 12;
  56. }
  57. }
  58. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  59. * Qualified Name: com.alibaba.fastjson.parser.deserializer.InetSocketAddressDeserializer
  60. * JD-Core Version: 0.6.2
  61. */