PageRenderTime 4138ms CodeModel.GetById 24ms RepoModel.GetById 2ms app.codeStats 0ms

/QingTingFanBianYi/src/com/alibaba/fastjson/parser/JSONScanner.java

https://gitlab.com/qt-prometheus/qt-prometheus
Java | 1167 lines | 1134 code | 29 blank | 4 comment | 242 complexity | ccda6d31db888b7ccc09ea82307bfb7e MD5 | raw file
  1. package com.alibaba.fastjson.parser;
  2. import com.alibaba.fastjson.JSON;
  3. import com.alibaba.fastjson.JSONException;
  4. import com.alibaba.fastjson.util.Base64;
  5. import java.util.ArrayList;
  6. import java.util.Calendar;
  7. import java.util.Collection;
  8. import java.util.HashSet;
  9. import java.util.Locale;
  10. import java.util.TimeZone;
  11. public final class JSONScanner extends JSONLexerBase
  12. {
  13. protected static final char[] typeFieldName = ("\"" + JSON.DEFAULT_TYPE_KEY + "\":\"").toCharArray();
  14. public final int ISO8601_LEN_0 = "0000-00-00".length();
  15. public final int ISO8601_LEN_1 = "0000-00-00T00:00:00".length();
  16. public final int ISO8601_LEN_2 = "0000-00-00T00:00:00.000".length();
  17. private final String text;
  18. public JSONScanner(String paramString)
  19. {
  20. this(paramString, JSON.DEFAULT_PARSER_FEATURE);
  21. }
  22. public JSONScanner(String paramString, int paramInt)
  23. {
  24. this.features = paramInt;
  25. this.text = paramString;
  26. this.bp = -1;
  27. next();
  28. if (this.ch == 65279)
  29. next();
  30. }
  31. public JSONScanner(char[] paramArrayOfChar, int paramInt)
  32. {
  33. this(paramArrayOfChar, paramInt, JSON.DEFAULT_PARSER_FEATURE);
  34. }
  35. public JSONScanner(char[] paramArrayOfChar, int paramInt1, int paramInt2)
  36. {
  37. this(new String(paramArrayOfChar, 0, paramInt1), paramInt2);
  38. }
  39. static final boolean charArrayCompare(String paramString, int paramInt, char[] paramArrayOfChar)
  40. {
  41. int j = paramArrayOfChar.length;
  42. if (j + paramInt > paramString.length())
  43. return false;
  44. int i = 0;
  45. while (true)
  46. {
  47. if (i >= j)
  48. break label45;
  49. if (paramArrayOfChar[i] != paramString.charAt(paramInt + i))
  50. break;
  51. i += 1;
  52. }
  53. label45: return true;
  54. }
  55. static boolean checkDate(char paramChar1, char paramChar2, char paramChar3, char paramChar4, char paramChar5, char paramChar6, int paramInt1, int paramInt2)
  56. {
  57. if ((paramChar1 != '1') && (paramChar1 != '2'));
  58. label71:
  59. do
  60. {
  61. do
  62. {
  63. do
  64. return false;
  65. while ((paramChar2 < '0') || (paramChar2 > '9') || (paramChar3 < '0') || (paramChar3 > '9') || (paramChar4 < '0') || (paramChar4 > '9'));
  66. if (paramChar5 != '0')
  67. break;
  68. }
  69. while ((paramChar6 < '1') || (paramChar6 > '9'));
  70. if (paramInt1 != 48)
  71. break label124;
  72. }
  73. while ((paramInt2 < 49) || (paramInt2 > 57));
  74. label124:
  75. do
  76. {
  77. do
  78. {
  79. return true;
  80. if (paramChar5 != '1')
  81. break;
  82. if ((paramChar6 == '0') || (paramChar6 == '1') || (paramChar6 == '2'))
  83. break label71;
  84. return false;
  85. if ((paramInt1 != 49) && (paramInt1 != 50))
  86. break label154;
  87. if (paramInt2 < 48)
  88. break;
  89. }
  90. while (paramInt2 <= 57);
  91. return false;
  92. if (paramInt1 != 51)
  93. break;
  94. }
  95. while ((paramInt2 == 48) || (paramInt2 == 49));
  96. label154: return false;
  97. }
  98. private boolean checkTime(char paramChar1, char paramChar2, char paramChar3, char paramChar4, char paramChar5, char paramChar6)
  99. {
  100. if (paramChar1 == '0')
  101. if ((paramChar2 >= '0') && (paramChar2 <= '9'))
  102. break label38;
  103. label38: label64:
  104. do
  105. {
  106. do
  107. {
  108. do
  109. {
  110. return false;
  111. if (paramChar1 != '1')
  112. break;
  113. }
  114. while ((paramChar2 < '0') || (paramChar2 > '9'));
  115. if ((paramChar3 < '0') || (paramChar3 > '5'))
  116. break label114;
  117. }
  118. while ((paramChar4 < '0') || (paramChar4 > '9'));
  119. if ((paramChar5 < '0') || (paramChar5 > '5'))
  120. break label129;
  121. }
  122. while ((paramChar6 < '0') || (paramChar6 > '9'));
  123. label114:
  124. do
  125. {
  126. return true;
  127. if ((paramChar1 != '2') || (paramChar2 < '0'))
  128. break;
  129. if (paramChar2 <= '4')
  130. break label38;
  131. return false;
  132. if (paramChar3 != '6')
  133. break;
  134. if (paramChar4 == '0')
  135. break label64;
  136. return false;
  137. if (paramChar5 != '6')
  138. break;
  139. }
  140. while (paramChar6 == '0');
  141. label129: return false;
  142. }
  143. private void setCalendar(char paramChar1, char paramChar2, char paramChar3, char paramChar4, char paramChar5, char paramChar6, char paramChar7, char paramChar8)
  144. {
  145. Locale localLocale = Locale.getDefault();
  146. this.calendar = Calendar.getInstance(TimeZone.getDefault(), localLocale);
  147. paramChar1 = digits[paramChar1];
  148. paramChar2 = digits[paramChar2];
  149. paramChar3 = digits[paramChar3];
  150. paramChar4 = digits[paramChar4];
  151. paramChar5 = digits[paramChar5];
  152. paramChar6 = digits[paramChar6];
  153. paramChar7 = digits[paramChar7];
  154. paramChar8 = digits[paramChar8];
  155. this.calendar.set(1, paramChar1 * 'Ϩ' + paramChar2 * 'd' + paramChar3 * '\n' + paramChar4);
  156. this.calendar.set(2, paramChar5 * '\n' + paramChar6 - 1);
  157. this.calendar.set(5, paramChar7 * '\n' + paramChar8);
  158. }
  159. public final String addSymbol(int paramInt1, int paramInt2, int paramInt3, SymbolTable paramSymbolTable)
  160. {
  161. return paramSymbolTable.addSymbol(this.text, paramInt1, paramInt2, paramInt3);
  162. }
  163. protected final void arrayCopy(int paramInt1, char[] paramArrayOfChar, int paramInt2, int paramInt3)
  164. {
  165. this.text.getChars(paramInt1, paramInt1 + paramInt3, paramArrayOfChar, paramInt2);
  166. }
  167. public byte[] bytesValue()
  168. {
  169. return Base64.decodeFast(this.text, this.np + 1, this.sp);
  170. }
  171. public final boolean charArrayCompare(char[] paramArrayOfChar)
  172. {
  173. return charArrayCompare(this.text, this.bp, paramArrayOfChar);
  174. }
  175. public final char charAt(int paramInt)
  176. {
  177. if (paramInt >= this.text.length())
  178. return '\032';
  179. return this.text.charAt(paramInt);
  180. }
  181. protected final void copyTo(int paramInt1, int paramInt2, char[] paramArrayOfChar)
  182. {
  183. this.text.getChars(paramInt1, paramInt1 + paramInt2, paramArrayOfChar, 0);
  184. }
  185. public final int indexOf(char paramChar, int paramInt)
  186. {
  187. return this.text.indexOf(paramChar, paramInt);
  188. }
  189. public boolean isEOF()
  190. {
  191. return (this.bp == this.text.length()) || ((this.ch == '\032') && (this.bp + 1 == this.text.length()));
  192. }
  193. public final char next()
  194. {
  195. int i = this.bp + 1;
  196. this.bp = i;
  197. char c = charAt(i);
  198. this.ch = c;
  199. return c;
  200. }
  201. public final String numberString()
  202. {
  203. int k = charAt(this.np + this.sp - 1);
  204. int j = this.sp;
  205. int i;
  206. if ((k != 76) && (k != 83) && (k != 66) && (k != 70))
  207. {
  208. i = j;
  209. if (k != 68);
  210. }
  211. else
  212. {
  213. i = j - 1;
  214. }
  215. return this.text.substring(this.np, this.np + i);
  216. }
  217. public boolean scanFieldBoolean(char[] paramArrayOfChar)
  218. {
  219. this.matchStat = 0;
  220. if (!charArrayCompare(this.text, this.bp, paramArrayOfChar))
  221. {
  222. this.matchStat = -2;
  223. return false;
  224. }
  225. int j = this.bp + paramArrayOfChar.length;
  226. int i = j + 1;
  227. j = charAt(j);
  228. boolean bool;
  229. if (j == 116)
  230. {
  231. j = i + 1;
  232. if (charAt(i) != 'r')
  233. {
  234. this.matchStat = -1;
  235. return false;
  236. }
  237. i = j + 1;
  238. if (charAt(j) != 'u')
  239. {
  240. this.matchStat = -1;
  241. return false;
  242. }
  243. if (charAt(i) != 'e')
  244. {
  245. this.matchStat = -1;
  246. return false;
  247. }
  248. this.bp = (i + 1);
  249. i = charAt(this.bp);
  250. bool = true;
  251. }
  252. while (i == 44)
  253. {
  254. i = this.bp + 1;
  255. this.bp = i;
  256. this.ch = charAt(i);
  257. this.matchStat = 3;
  258. this.token = 16;
  259. return bool;
  260. if (j == 102)
  261. {
  262. j = i + 1;
  263. if (charAt(i) != 'a')
  264. {
  265. this.matchStat = -1;
  266. return false;
  267. }
  268. i = j + 1;
  269. if (charAt(j) != 'l')
  270. {
  271. this.matchStat = -1;
  272. return false;
  273. }
  274. j = i + 1;
  275. if (charAt(i) != 's')
  276. {
  277. this.matchStat = -1;
  278. return false;
  279. }
  280. if (charAt(j) != 'e')
  281. {
  282. this.matchStat = -1;
  283. return false;
  284. }
  285. this.bp = (j + 1);
  286. i = charAt(this.bp);
  287. bool = false;
  288. }
  289. else
  290. {
  291. this.matchStat = -1;
  292. return false;
  293. }
  294. }
  295. if (i == 125)
  296. {
  297. i = this.bp + 1;
  298. this.bp = i;
  299. i = charAt(i);
  300. if (i == 44)
  301. {
  302. this.token = 16;
  303. i = this.bp + 1;
  304. this.bp = i;
  305. this.ch = charAt(i);
  306. }
  307. while (true)
  308. {
  309. this.matchStat = 4;
  310. return bool;
  311. if (i == 93)
  312. {
  313. this.token = 15;
  314. i = this.bp + 1;
  315. this.bp = i;
  316. this.ch = charAt(i);
  317. }
  318. else if (i == 125)
  319. {
  320. this.token = 13;
  321. i = this.bp + 1;
  322. this.bp = i;
  323. this.ch = charAt(i);
  324. }
  325. else
  326. {
  327. if (i != 26)
  328. break;
  329. this.token = 20;
  330. }
  331. }
  332. this.matchStat = -1;
  333. return false;
  334. }
  335. this.matchStat = -1;
  336. return false;
  337. }
  338. public int scanFieldInt(char[] paramArrayOfChar)
  339. {
  340. this.matchStat = 0;
  341. int m = this.bp;
  342. char c = this.ch;
  343. if (!charArrayCompare(this.text, this.bp, paramArrayOfChar))
  344. {
  345. this.matchStat = -2;
  346. j = 0;
  347. }
  348. int i;
  349. int n;
  350. do
  351. {
  352. return j;
  353. j = this.bp + paramArrayOfChar.length;
  354. i = charAt(j);
  355. if ((i >= 48) && (i <= 57))
  356. {
  357. i = digits[i];
  358. j += 1;
  359. int k;
  360. while (true)
  361. {
  362. k = j + 1;
  363. n = charAt(j);
  364. if ((n < 48) || (n > 57))
  365. break;
  366. i = i * 10 + digits[n];
  367. j = k;
  368. }
  369. if (n == 46)
  370. {
  371. this.matchStat = -1;
  372. return 0;
  373. }
  374. this.bp = (k - 1);
  375. if (i < 0)
  376. {
  377. this.matchStat = -1;
  378. return 0;
  379. }
  380. }
  381. else
  382. {
  383. this.matchStat = -1;
  384. return 0;
  385. }
  386. if (n == 44)
  387. {
  388. j = this.bp + 1;
  389. this.bp = j;
  390. this.ch = charAt(j);
  391. this.matchStat = 3;
  392. this.token = 16;
  393. return i;
  394. }
  395. j = i;
  396. }
  397. while (n != 125);
  398. int j = this.bp + 1;
  399. this.bp = j;
  400. j = charAt(j);
  401. if (j == 44)
  402. {
  403. this.token = 16;
  404. j = this.bp + 1;
  405. this.bp = j;
  406. this.ch = charAt(j);
  407. }
  408. while (true)
  409. {
  410. this.matchStat = 4;
  411. return i;
  412. if (j == 93)
  413. {
  414. this.token = 15;
  415. j = this.bp + 1;
  416. this.bp = j;
  417. this.ch = charAt(j);
  418. }
  419. else if (j == 125)
  420. {
  421. this.token = 13;
  422. j = this.bp + 1;
  423. this.bp = j;
  424. this.ch = charAt(j);
  425. }
  426. else
  427. {
  428. if (j != 26)
  429. break;
  430. this.token = 20;
  431. }
  432. }
  433. this.bp = m;
  434. this.ch = c;
  435. this.matchStat = -1;
  436. return 0;
  437. }
  438. public long scanFieldLong(char[] paramArrayOfChar)
  439. {
  440. this.matchStat = 0;
  441. int k = this.bp;
  442. char c = this.ch;
  443. if (!charArrayCompare(this.text, this.bp, paramArrayOfChar))
  444. {
  445. this.matchStat = -2;
  446. return 0L;
  447. }
  448. int i = this.bp + paramArrayOfChar.length;
  449. int j = charAt(i);
  450. long l;
  451. if ((j >= 48) && (j <= 57))
  452. {
  453. l = digits[j];
  454. i += 1;
  455. while (true)
  456. {
  457. j = i + 1;
  458. i = charAt(i);
  459. if ((i < 48) || (i > 57))
  460. break;
  461. l = 10L * l + digits[i];
  462. i = j;
  463. }
  464. if (i == 46)
  465. {
  466. this.matchStat = -1;
  467. return 0L;
  468. }
  469. this.bp = (j - 1);
  470. if (l < 0L)
  471. {
  472. this.bp = k;
  473. this.ch = c;
  474. this.matchStat = -1;
  475. return 0L;
  476. }
  477. }
  478. else
  479. {
  480. this.bp = k;
  481. this.ch = c;
  482. this.matchStat = -1;
  483. return 0L;
  484. }
  485. if (i == 44)
  486. {
  487. i = this.bp + 1;
  488. this.bp = i;
  489. charAt(i);
  490. this.matchStat = 3;
  491. this.token = 16;
  492. return l;
  493. }
  494. if (i == 125)
  495. {
  496. i = this.bp + 1;
  497. this.bp = i;
  498. i = charAt(i);
  499. if (i == 44)
  500. {
  501. this.token = 16;
  502. i = this.bp + 1;
  503. this.bp = i;
  504. this.ch = charAt(i);
  505. }
  506. while (true)
  507. {
  508. this.matchStat = 4;
  509. return l;
  510. if (i == 93)
  511. {
  512. this.token = 15;
  513. i = this.bp + 1;
  514. this.bp = i;
  515. this.ch = charAt(i);
  516. }
  517. else if (i == 125)
  518. {
  519. this.token = 13;
  520. i = this.bp + 1;
  521. this.bp = i;
  522. this.ch = charAt(i);
  523. }
  524. else
  525. {
  526. if (i != 26)
  527. break;
  528. this.token = 20;
  529. }
  530. }
  531. this.bp = k;
  532. this.ch = c;
  533. this.matchStat = -1;
  534. return 0L;
  535. }
  536. this.matchStat = -1;
  537. return 0L;
  538. }
  539. public String scanFieldString(char[] paramArrayOfChar)
  540. {
  541. this.matchStat = 0;
  542. int m = this.bp;
  543. char c1 = this.ch;
  544. if (!charArrayCompare(this.text, this.bp, paramArrayOfChar))
  545. {
  546. this.matchStat = -2;
  547. return stringDefaultValue();
  548. }
  549. int j = this.bp + paramArrayOfChar.length;
  550. int i = j + 1;
  551. if (charAt(j) != '"')
  552. {
  553. this.matchStat = -1;
  554. return stringDefaultValue();
  555. }
  556. int k = 0;
  557. int n = this.text.indexOf('"', i);
  558. if (n == -1)
  559. throw new JSONException("unclosed str");
  560. paramArrayOfChar = subString(i, n - i);
  561. i = 0;
  562. while (true)
  563. {
  564. j = k;
  565. if (i < paramArrayOfChar.length())
  566. {
  567. if (paramArrayOfChar.charAt(i) == '\\')
  568. j = 1;
  569. }
  570. else
  571. {
  572. if (j == 0)
  573. break;
  574. this.matchStat = -1;
  575. return stringDefaultValue();
  576. }
  577. i += 1;
  578. }
  579. this.bp = (n + 1);
  580. char c2 = charAt(this.bp);
  581. this.ch = c2;
  582. if (c2 == ',')
  583. {
  584. i = this.bp + 1;
  585. this.bp = i;
  586. this.ch = charAt(i);
  587. this.matchStat = 3;
  588. return paramArrayOfChar;
  589. }
  590. if (c2 == '}')
  591. {
  592. i = this.bp + 1;
  593. this.bp = i;
  594. i = charAt(i);
  595. if (i == 44)
  596. {
  597. this.token = 16;
  598. i = this.bp + 1;
  599. this.bp = i;
  600. this.ch = charAt(i);
  601. }
  602. while (true)
  603. {
  604. this.matchStat = 4;
  605. return paramArrayOfChar;
  606. if (i == 93)
  607. {
  608. this.token = 15;
  609. i = this.bp + 1;
  610. this.bp = i;
  611. this.ch = charAt(i);
  612. }
  613. else if (i == 125)
  614. {
  615. this.token = 13;
  616. i = this.bp + 1;
  617. this.bp = i;
  618. this.ch = charAt(i);
  619. }
  620. else
  621. {
  622. if (i != 26)
  623. break;
  624. this.token = 20;
  625. }
  626. }
  627. this.bp = m;
  628. this.ch = c1;
  629. this.matchStat = -1;
  630. return stringDefaultValue();
  631. }
  632. this.matchStat = -1;
  633. return stringDefaultValue();
  634. }
  635. public Collection<String> scanFieldStringArray(char[] paramArrayOfChar, Class<?> paramClass)
  636. {
  637. this.matchStat = 0;
  638. if (!charArrayCompare(this.text, this.bp, paramArrayOfChar))
  639. {
  640. this.matchStat = -2;
  641. return null;
  642. }
  643. if (paramClass.isAssignableFrom(HashSet.class))
  644. paramClass = new HashSet();
  645. while (true)
  646. {
  647. i = this.bp + paramArrayOfChar.length;
  648. j = i + 1;
  649. if (charAt(i) != '[')
  650. {
  651. this.matchStat = -1;
  652. return null;
  653. if (paramClass.isAssignableFrom(ArrayList.class))
  654. {
  655. paramClass = new ArrayList();
  656. continue;
  657. }
  658. try
  659. {
  660. paramClass = (Collection)paramClass.newInstance();
  661. }
  662. catch (Exception paramArrayOfChar)
  663. {
  664. throw new JSONException(paramArrayOfChar.getMessage(), paramArrayOfChar);
  665. }
  666. }
  667. }
  668. int i = j + 1;
  669. int j = charAt(j);
  670. if (j != 34)
  671. {
  672. this.matchStat = -1;
  673. return null;
  674. }
  675. j = i;
  676. while (true)
  677. {
  678. int k = j;
  679. j = k + 1;
  680. k = charAt(k);
  681. if (k == 34)
  682. {
  683. paramClass.add(this.text.substring(i, j - 1));
  684. i = j + 1;
  685. j = charAt(j);
  686. if (j != 44)
  687. break label252;
  688. j = charAt(i);
  689. i += 1;
  690. break;
  691. }
  692. if (k == 92)
  693. {
  694. this.matchStat = -1;
  695. return null;
  696. label252: if (j == 93)
  697. {
  698. j = charAt(i);
  699. this.bp = (i + 1);
  700. if (j == 44)
  701. {
  702. this.ch = charAt(this.bp);
  703. this.matchStat = 3;
  704. return paramClass;
  705. }
  706. }
  707. else
  708. {
  709. this.matchStat = -1;
  710. return null;
  711. }
  712. if (j == 125)
  713. {
  714. char c = charAt(this.bp);
  715. if (c == ',')
  716. {
  717. this.token = 16;
  718. i = this.bp + 1;
  719. this.bp = i;
  720. this.ch = charAt(i);
  721. }
  722. while (true)
  723. {
  724. this.matchStat = 4;
  725. return paramClass;
  726. if (c == ']')
  727. {
  728. this.token = 15;
  729. i = this.bp + 1;
  730. this.bp = i;
  731. this.ch = charAt(i);
  732. }
  733. else if (c == '}')
  734. {
  735. this.token = 13;
  736. i = this.bp + 1;
  737. this.bp = i;
  738. this.ch = charAt(i);
  739. }
  740. else
  741. {
  742. if (c != '\032')
  743. break;
  744. this.token = 20;
  745. this.ch = c;
  746. }
  747. }
  748. this.matchStat = -1;
  749. return null;
  750. }
  751. this.matchStat = -1;
  752. return null;
  753. }
  754. }
  755. }
  756. public String scanFieldSymbol(char[] paramArrayOfChar, SymbolTable paramSymbolTable)
  757. {
  758. this.matchStat = 0;
  759. if (!charArrayCompare(this.text, this.bp, paramArrayOfChar))
  760. {
  761. this.matchStat = -2;
  762. return null;
  763. }
  764. int i = this.bp + paramArrayOfChar.length;
  765. int k = i + 1;
  766. if (charAt(i) != '"')
  767. {
  768. this.matchStat = -1;
  769. return null;
  770. }
  771. i = 0;
  772. int m;
  773. for (int j = k; ; j = m)
  774. {
  775. m = j + 1;
  776. j = charAt(j);
  777. char c;
  778. if (j == 34)
  779. {
  780. this.bp = m;
  781. c = charAt(this.bp);
  782. this.ch = c;
  783. paramArrayOfChar = paramSymbolTable.addSymbol(this.text, k, m - k - 1, i);
  784. if (c == ',')
  785. {
  786. i = this.bp + 1;
  787. this.bp = i;
  788. this.ch = charAt(i);
  789. this.matchStat = 3;
  790. return paramArrayOfChar;
  791. }
  792. }
  793. else
  794. {
  795. i = i * 31 + j;
  796. if (j != 92)
  797. continue;
  798. this.matchStat = -1;
  799. return null;
  800. }
  801. if (c == '}')
  802. {
  803. i = this.bp + 1;
  804. this.bp = i;
  805. i = charAt(i);
  806. if (i == 44)
  807. {
  808. this.token = 16;
  809. i = this.bp + 1;
  810. this.bp = i;
  811. this.ch = charAt(i);
  812. }
  813. while (true)
  814. {
  815. this.matchStat = 4;
  816. return paramArrayOfChar;
  817. if (i == 93)
  818. {
  819. this.token = 15;
  820. i = this.bp + 1;
  821. this.bp = i;
  822. this.ch = charAt(i);
  823. }
  824. else if (i == 125)
  825. {
  826. this.token = 13;
  827. i = this.bp + 1;
  828. this.bp = i;
  829. this.ch = charAt(i);
  830. }
  831. else
  832. {
  833. if (i != 26)
  834. break;
  835. this.token = 20;
  836. }
  837. }
  838. this.matchStat = -1;
  839. return null;
  840. }
  841. this.matchStat = -1;
  842. return null;
  843. }
  844. }
  845. public boolean scanISO8601DateIfMatch()
  846. {
  847. return scanISO8601DateIfMatch(true);
  848. }
  849. public boolean scanISO8601DateIfMatch(boolean paramBoolean)
  850. {
  851. int m = this.text.length() - this.bp;
  852. if ((!paramBoolean) && (m > 13))
  853. {
  854. i = charAt(this.bp);
  855. j = charAt(this.bp + 1);
  856. k = charAt(this.bp + 2);
  857. n = charAt(this.bp + 3);
  858. i1 = charAt(this.bp + 4);
  859. i2 = charAt(this.bp + 5);
  860. int i3 = charAt(this.bp + m - 1);
  861. int i4 = charAt(this.bp + m - 2);
  862. if ((i == 47) && (j == 68) && (k == 97) && (n == 116) && (i1 == 101) && (i2 == 40) && (i3 == 47) && (i4 == 41))
  863. {
  864. j = -1;
  865. i = 6;
  866. if (i < m)
  867. {
  868. n = charAt(this.bp + i);
  869. if (n == 43)
  870. k = i;
  871. do
  872. {
  873. i += 1;
  874. j = k;
  875. break;
  876. if (n < 48)
  877. break label250;
  878. k = j;
  879. }
  880. while (n <= 57);
  881. }
  882. label250: if (j == -1)
  883. return false;
  884. i = this.bp + 6;
  885. long l = Long.parseLong(subString(i, j - i));
  886. Locale localLocale = Locale.getDefault();
  887. this.calendar = Calendar.getInstance(TimeZone.getDefault(), localLocale);
  888. this.calendar.setTimeInMillis(l);
  889. this.token = 5;
  890. return true;
  891. }
  892. }
  893. if ((m == 8) || (m == 14) || (m == 17))
  894. {
  895. if (paramBoolean)
  896. return false;
  897. c1 = charAt(this.bp);
  898. c2 = charAt(this.bp + 1);
  899. c3 = charAt(this.bp + 2);
  900. c4 = charAt(this.bp + 3);
  901. c5 = charAt(this.bp + 4);
  902. c6 = charAt(this.bp + 5);
  903. c7 = charAt(this.bp + 6);
  904. c8 = charAt(this.bp + 7);
  905. if (!checkDate(c1, c2, c3, c4, c5, c6, c7, c8))
  906. return false;
  907. setCalendar(c1, c2, c3, c4, c5, c6, c7, c8);
  908. if (m != 8)
  909. {
  910. c1 = charAt(this.bp + 8);
  911. c2 = charAt(this.bp + 9);
  912. c3 = charAt(this.bp + 10);
  913. c4 = charAt(this.bp + 11);
  914. c5 = charAt(this.bp + 12);
  915. c6 = charAt(this.bp + 13);
  916. if (!checkTime(c1, c2, c3, c4, c5, c6))
  917. return false;
  918. if (m == 17)
  919. {
  920. i = charAt(this.bp + 14);
  921. j = charAt(this.bp + 15);
  922. k = charAt(this.bp + 16);
  923. if ((i < 48) || (i > 57))
  924. return false;
  925. if ((j < 48) || (j > 57))
  926. return false;
  927. if ((k < 48) || (k > 57))
  928. return false;
  929. i = digits[i] * 100 + digits[j] * 10 + digits[k];
  930. n = digits[c1] * 10 + digits[c2];
  931. k = digits[c3] * 10 + digits[c4];
  932. m = digits[c5] * 10 + digits[c6];
  933. j = i;
  934. i = n;
  935. }
  936. }
  937. while (true)
  938. {
  939. this.calendar.set(11, i);
  940. this.calendar.set(12, k);
  941. this.calendar.set(13, m);
  942. this.calendar.set(14, j);
  943. this.token = 5;
  944. return true;
  945. i = 0;
  946. break;
  947. i = 0;
  948. k = 0;
  949. m = 0;
  950. j = 0;
  951. }
  952. }
  953. if (m < this.ISO8601_LEN_0)
  954. return false;
  955. if (charAt(this.bp + 4) != '-')
  956. return false;
  957. if (charAt(this.bp + 7) != '-')
  958. return false;
  959. char c1 = charAt(this.bp);
  960. char c2 = charAt(this.bp + 1);
  961. char c3 = charAt(this.bp + 2);
  962. char c4 = charAt(this.bp + 3);
  963. char c5 = charAt(this.bp + 5);
  964. char c6 = charAt(this.bp + 6);
  965. char c7 = charAt(this.bp + 8);
  966. char c8 = charAt(this.bp + 9);
  967. if (!checkDate(c1, c2, c3, c4, c5, c6, c7, c8))
  968. return false;
  969. setCalendar(c1, c2, c3, c4, c5, c6, c7, c8);
  970. int i = charAt(this.bp + 10);
  971. if ((i == 84) || ((i == 32) && (!paramBoolean)))
  972. {
  973. if (m < this.ISO8601_LEN_1)
  974. return false;
  975. }
  976. else
  977. {
  978. if ((i == 34) || (i == 26))
  979. {
  980. this.calendar.set(11, 0);
  981. this.calendar.set(12, 0);
  982. this.calendar.set(13, 0);
  983. this.calendar.set(14, 0);
  984. i = this.bp + 10;
  985. this.bp = i;
  986. this.ch = charAt(i);
  987. this.token = 5;
  988. return true;
  989. }
  990. return false;
  991. }
  992. if (charAt(this.bp + 13) != ':')
  993. return false;
  994. if (charAt(this.bp + 16) != ':')
  995. return false;
  996. c1 = charAt(this.bp + 11);
  997. c2 = charAt(this.bp + 12);
  998. c3 = charAt(this.bp + 14);
  999. c4 = charAt(this.bp + 15);
  1000. c5 = charAt(this.bp + 17);
  1001. c6 = charAt(this.bp + 18);
  1002. if (!checkTime(c1, c2, c3, c4, c5, c6))
  1003. return false;
  1004. i = digits[c1];
  1005. int j = digits[c2];
  1006. int k = digits[c3];
  1007. int n = digits[c4];
  1008. int i1 = digits[c5];
  1009. int i2 = digits[c6];
  1010. this.calendar.set(11, i * 10 + j);
  1011. this.calendar.set(12, k * 10 + n);
  1012. this.calendar.set(13, i1 * 10 + i2);
  1013. if (charAt(this.bp + 19) == '.')
  1014. {
  1015. if (m < this.ISO8601_LEN_2)
  1016. return false;
  1017. }
  1018. else
  1019. {
  1020. this.calendar.set(14, 0);
  1021. i = this.bp + 19;
  1022. this.bp = i;
  1023. this.ch = charAt(i);
  1024. this.token = 5;
  1025. return true;
  1026. }
  1027. j = charAt(this.bp + 20);
  1028. k = charAt(this.bp + 21);
  1029. i = charAt(this.bp + 22);
  1030. if ((j < 48) || (j > 57))
  1031. return false;
  1032. if ((k < 48) || (k > 57))
  1033. return false;
  1034. if ((i < 48) || (i > 57))
  1035. return false;
  1036. j = digits[j];
  1037. k = digits[k];
  1038. i = digits[i];
  1039. this.calendar.set(14, j * 100 + k * 10 + i);
  1040. i = this.bp + 23;
  1041. this.bp = i;
  1042. this.ch = charAt(i);
  1043. this.token = 5;
  1044. return true;
  1045. }
  1046. public final int scanType(String paramString)
  1047. {
  1048. int k = -1;
  1049. this.matchStat = 0;
  1050. if (!charArrayCompare(this.text, this.bp, typeFieldName))
  1051. i = -2;
  1052. int j;
  1053. label81:
  1054. do
  1055. {
  1056. return i;
  1057. int m = this.bp + typeFieldName.length;
  1058. int n = paramString.length();
  1059. j = 0;
  1060. while (true)
  1061. {
  1062. if (j >= n)
  1063. break label81;
  1064. i = k;
  1065. if (paramString.charAt(j) != charAt(m + j))
  1066. break;
  1067. j += 1;
  1068. }
  1069. j = m + n;
  1070. i = k;
  1071. }
  1072. while (charAt(j) != '"');
  1073. j += 1;
  1074. this.ch = charAt(j);
  1075. if (this.ch == ',')
  1076. {
  1077. i = j + 1;
  1078. this.ch = charAt(i);
  1079. this.bp = i;
  1080. this.token = 16;
  1081. return 3;
  1082. }
  1083. int i = j;
  1084. if (this.ch == '}')
  1085. {
  1086. j += 1;
  1087. this.ch = charAt(j);
  1088. if (this.ch != ',')
  1089. break label215;
  1090. this.token = 16;
  1091. i = j + 1;
  1092. this.ch = charAt(i);
  1093. }
  1094. while (true)
  1095. {
  1096. this.matchStat = 4;
  1097. this.bp = i;
  1098. return this.matchStat;
  1099. label215: if (this.ch == ']')
  1100. {
  1101. this.token = 15;
  1102. i = j + 1;
  1103. this.ch = charAt(i);
  1104. }
  1105. else if (this.ch == '}')
  1106. {
  1107. this.token = 13;
  1108. i = j + 1;
  1109. this.ch = charAt(i);
  1110. }
  1111. else
  1112. {
  1113. i = k;
  1114. if (this.ch != '\032')
  1115. break;
  1116. this.token = 20;
  1117. i = j;
  1118. }
  1119. }
  1120. }
  1121. public final String stringVal()
  1122. {
  1123. if (!this.hasSpecial)
  1124. return this.text.substring(this.np + 1, this.np + 1 + this.sp);
  1125. return new String(this.sbuf, 0, this.sp);
  1126. }
  1127. public final String subString(int paramInt1, int paramInt2)
  1128. {
  1129. return this.text.substring(paramInt1, paramInt1 + paramInt2);
  1130. }
  1131. }
  1132. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  1133. * Qualified Name: com.alibaba.fastjson.parser.JSONScanner
  1134. * JD-Core Version: 0.6.2
  1135. */