Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 1x 1x 1x 1x 28x 28x 28x 28x 28x 28x 28x 28x 3x 25x 28x 2x 23x 28x 1x 1x 412x 412x 412x 412x 412x 412x 6x 6x 412x 4x 4x 412x 17x 17x 412x 412x 1x 1x 450x 450x 450x 450x 450x 450x 450x 450x 450x 450x 450x 81x 81x 450x 119x 119x 369x 450x 4x 4x 369x 369x 369x 369x 369x 450x 1x 1x 110x 110x 110x 110x 110x 110x 110x 110x 110x 1x 110x 106x 109x 2x 2x 1x 1x 1x 1x 1x 2x 3x 1x 108x 110x 1x 1x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 1x 1x 107x 107x 107x 107x 107x 107x 107x 107x 107x 1x 1x 1x 1x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 107x 110x 110x 110x 110x 110x 110x 110x 110x 110x 110x 110x 110x 110x 110x 110x 110x 110x 110x 108x 110x 110x 4x 4x 4x 4x 4x 104x 110x 107x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 1x 1x 4x 3x 3x 3x 3x 4x 4x 4x 107x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 3x 3x 105x 105x 105x 108x 2743x 2743x 2743x 101x 101x 2638x 2743x 998x 998x 998x 998x 998x 998x 998x 998x 998x 897x 897x 897x 97x 97x 897x 800x 800x 800x 800x 800x 800x 800x 800x 80x 80x 800x 897x 897x 998x 998x 998x 2743x 998x 998x 998x 998x 998x 998x 998x 1640x 642x 642x 642x 642x 2743x 101x 108x 101x 108x 107x 107x 1x 1x 1x 1x 1x 1x 1x 1x 1x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 1x 1x 1x 1x 1x 1x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 1x 1x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 89x 2x 2x 87x 87x 87x 89x 89x 408x 408x 408x 408x 408x 408x 97x 97x 97x 408x 291x 75x 291x 216x 216x 291x 408x 408x 26x 408x 147x 382x 110x 235x 117x 125x 8x 8x 408x 32x 32x 32x 408x 408x 173x 173x 173x 173x 173x 26x 16x 16x 26x 173x 147x 142x 142x 147x 147x 173x 32x 32x 32x 173x 173x 408x 89x 158x 158x 158x 158x 158x 158x 158x 158x 158x 158x 158x 158x 158x 158x 158x 158x 158x 16x 158x 32x 142x 110x 110x 158x 321x 321x 158x 321x 54x 163x 109x 109x 321x 321x 158x 32x 32x 158x 89x 110x 110x 89x 110x 110x 110x 110x 110x 110x 1x 1x 1x 1x 1x 1x 110x 110x 89x 1x 1x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 41x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 29x 260x 3x 231x 134x 134x 260x 260x 260x 260x 260x 260x 183x 183x 7x 7x 4x 4x 183x 176x 176x 183x 183x 27x 27x 183x 106x 106x 106x 100x 106x 6x 6x 6x 6x 6x 6x 106x 6x 3x 3x 3x 3x 3x 6x 156x 50x 50x 177x 183x 28x 28x 12x 12x 12x 12x 28x 177x 177x 254x 260x 41x 5x 5x 5x 5x 5x 1x 4x 5x 1x 3x 5x 41x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 30x 12x 12x 12x 12x 12x 30x 18x 18x 18x 142x 65x 65x 65x 142x 142x 246x 246x 210x 210x 3x 3x 210x 246x 1x 239x 246x 65x 1x 65x 45x 45x 65x 19x 19x 246x 128x 128x 128x 174x 46x 46x 246x 5x 3x 3x 236x 246x 66x 1x 65x 246x 31x 1x 30x 170x 139x 136x 246x 19x 19x 19x 1x 19x 1x 1x 1x 1x 1x 19x 246x 142x 24x 23x 23x 12x 12x 23x 24x 1x 24x 142x 41x 139x 139x 139x 139x 139x 139x 139x 139x 139x 139x 139x 139x 139x 139x 139x 5x 138x 28x 133x 105x 104x 3x 104x 1x 101x 6x 100x 2x 94x 1x 92x 91x 91x 105x 1x 1x 105x 139x 41x 3x 3x 3x 3x 3x 3x 3x 3x 3x 1x 2x 2x 3x 41x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 1x 6x 6x 7x 41x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 2x 9x 7x 7x 7x 9x 9x 9x 9x 3x 3x 3x 9x 9x 9x 9x 2x 2x 9x 9x 8x 8x 9x 9x 41x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 41x 1x 1x 1x 1x 1x 1x 1x 1x 260x 260x 260x 260x 260x 260x 260x 260x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 260x 1x 1x 1x 1x 1x 260x 260x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 213x 260x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 418x 300x 418x 60x 118x 40x 58x 18x 6x 18x 12x 12x 18x 418x 260x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 33x 33x 33x 12x 12x 12x 12x 33x 21x 21x 33x 12x 260x 3x 3x 260x 5x 5x 5x 5x 5x 3x 3x 5x 5x 260x 2x 2x 260x 2x 2x 2x 2x 2x 1x 1x 2x 2x 260x 1x 1x 260x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 260x 260x 260x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 300x 13x 13x 300x 34x 34x 14x 34x 20x 20x 300x 1x 1x 1x 1x 266x 175x 175x 265x 3x 3x 3x 3x 90x 2x 2x 2x 2x 87x 85x 85x 85x 300x 300x 260x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 2x 2x 6x 4x 4x 4x 6x 2x 2x 2x 2x 6x 260x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 60x 10x 10x 60x 28x 28x 60x 60x 60x 60x 60x 60x 180x 180x 180x 180x 180x 180x 180x 11x 11x 180x 9x 9x 180x 93x 93x 180x 180x 60x 260x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 1x 1x 40x 4x 4x 40x 40x 40x 40x 40x 40x 40x 23x 23x 23x 23x 23x 23x 40x 260x 260x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 260x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 47x 260x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 18x 18x 18x 18x 18x 18x 18x 18x 18x 1x 1x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 64x 5x 5x 64x 162x 162x 162x 90x 26x 26x 162x 72x 26x 26x 46x 46x 72x 3x 3x 72x 162x 89x 89x 19x 19x 19x 89x 107x 107x 64x 18x 1x 1x 27x 27x 27x 27x 27x 27x 27x 27x 27x 1x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 27x 2x 2x 2x 25x 25x 25x 25x 25x 27x 27x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 101x 188x 188x 188x 175x 175x 1x 175x 187x 187x 188x 1x 188x 76x 76x 188x 101x 27x 1x 1x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 45x 45x 45x 45x 45x 45x 45x 45x 45x 45x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 44x 45x 45x 44x 45x 1x 1x 45x 44x 45x 1x 1x 1x 45x 43x 44x 44x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs"); // zcl_abapgit_ajson.clas.locals_imp.abap class lif_kind { static INTERNAL_TYPE = 'INTF'; static ATTRIBUTES = {"ANY": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "DATE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "TIME": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "PACKED": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "TABLE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "STRUCT_FLAT": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "STRUCT_DEEP": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "DATA_REF": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "OBJECT_REF": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "ENUM": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "NUMERIC": {"type": () => {return new abap.types.Structure({ "int1": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "int2": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "int4": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "int8": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "float": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "packed": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "decfloat16": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "decfloat34": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"})}, undefined, undefined, {}, {});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "TEXTS": {"type": () => {return new abap.types.Structure({ "char": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "numc": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "string": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"})}, undefined, undefined, {}, {});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "BINARY": {"type": () => {return new abap.types.Structure({ "hex": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "xstring": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"})}, undefined, undefined, {}, {});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "DEEP_TARGETS": {"type": () => {return new abap.types.Structure({ "table": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "struct_flat": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "struct_deep": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "data_ref": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "object_ref": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"})}, undefined, undefined, {}, {});}, "visibility": "U", "is_constant": "X", "is_class": "X"}}; static METHODS = {}; } abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'] = lif_kind; lif_kind.lif_kind$any = new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}); lif_kind.lif_kind$any.set(abap.Classes['CL_ABAP_TYPEDESCR'].typekind_any); lif_kind.lif_kind$date = new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}); lif_kind.lif_kind$date.set(abap.Classes['CL_ABAP_TYPEDESCR'].typekind_date); lif_kind.lif_kind$time = new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}); lif_kind.lif_kind$time.set(abap.Classes['CL_ABAP_TYPEDESCR'].typekind_time); lif_kind.lif_kind$packed = new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}); lif_kind.lif_kind$packed.set(abap.Classes['CL_ABAP_TYPEDESCR'].typekind_packed); lif_kind.lif_kind$table = new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}); lif_kind.lif_kind$table.set(abap.Classes['CL_ABAP_TYPEDESCR'].typekind_table); lif_kind.lif_kind$struct_flat = new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}); lif_kind.lif_kind$struct_flat.set(abap.Classes['CL_ABAP_TYPEDESCR'].typekind_struct1); lif_kind.lif_kind$struct_deep = new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}); lif_kind.lif_kind$struct_deep.set(abap.Classes['CL_ABAP_TYPEDESCR'].typekind_struct2); lif_kind.lif_kind$data_ref = new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}); lif_kind.lif_kind$data_ref.set(abap.Classes['CL_ABAP_TYPEDESCR'].typekind_dref); lif_kind.lif_kind$object_ref = new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}); lif_kind.lif_kind$object_ref.set(abap.Classes['CL_ABAP_TYPEDESCR'].typekind_oref); lif_kind.lif_kind$enum = new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}); lif_kind.lif_kind$enum.set('k'); lif_kind.lif_kind$numeric = new abap.types.Structure({ "int1": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "int2": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "int4": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "int8": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "float": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "packed": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "decfloat16": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "decfloat34": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"})}, undefined, undefined, {}, {}); lif_kind.lif_kind$numeric.get().int1.set('b'); lif_kind.lif_kind$numeric.get().int2.set('s'); lif_kind.lif_kind$numeric.get().int4.set('I'); lif_kind.lif_kind$numeric.get().int8.set('8'); lif_kind.lif_kind$numeric.get().float.set('F'); lif_kind.lif_kind$numeric.get().packed.set('P'); lif_kind.lif_kind$numeric.get().decfloat16.set('a'); lif_kind.lif_kind$numeric.get().decfloat34.set('e'); lif_kind.lif_kind$texts = new abap.types.Structure({ "char": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "numc": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "string": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"})}, undefined, undefined, {}, {}); lif_kind.lif_kind$texts.get().char.set('C'); lif_kind.lif_kind$texts.get().numc.set('N'); lif_kind.lif_kind$texts.get().string.set('g'); lif_kind.lif_kind$binary = new abap.types.Structure({ "hex": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "xstring": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"})}, undefined, undefined, {}, {}); lif_kind.lif_kind$binary.get().hex.set('X'); lif_kind.lif_kind$binary.get().xstring.set('y'); lif_kind.lif_kind$deep_targets = new abap.types.Structure({ "table": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "struct_flat": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "struct_deep": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "data_ref": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "object_ref": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"})}, undefined, undefined, {}, {}); lif_kind.lif_kind$deep_targets.get().table.set('h'); lif_kind.lif_kind$deep_targets.get().struct_flat.set('u'); lif_kind.lif_kind$deep_targets.get().struct_deep.set('v'); lif_kind.lif_kind$deep_targets.get().data_ref.set('l'); lif_kind.lif_kind$deep_targets.get().object_ref.set('r'); lif_kind.ty_kind = new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}); class lcl_utils { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_AJSON-LCL_UTILS'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {}; static METHODS = {"NORMALIZE_PATH": {"visibility": "U", "parameters": {"RV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "SPLIT_PATH": {"visibility": "U", "parameters": {"RV_PATH_NAME": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {});}, "is_optional": " "}, "IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "VALIDATE_ARRAY_INDEX": {"visibility": "U", "parameters": {"RV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_INDEX": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "STRING_TO_XSTRING_UTF8": {"visibility": "U", "parameters": {"RV_XSTR": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}, "IV_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "XSTRING_TO_STRING_UTF8": {"visibility": "U", "parameters": {"RV_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_XSTR": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}}}, "ANY_TO_XSTRING": {"visibility": "U", "parameters": {"RV_XSTR": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}, "IV_DATA": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}}}, "ANY_TO_STRING": {"visibility": "U", "parameters": {"RV_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_DATA": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}}}}; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { }; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async string_to_xstring_utf8(INPUT) { return lcl_utils.string_to_xstring_utf8(INPUT); } static async string_to_xstring_utf8(INPUT) { let rv_xstr = new abap.types.XString({qualifiedName: "XSTRING"}); let iv_str = INPUT?.iv_str; if (iv_str?.getQualifiedName === undefined || iv_str.getQualifiedName() !== "STRING") { iv_str = undefined; } if (iv_str === undefined) { iv_str = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_str); } let lo_conv = new abap.types.ABAPObject({qualifiedName: undefined, RTTIName: undefined}); let lv_out_ce = new abap.types.String({qualifiedName: "STRING"}); lv_out_ce.set(abap.CharacterFactory.get(19, 'CL_ABAP_CONV_OUT_CE')); try { if (abap.Classes['CL_ABAP_CONV_CODEPAGE'.trimEnd()] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()](); } } if (abap.Classes['CL_ABAP_CONV_CODEPAGE'.trimEnd()].create_out === undefined && abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_METHOD not found"; } if (abap.Classes['CL_ABAP_CONV_CODEPAGE'.trimEnd()].create_out === undefined) { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD'.trimEnd()](); } lo_conv.set(await abap.Classes['CL_ABAP_CONV_CODEPAGE'.trimEnd()].create_out()); rv_xstr.set(await abap.dynamicCallLookup(lo_conv.get(), "if_abap_conv_out$convert")({source: iv_str})); } catch (e) { if ((abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'] && e instanceof abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'])) { if (abap.Classes[lv_out_ce.get().trimEnd()] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()](); } } lo_conv.set(await abap.Classes[lv_out_ce.get().trimEnd()].create({encoding: abap.CharacterFactory.get(5, 'UTF-8')})); await abap.dynamicCallLookup(lo_conv.get(), "convert")({data: iv_str,buffer: rv_xstr}); } else { throw e; } } return rv_xstr; } async xstring_to_string_utf8(INPUT) { return lcl_utils.xstring_to_string_utf8(INPUT); } static async xstring_to_string_utf8(INPUT) { let rv_str = new abap.types.String({qualifiedName: "STRING"}); let iv_xstr = INPUT?.iv_xstr; if (iv_xstr?.getQualifiedName === undefined || iv_xstr.getQualifiedName() !== "XSTRING") { iv_xstr = undefined; } if (iv_xstr === undefined) { iv_xstr = new abap.types.XString({qualifiedName: "XSTRING"}).set(INPUT.iv_xstr); } let lo_conv = new abap.types.ABAPObject({qualifiedName: undefined, RTTIName: undefined}); let lv_in_ce = new abap.types.String({qualifiedName: "STRING"}); lv_in_ce.set(abap.CharacterFactory.get(18, 'CL_ABAP_CONV_IN_CE')); try { if (abap.Classes['CL_ABAP_CONV_CODEPAGE'.trimEnd()] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()](); } } if (abap.Classes['CL_ABAP_CONV_CODEPAGE'.trimEnd()].create_in === undefined && abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_METHOD not found"; } if (abap.Classes['CL_ABAP_CONV_CODEPAGE'.trimEnd()].create_in === undefined) { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD'.trimEnd()](); } lo_conv.set(await abap.Classes['CL_ABAP_CONV_CODEPAGE'.trimEnd()].create_in()); rv_str.set(await abap.dynamicCallLookup(lo_conv.get(), "if_abap_conv_in$convert")({source: iv_xstr})); } catch (e) { if ((abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'] && e instanceof abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'])) { if (abap.Classes[lv_in_ce.get().trimEnd()] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()](); } } lo_conv.set(await abap.Classes[lv_in_ce.get().trimEnd()].create({encoding: abap.CharacterFactory.get(5, 'UTF-8')})); await abap.dynamicCallLookup(lo_conv.get(), "convert")({data: iv_xstr,buffer: rv_str}); } else { throw e; } } return rv_str; } async validate_array_index(INPUT) { return lcl_utils.validate_array_index(INPUT); } static async validate_array_index(INPUT) { let rv_index = new abap.types.Integer({qualifiedName: "I"}); let iv_path = INPUT?.iv_path; if (iv_path?.getQualifiedName === undefined || iv_path.getQualifiedName() !== "STRING") { iv_path = undefined; } if (iv_path === undefined) { iv_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_path); } let iv_index = INPUT?.iv_index; if (iv_index?.getQualifiedName === undefined || iv_index.getQualifiedName() !== "STRING") { iv_index = undefined; } if (iv_index === undefined) { iv_index = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_index); } if (!abap.compare.co(iv_index, abap.CharacterFactory.get(10, '0123456789'))) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Cannot add non-numeric key [${abap.templateFormatting(iv_index)}] to array [${abap.templateFormatting(iv_path)}]`)}); } rv_index.set(iv_index); if (abap.compare.eq(rv_index, abap.IntegerFactory.get(0))) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Cannot add zero key to array [${abap.templateFormatting(iv_path)}]`)}); } return rv_index; } async normalize_path(INPUT) { return lcl_utils.normalize_path(INPUT); } static async normalize_path(INPUT) { let rv_path = new abap.types.String({qualifiedName: "STRING"}); let iv_path = INPUT?.iv_path; if (iv_path?.getQualifiedName === undefined || iv_path.getQualifiedName() !== "STRING") { iv_path = undefined; } if (iv_path === undefined) { iv_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_path); } rv_path.set(iv_path); if (abap.compare.eq(abap.builtin.strlen({val: rv_path}), abap.IntegerFactory.get(0))) { rv_path.set(abap.CharacterFactory.get(1, '/')); } if (abap.compare.ne(rv_path.getOffset({offset: 0, length: 1}), abap.CharacterFactory.get(1, '/'))) { rv_path.set(abap.operators.concat(abap.CharacterFactory.get(1, '/'),rv_path)); } if (abap.compare.ne(abap.builtin.substring({val: rv_path, off: abap.operators.minus(abap.builtin.strlen({val: rv_path}),abap.IntegerFactory.get(1))}), abap.CharacterFactory.get(1, '/'))) { rv_path.set(abap.operators.concat(rv_path,abap.CharacterFactory.get(1, '/'))); } return rv_path; } async split_path(INPUT) { return lcl_utils.split_path(INPUT); } static async split_path(INPUT) { let rv_path_name = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}); let iv_path = INPUT?.iv_path; if (iv_path?.getQualifiedName === undefined || iv_path.getQualifiedName() !== "STRING") { iv_path = undefined; } if (iv_path === undefined) { iv_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_path); } let lv_offs = new abap.types.Integer({qualifiedName: "I"}); let lv_len = new abap.types.Integer({qualifiedName: "I"}); let lv_trim_slash = new abap.types.Integer({qualifiedName: "I"}); lv_len.set(abap.builtin.strlen({val: iv_path})); if (abap.compare.eq(lv_len, abap.IntegerFactory.get(0)) || abap.compare.eq(iv_path, abap.CharacterFactory.get(1, '/'))) { return rv_path_name; } if (abap.compare.eq(abap.builtin.substring({val: iv_path, off: abap.operators.minus(lv_len,abap.IntegerFactory.get(1))}), abap.CharacterFactory.get(1, '/'))) { lv_trim_slash.set(abap.IntegerFactory.get(1)); } lv_offs.set(abap.builtin.find({val: abap.builtin.reverse({val: iv_path}), sub: abap.CharacterFactory.get(1, '/'), off: lv_trim_slash})); if (abap.compare.eq(lv_offs, abap.IntegerFactory.get(-1))) { lv_offs.set(lv_len); } lv_offs.set(abap.operators.minus(lv_len,lv_offs)); rv_path_name.get().path.set((await this.normalize_path({iv_path: abap.builtin.substring({val: iv_path, len: lv_offs})}))); rv_path_name.get().name.set(abap.builtin.substring({val: iv_path, off: lv_offs, len: abap.operators.minus(abap.operators.minus(lv_len,lv_offs),lv_trim_slash)})); rv_path_name.get().name.set(abap.builtin.replace({val: rv_path_name.get().name, sub: abap.Classes['CL_ABAP_CHAR_UTILITIES'].horizontal_tab, with: abap.CharacterFactory.get(1, '/'), occ: abap.IntegerFactory.get(0)})); return rv_path_name; } async any_to_xstring(INPUT) { return lcl_utils.any_to_xstring(INPUT); } static async any_to_xstring(INPUT) { let rv_xstr = new abap.types.XString({qualifiedName: "XSTRING"}); let iv_data = INPUT?.iv_data; let lo_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}); let lo_table_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TABLEDESCR", RTTIName: "\\CLASS=CL_ABAP_TABLEDESCR"}); let lv_str = new abap.types.String({qualifiedName: "STRING"}); let fs_data_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); lo_type.set((await abap.Classes['CL_ABAP_TYPEDESCR'].describe_by_data({p_data: iv_data}))); let unique252 = lo_type.get().type_kind; if (abap.compare.eq(unique252, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$binary.get().xstring)) { rv_xstr.set(iv_data); } else if (abap.compare.eq(unique252, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$texts.get().string) || abap.compare.eq(unique252, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$texts.get().char)) { rv_xstr.set((await this.string_to_xstring_utf8({iv_str: iv_data}))); } else if (abap.compare.eq(unique252, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$table)) { await abap.statements.cast(lo_table_type, lo_type); if (abap.compare.ne(lo_table_type.get().table_kind, abap.Classes['CL_ABAP_TABLEDESCR'].tablekind_std)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(56, 'Unsupported type of input table (must be standard table)')}); } try { abap.statements.assign({target: fs_data_, source: iv_data}); lv_str.set(abap.builtin.concat_lines_of({table: fs_data_, sep: abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline})); rv_xstr.set((await this.string_to_xstring_utf8({iv_str: lv_str}))); } catch (e) { if ((abap.Classes['CX_ROOT'] && e instanceof abap.Classes['CX_ROOT'])) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(53, 'Error converting input table (should be string_table)')}); } else { throw e; } } } else { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(74, 'Unsupported type of input (must be char, string, string_table, or xstring)')}); } return rv_xstr; } async any_to_string(INPUT) { return lcl_utils.any_to_string(INPUT); } static async any_to_string(INPUT) { let rv_str = new abap.types.String({qualifiedName: "STRING"}); let iv_data = INPUT?.iv_data; let lo_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}); let lo_table_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TABLEDESCR", RTTIName: "\\CLASS=CL_ABAP_TABLEDESCR"}); let fs_data_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); lo_type.set((await abap.Classes['CL_ABAP_TYPEDESCR'].describe_by_data({p_data: iv_data}))); let unique253 = lo_type.get().type_kind; if (abap.compare.eq(unique253, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$binary.get().xstring)) { rv_str.set((await this.xstring_to_string_utf8({iv_xstr: iv_data}))); } else if (abap.compare.eq(unique253, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$texts.get().string) || abap.compare.eq(unique253, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$texts.get().char)) { rv_str.set(iv_data); } else if (abap.compare.eq(unique253, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$table)) { await abap.statements.cast(lo_table_type, lo_type); if (abap.compare.ne(lo_table_type.get().table_kind, abap.Classes['CL_ABAP_TABLEDESCR'].tablekind_std)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(56, 'Unsupported type of input table (must be standard table)')}); } try { abap.statements.assign({target: fs_data_, source: iv_data}); rv_str.set(abap.builtin.concat_lines_of({table: fs_data_, sep: abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline})); } catch (e) { if ((abap.Classes['CX_ROOT'] && e instanceof abap.Classes['CX_ROOT'])) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(53, 'Error converting input table (should be string_table)')}); } else { throw e; } } } else { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(74, 'Unsupported type of input (must be char, string, string_table, or xstring)')}); } return rv_str; } } abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_UTILS'] = lcl_utils; class lcl_json_parser { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_AJSON-LCL_JSON_PARSER'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"MT_STACK": {"type": () => {return abap.types.TableFactory.construct(new abap.types.DataReference(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "lcl_json_parser=>ty_stack_tt");}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_STACK_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_KEEP_ITEM_ORDER": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"RAISE": {"visibility": "I", "parameters": {"IV_ERROR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "_PARSE": {"visibility": "I", "parameters": {"RT_JSON_TREE": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt");}, "is_optional": " "}, "IV_JSON": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}}}, "_GET_LOCATION": {"visibility": "I", "parameters": {"RV_LOCATION": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_JSON": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_OFFSET": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}}, "PARSE": {"visibility": "U", "parameters": {"RT_JSON_TREE": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt");}, "is_optional": " "}, "IV_JSON": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}, "IV_KEEP_ITEM_ORDER": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}}; #mt_stack; #mv_stack_path; #mv_keep_item_order; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "raise": this.#raise.bind(this), "_parse": this.#_parse.bind(this), "_get_location": this.#_get_location.bind(this), "parse": this.parse.bind(this), }; this.#mt_stack = abap.types.TableFactory.construct(new abap.types.DataReference(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "lcl_json_parser=>ty_stack_tt"); this.FRIENDS_ACCESS_INSTANCE["mt_stack"] = this.#mt_stack; this.#mv_stack_path = new abap.types.String({qualifiedName: "STRING"}); this.FRIENDS_ACCESS_INSTANCE["mv_stack_path"] = this.#mv_stack_path; this.#mv_keep_item_order = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_keep_item_order"] = this.#mv_keep_item_order; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async parse(INPUT) { let rt_json_tree = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt"); let iv_json = INPUT?.iv_json; let iv_keep_item_order = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_keep_item_order) {iv_keep_item_order.set(INPUT.iv_keep_item_order);} if (INPUT === undefined || INPUT.iv_keep_item_order === undefined) {iv_keep_item_order = abap.builtin.abap_false;} let lx_sxml_parse = new abap.types.ABAPObject({qualifiedName: "CX_SXML_PARSE_ERROR", RTTIName: "\\CLASS=CX_SXML_PARSE_ERROR"}); let lx_sxml = new abap.types.ABAPObject({qualifiedName: "CX_DYNAMIC_CHECK", RTTIName: "\\CLASS=CX_DYNAMIC_CHECK"}); let lv_location = new abap.types.String({qualifiedName: "STRING"}); let lv_json = new abap.types.XString({qualifiedName: "XSTRING"}); this.#mv_keep_item_order.set(iv_keep_item_order); lv_json.set((await abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_UTILS'].any_to_xstring({iv_data: iv_json}))); try { rt_json_tree.set((await this.#_parse({iv_json: lv_json}))); } catch (e) { if ((abap.Classes['CX_SXML_PARSE_ERROR'] && e instanceof abap.Classes['CX_SXML_PARSE_ERROR'])) { lx_sxml_parse.set(e); lv_location.set((await this.#_get_location({iv_json: (await abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_UTILS'].any_to_string({iv_data: iv_json})), iv_offset: lx_sxml_parse.get().xml_offset}))); await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Json parsing error (SXML): ${abap.templateFormatting((await lx_sxml_parse.get().if_message$get_text()))}`), iv_location: lv_location}); } else if ((abap.Classes['CX_DYNAMIC_CHECK'] && e instanceof abap.Classes['CX_DYNAMIC_CHECK'])) { lx_sxml.set(e); await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Json parsing error (SXML): ${abap.templateFormatting((await lx_sxml.get().if_message$get_text()))}`), iv_location: abap.CharacterFactory.get(7, '@PARSER')}); } else { throw e; } } return rt_json_tree; } async #_get_location(INPUT) { let rv_location = new abap.types.String({qualifiedName: "STRING"}); let iv_json = INPUT?.iv_json; if (iv_json?.getQualifiedName === undefined || iv_json.getQualifiedName() !== "STRING") { iv_json = undefined; } if (iv_json === undefined) { iv_json = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_json); } let iv_offset = INPUT?.iv_offset; if (iv_offset?.getQualifiedName === undefined || iv_offset.getQualifiedName() !== "I") { iv_offset = undefined; } if (iv_offset === undefined) { iv_offset = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_offset); } let lv_json = new abap.types.String({qualifiedName: "STRING"}); let lv_offset = new abap.types.Integer({qualifiedName: "I"}); let lt_text = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, ""); let lv_text = new abap.types.String({qualifiedName: "STRING"}); let lv_line = new abap.types.Integer({qualifiedName: "I"}); let lv_pos = new abap.types.Integer({qualifiedName: "I"}); lv_offset.set(iv_offset); if (abap.compare.lt(lv_offset, abap.IntegerFactory.get(0))) { lv_offset.set(abap.IntegerFactory.get(0)); } if (abap.compare.gt(lv_offset, abap.builtin.strlen({val: iv_json}))) { lv_offset.set(abap.builtin.strlen({val: iv_json})); } lv_json.set(iv_json.getOffset({length: lv_offset})); abap.statements.replace({target: lv_json, all: true, with: abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline, of: abap.Classes['CL_ABAP_CHAR_UTILITIES'].cr_lf}); abap.statements.split({source: lv_json, at: abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline, table: lt_text}); lv_line.set(abap.builtin.lines({val: lt_text})); if (abap.compare.eq(lv_line, abap.IntegerFactory.get(0))) { lv_line.set(abap.IntegerFactory.get(1)); lv_pos.set(abap.IntegerFactory.get(1)); } else { abap.statements.readTable(lt_text,{index: lv_line, into: lv_text}); lv_pos.set(abap.operators.add(abap.builtin.strlen({val: lv_text}),abap.IntegerFactory.get(1))); } rv_location.set(new abap.types.String().set(`Line ${abap.templateFormatting(lv_line)}, Offset ${abap.templateFormatting(lv_pos)}`)); return rv_location; } async #_parse(INPUT) { let rt_json_tree = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt"); let iv_json = INPUT?.iv_json; if (iv_json?.getQualifiedName === undefined || iv_json.getQualifiedName() !== "XSTRING") { iv_json = undefined; } if (iv_json === undefined) { iv_json = new abap.types.XString({qualifiedName: "XSTRING"}).set(INPUT.iv_json); } let lo_reader = new abap.types.ABAPObject({qualifiedName: "IF_SXML_READER", RTTIName: "\\INTERFACE=IF_SXML_READER"}); let lr_stack_top = new abap.types.DataReference(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})); let lo_node = new abap.types.ABAPObject({qualifiedName: "IF_SXML_NODE", RTTIName: "\\INTERFACE=IF_SXML_NODE"}); let fs_item_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})); this.#mt_stack.clear(); this.#mv_stack_path.clear(); if (abap.compare.initial(iv_json)) { return rt_json_tree; } lo_reader.set((await abap.Classes['CL_SXML_STRING_READER'].create({input: iv_json}))); const indexBackup1 = abap.builtin.sy.get().index.get(); let unique254 = 1; while (true) { abap.builtin.sy.get().index.set(unique254++); lo_node.set((await lo_reader.get().if_sxml_reader$read_next_node())); if (abap.compare.initial(lo_node)) { break; } let unique255 = lo_node.get().if_sxml_node$type; if (abap.compare.eq(unique255, abap.Classes['IF_SXML_NODE'].if_sxml_node$co_nt_element_open)) { let lt_attributes = abap.types.TableFactory.construct(new abap.types.ABAPObject({qualifiedName: "IF_SXML_ATTRIBUTE", RTTIName: "\\INTERFACE=IF_SXML_ATTRIBUTE"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "if_sxml_attribute=>attributes"); let lo_attr = new abap.types.ABAPObject({qualifiedName: "IF_SXML_ATTRIBUTE", RTTIName: "\\INTERFACE=IF_SXML_ATTRIBUTE"}); let lo_open = new abap.types.ABAPObject({qualifiedName: "IF_SXML_OPEN_ELEMENT", RTTIName: "\\INTERFACE=IF_SXML_OPEN_ELEMENT"}); await abap.statements.cast(lo_open, lo_node); fs_item_.assign(rt_json_tree.appendInitial()); fs_item_.get().type.set(lo_open.get().if_sxml_open_element$qname.get().name); abap.statements.readTable(this.#mt_stack,{index: abap.IntegerFactory.get(1), into: lr_stack_top}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { fs_item_.get().path.set(this.#mv_stack_path); lr_stack_top.get().children.set(abap.operators.add(lr_stack_top.get().children,abap.IntegerFactory.get(1))); if (abap.compare.eq(lr_stack_top.get().type, new abap.types.String().set(`array`))) { fs_item_.get().name.set(new abap.types.String().set(`${abap.templateFormatting(lr_stack_top.get().children)}`)); fs_item_.get().index.set(lr_stack_top.get().children); } else { lt_attributes.set((await lo_open.get().if_sxml_open_element$get_attributes())); for await (const unique256 of abap.statements.loop(lt_attributes)) { lo_attr.set(unique256); if (abap.compare.eq(lo_attr.get().if_sxml_attribute$qname.get().name, abap.CharacterFactory.get(4, 'name')) && abap.compare.eq(lo_attr.get().if_sxml_attribute$value_type, abap.Classes['IF_SXML_VALUE'].if_sxml_value$co_vt_text)) { fs_item_.get().name.set((await lo_attr.get().if_sxml_attribute$get_value())); } } if (abap.compare.eq(this.#mv_keep_item_order, abap.builtin.abap_true)) { fs_item_.get().order.set(lr_stack_top.get().children); } } if (abap.compare.initial(fs_item_.get().name)) { await this.#raise({iv_error: abap.CharacterFactory.get(34, 'Node without name (maybe not JSON)')}); } } lr_stack_top.assign(fs_item_.getPointer()); abap.statements.insertInternal({data: lr_stack_top, index: abap.IntegerFactory.get(1), table: this.#mt_stack}); this.#mv_stack_path.set(abap.operators.concat(this.#mv_stack_path,abap.operators.concat(abap.builtin.replace({val: fs_item_.get().name, sub: abap.CharacterFactory.get(1, '/'), with: abap.Classes['CL_ABAP_CHAR_UTILITIES'].horizontal_tab, occ: abap.IntegerFactory.get(0)}),abap.CharacterFactory.get(1, '/')))); } else if (abap.compare.eq(unique255, abap.Classes['IF_SXML_NODE'].if_sxml_node$co_nt_element_close)) { let lo_close = new abap.types.ABAPObject({qualifiedName: "IF_SXML_CLOSE_ELEMENT", RTTIName: "\\INTERFACE=IF_SXML_CLOSE_ELEMENT"}); await abap.statements.cast(lo_close, lo_node); abap.statements.readTable(this.#mt_stack,{index: abap.IntegerFactory.get(1), into: lr_stack_top}); await abap.statements.deleteInternal(this.#mt_stack,{index: abap.IntegerFactory.get(1)}); if (abap.compare.ne(lo_close.get().if_sxml_close_element$qname.get().name, lr_stack_top.get().type)) { await this.#raise({iv_error: abap.CharacterFactory.get(28, 'Unexpected closing node type')}); } this.#mv_stack_path.set(abap.builtin.substring({val: this.#mv_stack_path, len: abap.operators.add(abap.builtin.find({val: this.#mv_stack_path, sub: abap.CharacterFactory.get(1, '/'), occ: abap.IntegerFactory.get(-2)}),abap.IntegerFactory.get(1))})); } else if (abap.compare.eq(unique255, abap.Classes['IF_SXML_NODE'].if_sxml_node$co_nt_value)) { let lo_value = new abap.types.ABAPObject({qualifiedName: "IF_SXML_VALUE_NODE", RTTIName: "\\INTERFACE=IF_SXML_VALUE_NODE"}); await abap.statements.cast(lo_value, lo_node); fs_item_.get().value.set((await lo_value.get().if_sxml_value_node$get_value())); } else { await this.#raise({iv_error: abap.CharacterFactory.get(20, 'Unexpected node type')}); } } abap.builtin.sy.get().index.set(indexBackup1); if (abap.compare.gt(abap.builtin.lines({val: this.#mt_stack}), abap.IntegerFactory.get(0))) { await this.#raise({iv_error: abap.CharacterFactory.get(22, 'Unexpected end of data')}); } return rt_json_tree; } async #raise(INPUT) { let iv_error = INPUT?.iv_error; if (iv_error?.getQualifiedName === undefined || iv_error.getQualifiedName() !== "STRING") { iv_error = undefined; } if (iv_error === undefined) { iv_error = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_error); } await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_location: this.#mv_stack_path, iv_msg: new abap.types.String().set(`JSON PARSER: ${abap.templateFormatting(iv_error)} @ ${abap.templateFormatting(this.#mv_stack_path)}`)}); } } abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_JSON_PARSER'] = lcl_json_parser; lcl_json_parser.ty_stack_tt = abap.types.TableFactory.construct(new abap.types.DataReference(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "lcl_json_parser=>ty_stack_tt"); class lcl_json_serializer { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_AJSON-LCL_JSON_SERIALIZER'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"GV_COMMA_WITH_LF": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": " ", "is_class": "X"}, "MT_JSON_TREE": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts");}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_KEEP_ITEM_ORDER": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MT_BUFFER": {"type": () => {return abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE");}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_INDENT_STEP": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_LEVEL": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"ESCAPE_STRING": {"visibility": "I", "parameters": {"RV_ESCAPED": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_UNESCAPED": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "_STRINGIFY": {"visibility": "I", "parameters": {"RV_JSON_STRING": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "STRINGIFY_NODE": {"visibility": "I", "parameters": {"IS_NODE": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {});}, "is_optional": " "}}}, "STRINGIFY_SET": {"visibility": "I", "parameters": {"IV_PARENT_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_ARRAY": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "STRINGIFY": {"visibility": "U", "parameters": {"RV_JSON_STRING": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IT_JSON_TREE": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts");}, "is_optional": " "}, "IV_INDENT": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "IV_KEEP_ITEM_ORDER": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "CLASS_CONSTRUCTOR": {"visibility": "U", "parameters": {}}}; #gv_comma_with_lf; #mt_json_tree; #mv_keep_item_order; #mt_buffer; #mv_indent_step; #mv_level; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "_stringify": this.#_stringify.bind(this), "stringify_node": this.#stringify_node.bind(this), "stringify_set": this.#stringify_set.bind(this), }; this.gv_comma_with_lf = lcl_json_serializer.gv_comma_with_lf; this.#mt_json_tree = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts"); this.FRIENDS_ACCESS_INSTANCE["mt_json_tree"] = this.#mt_json_tree; this.#mv_keep_item_order = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_keep_item_order"] = this.#mv_keep_item_order; this.#mt_buffer = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE"); this.FRIENDS_ACCESS_INSTANCE["mt_buffer"] = this.#mt_buffer; this.#mv_indent_step = new abap.types.Integer({qualifiedName: "I"}); this.FRIENDS_ACCESS_INSTANCE["mv_indent_step"] = this.#mv_indent_step; this.#mv_level = new abap.types.Integer({qualifiedName: "I"}); this.FRIENDS_ACCESS_INSTANCE["mv_level"] = this.#mv_level; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async class_constructor() { return lcl_json_serializer.class_constructor(); } static async class_constructor() { lcl_json_serializer.gv_comma_with_lf.set(abap.operators.concat(abap.CharacterFactory.get(1, ','),abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline)); } async stringify(INPUT) { return lcl_json_serializer.stringify(INPUT); } static async stringify(INPUT) { let rv_json_string = new abap.types.String({qualifiedName: "STRING"}); let it_json_tree = INPUT?.it_json_tree; if (it_json_tree?.getQualifiedName === undefined || it_json_tree.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODES_TS") { it_json_tree = undefined; } if (it_json_tree === undefined) { it_json_tree = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts").set(INPUT.it_json_tree); } let iv_indent = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_indent) {iv_indent.set(INPUT.iv_indent);} if (INPUT === undefined || INPUT.iv_indent === undefined) {iv_indent = abap.IntegerFactory.get(0);} let iv_keep_item_order = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_keep_item_order) {iv_keep_item_order.set(INPUT.iv_keep_item_order);} if (INPUT === undefined || INPUT.iv_keep_item_order === undefined) {iv_keep_item_order = abap.builtin.abap_false;} let lo = new abap.types.ABAPObject({qualifiedName: "LCL_JSON_SERIALIZER", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\CLASS=LCL_JSON_SERIALIZER"}); lo.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_JSON_SERIALIZER']()).constructor_()); lo.get().FRIENDS_ACCESS_INSTANCE["mt_json_tree"].set(it_json_tree); lo.get().FRIENDS_ACCESS_INSTANCE["mv_indent_step"].set(iv_indent); lo.get().FRIENDS_ACCESS_INSTANCE["mv_keep_item_order"].set(iv_keep_item_order); rv_json_string.set((await lo.get().FRIENDS_ACCESS_INSTANCE["_stringify"]())); return rv_json_string; } async #_stringify() { let rv_json_string = new abap.types.String({qualifiedName: "STRING"}); let fs_n_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})); abap.statements.readTable(this.#mt_json_tree,{assigning: fs_n_, withKey: (i) => {return abap.compare.eq(i.path, abap.CharacterFactory.get(1, '')) && abap.compare.eq(i.name, abap.CharacterFactory.get(1, ''));}, withKeyValue: [{key: (i) => {return i.path}, value: abap.CharacterFactory.get(1, '')},{key: (i) => {return i.name}, value: abap.CharacterFactory.get(1, '')}], usesTableLine: false, withKeySimple: {"path": abap.CharacterFactory.get(1, ''),"name": abap.CharacterFactory.get(1, '')}}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { return rv_json_string; } await this.#stringify_node({is_node: fs_n_}); rv_json_string.set(abap.builtin.concat_lines_of({table: this.#mt_buffer})); return rv_json_string; } async #stringify_node(INPUT) { let is_node = INPUT?.is_node; if (is_node?.getQualifiedName === undefined || is_node.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE") { is_node = undefined; } if (is_node === undefined) { is_node = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}).set(INPUT.is_node); } let lv_item = new abap.types.String({qualifiedName: "STRING"}); let lv_indent_prefix = new abap.types.String({qualifiedName: "STRING"}); if (abap.compare.gt(this.#mv_indent_step, abap.IntegerFactory.get(0))) { lv_indent_prefix.set(abap.builtin.repeat({val: new abap.types.String().set(` `), occ: abap.operators.multiply(this.#mv_indent_step,this.#mv_level)})); lv_item.set(lv_indent_prefix); } if (abap.compare.initial(is_node.get().name) === false && abap.compare.initial(is_node.get().index)) { if (abap.compare.gt(this.#mv_indent_step, abap.IntegerFactory.get(0))) { lv_item.set(abap.operators.concat(lv_item,new abap.types.String().set(`"${abap.templateFormatting(is_node.get().name)}": `))); } else { lv_item.set(new abap.types.String().set(`"${abap.templateFormatting(is_node.get().name)}":`)); } } let unique257 = is_node.get().type; if (abap.compare.eq(unique257, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array)) { lv_item.set(abap.operators.concat(lv_item,abap.CharacterFactory.get(1, '['))); } else if (abap.compare.eq(unique257, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().object)) { lv_item.set(abap.operators.concat(lv_item,abap.CharacterFactory.get(1, '{'))); } else if (abap.compare.eq(unique257, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().string)) { lv_item.set(abap.operators.concat(lv_item,new abap.types.String().set(`"${abap.templateFormatting((await this.escape_string({iv_unescaped: is_node.get().value})))}"`))); } else if (abap.compare.eq(unique257, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().boolean) || abap.compare.eq(unique257, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().number)) { lv_item.set(abap.operators.concat(lv_item,is_node.get().value)); } else if (abap.compare.eq(unique257, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().null)) { lv_item.set(abap.operators.concat(lv_item,abap.CharacterFactory.get(4, 'null'))); } else { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unexpected type [${abap.templateFormatting(is_node.get().type)}]`), iv_location: abap.operators.concat(is_node.get().path,is_node.get().name)}); } if (abap.compare.gt(this.#mv_indent_step, abap.IntegerFactory.get(0)) && (abap.compare.eq(is_node.get().type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array) || abap.compare.eq(is_node.get().type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().object)) && abap.compare.gt(is_node.get().children, abap.IntegerFactory.get(0))) { this.#mv_level.set(abap.operators.add(this.#mv_level,abap.IntegerFactory.get(1))); lv_item.set(abap.operators.concat(lv_item,abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline)); } abap.statements.append({source: lv_item, target: this.#mt_buffer}); if (abap.compare.eq(is_node.get().type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array) || abap.compare.eq(is_node.get().type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().object)) { let lv_children_path = new abap.types.String({qualifiedName: "STRING"}); let lv_tail = new abap.types.String({qualifiedName: "STRING"}); lv_children_path.set(abap.operators.concat(is_node.get().path,abap.operators.concat(is_node.get().name,abap.CharacterFactory.get(1, '/')))); let unique258 = is_node.get().type; if (abap.compare.eq(unique258, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array)) { if (abap.compare.gt(is_node.get().children, abap.IntegerFactory.get(0))) { await this.#stringify_set({iv_parent_path: lv_children_path, iv_array: abap.builtin.abap_true}); } lv_tail.set(abap.CharacterFactory.get(1, ']')); } else if (abap.compare.eq(unique258, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().object)) { if (abap.compare.gt(is_node.get().children, abap.IntegerFactory.get(0))) { await this.#stringify_set({iv_parent_path: lv_children_path, iv_array: abap.builtin.abap_false}); } lv_tail.set(abap.CharacterFactory.get(1, '}')); } if (abap.compare.gt(this.#mv_indent_step, abap.IntegerFactory.get(0)) && abap.compare.gt(is_node.get().children, abap.IntegerFactory.get(0))) { lv_tail.set(abap.operators.concat(lv_indent_prefix,lv_tail)); this.#mv_level.set(abap.operators.minus(this.#mv_level,abap.IntegerFactory.get(1))); } abap.statements.append({source: lv_tail, target: this.#mt_buffer}); } } async #stringify_set(INPUT) { let iv_parent_path = INPUT?.iv_parent_path; if (iv_parent_path?.getQualifiedName === undefined || iv_parent_path.getQualifiedName() !== "STRING") { iv_parent_path = undefined; } if (iv_parent_path === undefined) { iv_parent_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_parent_path); } let iv_array = INPUT?.iv_array; if (iv_array?.getQualifiedName === undefined || iv_array.getQualifiedName() !== "ABAP_BOOL") { iv_array = undefined; } if (iv_array === undefined) { iv_array = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}).set(INPUT.iv_array); } let lv_tab_key = new abap.types.String({qualifiedName: "STRING"}); let lv_first_done = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let fs_n_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})); if (abap.compare.eq(iv_array, abap.builtin.abap_true)) { lv_tab_key.set(abap.CharacterFactory.get(11, 'array_index')); } else if (abap.compare.eq(this.#mv_keep_item_order, abap.builtin.abap_true)) { lv_tab_key.set(abap.CharacterFactory.get(10, 'item_order')); } else { lv_tab_key.set(abap.CharacterFactory.get(11, 'primary_key')); } for await (const unique259 of abap.statements.loop(this.#mt_json_tree,{usingKey: lv_tab_key.get(),where: async (I) => {return abap.compare.eq(I.path, iv_parent_path);},topEquals: {"path": iv_parent_path}})) { fs_n_.assign(unique259); if (abap.compare.eq(lv_first_done, abap.builtin.abap_false)) { lv_first_done.set(abap.builtin.abap_true); } else if (abap.compare.gt(this.#mv_indent_step, abap.IntegerFactory.get(0))) { abap.statements.append({source: lcl_json_serializer.gv_comma_with_lf, target: this.#mt_buffer}); } else { abap.statements.append({source: abap.CharacterFactory.get(1, ','), target: this.#mt_buffer}); } await this.#stringify_node({is_node: fs_n_}); } if (abap.compare.gt(this.#mv_indent_step, abap.IntegerFactory.get(0)) && abap.compare.eq(lv_first_done, abap.builtin.abap_true)) { abap.statements.append({source: abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline, target: this.#mt_buffer}); } } async escape_string(INPUT) { return lcl_json_serializer.escape_string(INPUT); } static async escape_string(INPUT) { let rv_escaped = new abap.types.String({qualifiedName: "STRING"}); let iv_unescaped = INPUT?.iv_unescaped; if (iv_unescaped?.getQualifiedName === undefined || iv_unescaped.getQualifiedName() !== "STRING") { iv_unescaped = undefined; } if (iv_unescaped === undefined) { iv_unescaped = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_unescaped); } rv_escaped.set(iv_unescaped); if (abap.compare.ca(rv_escaped, new abap.types.String().set(`"\\\t\n\r`))) { rv_escaped.set(abap.builtin.replace({val: rv_escaped, sub: abap.CharacterFactory.get(1, '\\'), with: abap.CharacterFactory.get(2, '\\\\'), occ: abap.IntegerFactory.get(0)})); rv_escaped.set(abap.builtin.replace({val: rv_escaped, sub: new abap.types.String().set(`\n`), with: abap.CharacterFactory.get(2, '\\n'), occ: abap.IntegerFactory.get(0)})); rv_escaped.set(abap.builtin.replace({val: rv_escaped, sub: new abap.types.String().set(`\r`), with: abap.CharacterFactory.get(2, '\\r'), occ: abap.IntegerFactory.get(0)})); rv_escaped.set(abap.builtin.replace({val: rv_escaped, sub: new abap.types.String().set(`\t`), with: abap.CharacterFactory.get(2, '\\t'), occ: abap.IntegerFactory.get(0)})); rv_escaped.set(abap.builtin.replace({val: rv_escaped, sub: abap.CharacterFactory.get(1, '"'), with: abap.CharacterFactory.get(2, '\\"'), occ: abap.IntegerFactory.get(0)})); } return rv_escaped; } } abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_JSON_SERIALIZER'] = lcl_json_serializer; lcl_json_serializer.gv_comma_with_lf = new abap.types.String({qualifiedName: "STRING"}); class lcl_json_to_abap { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_AJSON-LCL_JSON_TO_ABAP'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"MT_NODE_TYPE_CACHE": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["TYPE_PATH"]},"secondary":[]}, "");}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MR_NODES": {"type": () => {return new abap.types.DataReference(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts"));}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MI_CUSTOM_MAPPING": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MI_REFS_INITIATOR": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_REF_INIT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_REF_INIT"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_CORRESPONDING": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"ANY_TO_ABAP": {"visibility": "I", "parameters": {"IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IS_PARENT_TYPE": {"type": () => {return new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {});}, "is_optional": " "}, "I_CONTAINER_REF": {"type": () => {return new abap.types.DataReference(new abap.types.Character(4));}, "is_optional": " "}}}, "VALUE_TO_ABAP": {"visibility": "I", "parameters": {"IS_NODE": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {});}, "is_optional": " "}, "IS_NODE_TYPE": {"type": () => {return new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {});}, "is_optional": " "}, "I_CONTAINER_REF": {"type": () => {return new abap.types.DataReference(new abap.types.Character(4));}, "is_optional": " "}}}, "GET_NODE_TYPE": {"visibility": "I", "parameters": {"RS_NODE_TYPE": {"type": () => {return new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {});}, "is_optional": " "}, "IS_NODE": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {});}, "is_optional": " "}, "IS_PARENT_TYPE": {"type": () => {return new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {});}, "is_optional": " "}, "I_CONTAINER_REF": {"type": () => {return new abap.types.DataReference(new abap.types.Character(4));}, "is_optional": " "}}}, "GET_DATA_REF": {"visibility": "I", "parameters": {"RO_REF": {"type": () => {return new abap.types.DataReference(new abap.types.Character(4));}, "is_optional": " "}, "IS_NODE": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {});}, "is_optional": " "}}}, "CONSTRUCTOR": {"visibility": "U", "parameters": {"IV_CORRESPONDING": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "II_CUSTOM_MAPPING": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"});}, "is_optional": " "}, "II_REFS_INITIATOR": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_REF_INIT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_REF_INIT"});}, "is_optional": " "}}}, "TO_ABAP": {"visibility": "U", "parameters": {"IT_NODES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts");}, "is_optional": " "}, "C_CONTAINER": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}}}, "TO_TIMESTAMP": {"visibility": "U", "parameters": {"RV_RESULT": {"type": () => {return new abap.types.Packed({length: 15, decimals: 0, qualifiedName: "TIMESTAMP"});}, "is_optional": " "}, "IV_VALUE": {"type": () => {return new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"});}, "is_optional": " "}}}, "TO_TIMESTAMPL": {"visibility": "U", "parameters": {"RV_RESULT": {"type": () => {return new abap.types.Packed({length: 21, decimals: 7, qualifiedName: "TIMESTAMPL"});}, "is_optional": " "}, "IV_VALUE": {"type": () => {return new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"});}, "is_optional": " "}}}, "TO_DATE": {"visibility": "U", "parameters": {"RV_RESULT": {"type": () => {return new abap.types.Date({qualifiedName: "D"});}, "is_optional": " "}, "IV_VALUE": {"type": () => {return new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"});}, "is_optional": " "}}}, "TO_TIME": {"visibility": "U", "parameters": {"RV_RESULT": {"type": () => {return new abap.types.Time({qualifiedName: "T"});}, "is_optional": " "}, "IV_VALUE": {"type": () => {return new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"});}, "is_optional": " "}}}}; #mt_node_type_cache; #mr_nodes; #mi_custom_mapping; #mi_refs_initiator; #mv_corresponding; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "any_to_abap": this.#any_to_abap.bind(this), "value_to_abap": this.#value_to_abap.bind(this), "get_node_type": this.#get_node_type.bind(this), "get_data_ref": this.#get_data_ref.bind(this), "to_abap": this.to_abap.bind(this), "to_timestamp": this.to_timestamp.bind(this), "to_timestampl": this.to_timestampl.bind(this), "to_date": this.to_date.bind(this), "to_time": this.to_time.bind(this), }; this.#mt_node_type_cache = abap.types.TableFactory.construct(new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["TYPE_PATH"]},"secondary":[]}, ""); this.FRIENDS_ACCESS_INSTANCE["mt_node_type_cache"] = this.#mt_node_type_cache; this.#mr_nodes = new abap.types.DataReference(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts")); this.FRIENDS_ACCESS_INSTANCE["mr_nodes"] = this.#mr_nodes; this.#mi_custom_mapping = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"}); this.FRIENDS_ACCESS_INSTANCE["mi_custom_mapping"] = this.#mi_custom_mapping; this.#mi_refs_initiator = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_REF_INIT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_REF_INIT"}); this.FRIENDS_ACCESS_INSTANCE["mi_refs_initiator"] = this.#mi_refs_initiator; this.#mv_corresponding = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_corresponding"] = this.#mv_corresponding; } async constructor_(INPUT) { let iv_corresponding = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_corresponding) {iv_corresponding.set(INPUT.iv_corresponding);} if (INPUT === undefined || INPUT.iv_corresponding === undefined) {iv_corresponding = abap.builtin.abap_false;} let ii_custom_mapping = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"}); if (INPUT && INPUT.ii_custom_mapping) {ii_custom_mapping.set(INPUT.ii_custom_mapping);} let ii_refs_initiator = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_REF_INIT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_REF_INIT"}); if (INPUT && INPUT.ii_refs_initiator) {ii_refs_initiator.set(INPUT.ii_refs_initiator);} this.#mi_custom_mapping.set(ii_custom_mapping); this.#mi_refs_initiator.set(ii_refs_initiator); this.#mv_corresponding.set(iv_corresponding); return this; } async to_abap(INPUT) { let it_nodes = INPUT?.it_nodes; if (it_nodes?.getQualifiedName === undefined || it_nodes.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODES_TS") { it_nodes = undefined; } if (it_nodes === undefined) { it_nodes = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts").set(INPUT.it_nodes); } let c_container = new abap.types.Character(4); if (INPUT && INPUT.c_container) {c_container = INPUT.c_container;} let lr_ref = new abap.types.DataReference(new abap.types.Character(4)); c_container.clear(); this.#mt_node_type_cache.clear(); lr_ref.assign(c_container); this.#mr_nodes.assign(it_nodes); await this.#get_node_type({i_container_ref: lr_ref}); await this.#any_to_abap({iv_path: abap.CharacterFactory.get(1, ''), i_container_ref: lr_ref}); } async #get_node_type(INPUT) { let rs_node_type = new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {}); let is_node = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}); if (INPUT && INPUT.is_node) {is_node.set(INPUT.is_node);} let is_parent_type = new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {}); if (INPUT && INPUT.is_parent_type) {is_parent_type.set(INPUT.is_parent_type);} let i_container_ref = new abap.types.DataReference(new abap.types.Character(4)); if (INPUT && INPUT.i_container_ref) {i_container_ref.set(INPUT.i_container_ref);} let lv_node_type_path = new abap.types.String({qualifiedName: "STRING"}); let lo_sdescr = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_STRUCTDESCR", RTTIName: "\\CLASS=CL_ABAP_STRUCTDESCR"}); let lo_tdescr = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TABLEDESCR", RTTIName: "\\CLASS=CL_ABAP_TABLEDESCR"}); let lo_ddescr = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}); if (abap.compare.eq(is_parent_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$table)) { lv_node_type_path.set(abap.operators.concat(is_parent_type.get().type_path,abap.CharacterFactory.get(2, '/-'))); } else if (abap.compare.eq(is_parent_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$data_ref)) { lv_node_type_path.set(abap.operators.concat(is_parent_type.get().type_path,abap.CharacterFactory.get(2, '/+'))); } else if (abap.compare.initial(is_parent_type.get().type_kind) === false) { lv_node_type_path.set(abap.operators.concat(is_parent_type.get().type_path,abap.operators.concat(abap.CharacterFactory.get(1, '/'),is_node.get().name))); } abap.statements.readTable(this.#mt_node_type_cache,{into: rs_node_type, withKey: (i) => {return abap.compare.eq(i.type_path, lv_node_type_path);}, withKeyValue: [{key: (i) => {return i.type_path}, value: lv_node_type_path}], usesTableLine: false, withKeySimple: {"type_path": lv_node_type_path}}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { rs_node_type.get().type_path.set(lv_node_type_path); if (abap.compare.initial(this.#mi_custom_mapping) === false) { rs_node_type.get().target_field_name.set((abap.builtin.to_upper({val: (await this.#mi_custom_mapping.get().zif_abapgit_ajson_mapping$to_abap({iv_path: is_node.get().path, iv_name: is_node.get().name}))}))); if (abap.compare.initial(rs_node_type.get().target_field_name)) { rs_node_type.get().target_field_name.set(abap.builtin.to_upper({val: is_node.get().name})); } } else { rs_node_type.get().target_field_name.set(abap.builtin.to_upper({val: is_node.get().name})); } let unique260 = is_parent_type.get().type_kind; if (abap.compare.eq(unique260, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$table)) { await abap.statements.cast(lo_tdescr, is_parent_type.get().dd); rs_node_type.get().dd.set((await lo_tdescr.get().get_table_line_type())); } else if (abap.compare.eq(unique260, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$struct_flat) || abap.compare.eq(unique260, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$struct_deep)) { await abap.statements.cast(lo_sdescr, is_parent_type.get().dd); try { rs_node_type.get().dd.set(await lo_sdescr.get().get_component_type({p_name: rs_node_type.get().target_field_name})); abap.builtin.sy.get().subrc.set(0); } catch (e) { if (e.classic) { switch (e.classic.toUpperCase()) { case "COMPONENT_NOT_FOUND": abap.builtin.sy.get().subrc.set(4); break; } } else { throw e; } } if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { if (abap.compare.eq(this.#mv_corresponding, abap.builtin.abap_false)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Path not found`)}); } else { rs_node_type.clear(); return rs_node_type; } } } else if (abap.compare.eq(unique260, abap.CharacterFactory.get(1, '')) || abap.compare.eq(unique260, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$data_ref)) { await abap.statements.cast(rs_node_type.get().dd, (await abap.Classes['CL_ABAP_TYPEDESCR'].describe_by_data_ref({p_data_ref: i_container_ref}))); } else { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unexpected parent type`)}); } rs_node_type.get().type_kind.set(rs_node_type.get().dd.get().type_kind); if (abap.compare.eq(rs_node_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$table)) { await abap.statements.cast(lo_tdescr, rs_node_type.get().dd); if (abap.compare.ne(lo_tdescr.get().table_kind, abap.Classes['CL_ABAP_TABLEDESCR'].tablekind_std)) { lo_ddescr.set((await lo_tdescr.get().get_table_line_type())); if (abap.Classes['KERNEL_CREATE_DATA_HANDLE'] === undefined) throw new Error("CreateData, kernel class missing"); await abap.Classes['KERNEL_CREATE_DATA_HANDLE'].call({handle: lo_ddescr, dref: rs_node_type.get().tab_item_buf}); } } abap.statements.insertInternal({data: rs_node_type, table: this.#mt_node_type_cache}); } return rs_node_type; } async #get_data_ref(INPUT) { let ro_ref = new abap.types.DataReference(new abap.types.Character(4)); let is_node = INPUT?.is_node; if (is_node?.getQualifiedName === undefined || is_node.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE") { is_node = undefined; } if (is_node === undefined) { is_node = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}).set(INPUT.is_node); } if (abap.compare.initial(this.#mi_refs_initiator)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(21, 'Missing ref initiator')}); } ro_ref.set((await this.#mi_refs_initiator.get().zif_abapgit_ajson_ref_init$get_data_ref({is_node: is_node}))); if (abap.compare.initial(ro_ref)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(27, 'Cannot use initial data ref')}); } return ro_ref; } async #any_to_abap(INPUT) { let iv_path = INPUT?.iv_path; if (iv_path?.getQualifiedName === undefined || iv_path.getQualifiedName() !== "STRING") { iv_path = undefined; } if (iv_path === undefined) { iv_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_path); } let is_parent_type = new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {}); if (INPUT && INPUT.is_parent_type) {is_parent_type.set(INPUT.is_parent_type);} let i_container_ref = INPUT?.i_container_ref; if (i_container_ref === undefined) { i_container_ref = new abap.types.DataReference(new abap.types.Character(4)).set(INPUT.i_container_ref); } let ls_node_type = new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {}); let lx_ajson = new abap.types.ABAPObject({qualifiedName: "ZCX_ABAPGIT_AJSON_ERROR", RTTIName: "\\CLASS=ZCX_ABAPGIT_AJSON_ERROR"}); let lx_root = new abap.types.ABAPObject({qualifiedName: "CX_ROOT", RTTIName: "\\CLASS=CX_ROOT"}); let lr_target_field = new abap.types.DataReference(new abap.types.Character(4)); let fs_n_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})); let fs_parent_stdtab_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); let fs_parent_anytab_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); let fs_parent_struc_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_tab_item_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_field_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let unique261 = is_parent_type.get().type_kind; if (abap.compare.eq(unique261, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$table)) { if (abap.compare.initial(is_parent_type.get().tab_item_buf) === false) { abap.statements.assign({target: fs_parent_anytab_, source: i_container_ref.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); lr_target_field.set(is_parent_type.get().tab_item_buf); abap.statements.assign({target: fs_tab_item_, source: is_parent_type.get().tab_item_buf.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); } else { abap.statements.assign({target: fs_parent_stdtab_, source: i_container_ref.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); } } else if (abap.compare.eq(unique261, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$struct_flat) || abap.compare.eq(unique261, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$struct_deep)) { abap.statements.assign({target: fs_parent_struc_, source: i_container_ref.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); } try { for await (const unique262 of abap.statements.loop(this.#mr_nodes.dereference(),{usingKey: "array_index",where: async (I) => {return abap.compare.eq(I.path, iv_path);},topEquals: {"path": iv_path}})) { fs_n_.assign(unique262); if (abap.compare.ne(is_parent_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$table) || abap.compare.initial(ls_node_type.get().type_kind)) { ls_node_type.set((await this.#get_node_type({is_node: fs_n_, is_parent_type: is_parent_type}))); if (abap.compare.eq(this.#mv_corresponding, abap.builtin.abap_true) && abap.compare.initial(ls_node_type)) { continue; } } if (abap.compare.eq(ls_node_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$object_ref)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(20, 'Cannot assign to ref')}); } let unique263 = is_parent_type.get().type_kind; if (abap.compare.eq(unique263, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$table)) { if (!abap.compare.co(ls_node_type.get().target_field_name, abap.CharacterFactory.get(10, '0123456789'))) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(27, 'Need index to access tables')}); } if (abap.compare.initial(is_parent_type.get().tab_item_buf)) { lr_target_field.assign(fs_parent_stdtab_.appendInitial()); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); } else { fs_tab_item_.clear(); } } else if (abap.compare.eq(unique263, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$struct_flat) || abap.compare.eq(unique263, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$struct_deep)) { abap.statements.assign({component: ls_node_type.get().target_field_name, target: fs_field_, source: fs_parent_struc_}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); lr_target_field.assign(fs_field_.getPointer()); } else if (abap.compare.eq(unique263, abap.CharacterFactory.get(1, ''))) { lr_target_field.set(i_container_ref); } else { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(22, 'Unexpected parent type')}); } if (abap.compare.eq(ls_node_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$data_ref)) { lr_target_field.set((await this.#get_data_ref({is_node: fs_n_}))); ls_node_type.set((await this.#get_node_type({i_container_ref: lr_target_field, is_node: fs_n_, is_parent_type: ls_node_type}))); } let unique264 = fs_n_.get().type; if (abap.compare.eq(unique264, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().object)) { if (abap.compare.ne(ls_node_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$struct_flat) && abap.compare.ne(ls_node_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$struct_deep)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(18, 'Expected structure')}); } await this.#any_to_abap({iv_path: abap.operators.concat(fs_n_.get().path,abap.operators.concat(fs_n_.get().name,abap.CharacterFactory.get(1, '/'))), is_parent_type: ls_node_type, i_container_ref: lr_target_field}); } else if (abap.compare.eq(unique264, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array)) { if (!abap.compare.eq(ls_node_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$table)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(14, 'Expected table')}); } await this.#any_to_abap({iv_path: abap.operators.concat(fs_n_.get().path,abap.operators.concat(fs_n_.get().name,abap.CharacterFactory.get(1, '/'))), is_parent_type: ls_node_type, i_container_ref: lr_target_field}); } else { await this.#value_to_abap({is_node: fs_n_, is_node_type: ls_node_type, i_container_ref: lr_target_field}); } if (abap.compare.initial(is_parent_type.get().tab_item_buf) === false) { try { abap.statements.insertInternal({data: fs_tab_item_, table: fs_parent_anytab_}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(19, 'Duplicate insertion')}); } } catch (e) { if ((abap.Classes['CX_SY_ITAB_DUPLICATE_KEY'] && e instanceof abap.Classes['CX_SY_ITAB_DUPLICATE_KEY'])) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(19, 'Duplicate insertion')}); } else { throw e; } } } } } catch (e) { if ((abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'] && e instanceof abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'])) { lx_ajson.set(e); if (abap.compare.initial(lx_ajson.get().location)) { await lx_ajson.get().set_location({iv_location: abap.operators.concat(fs_n_.get().path,fs_n_.get().name)}); } throw lx_ajson.get(); } else if ((abap.Classes['CX_SY_CONVERSION_NO_NUMBER'] && e instanceof abap.Classes['CX_SY_CONVERSION_NO_NUMBER'])) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(22, 'Source is not a number'), iv_location: abap.operators.concat(fs_n_.get().path,fs_n_.get().name)}); } else if ((abap.Classes['CX_ROOT'] && e instanceof abap.Classes['CX_ROOT'])) { lx_root.set(e); await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: (await lx_root.get().if_message$get_text()), iv_location: abap.operators.concat(fs_n_.get().path,fs_n_.get().name)}); } else { throw e; } } } async #value_to_abap(INPUT) { let is_node = INPUT?.is_node; if (is_node?.getQualifiedName === undefined || is_node.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE") { is_node = undefined; } if (is_node === undefined) { is_node = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}).set(INPUT.is_node); } let is_node_type = INPUT?.is_node_type; if (is_node_type?.getQualifiedName === undefined || is_node_type.getQualifiedName() !== "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE") { is_node_type = undefined; } if (is_node_type === undefined) { is_node_type = new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {}).set(INPUT.is_node_type); } let i_container_ref = INPUT?.i_container_ref; if (i_container_ref === undefined) { i_container_ref = new abap.types.DataReference(new abap.types.Character(4)).set(INPUT.i_container_ref); } let fs_container_ = new abap.types.FieldSymbol(new abap.types.Character(4)); if (abap.compare.ca(is_node_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$deep_targets)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unsupported target for value [${abap.templateFormatting(is_node_type.get().type_kind)}]`)}); } abap.statements.assign({target: fs_container_, source: i_container_ref.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); let unique265 = is_node.get().type; if (abap.compare.eq(unique265, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().null)) { } else if (abap.compare.eq(unique265, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().boolean)) { fs_container_.set(abap.builtin.boolc(abap.compare.eq(is_node.get().value, abap.CharacterFactory.get(4, 'true')))); } else if (abap.compare.eq(unique265, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().number)) { fs_container_.set(is_node.get().value); } else if (abap.compare.eq(unique265, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().string)) { if (abap.compare.initial(is_node.get().value) === false) { if (abap.compare.eq(is_node_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$date)) { fs_container_.set((await this.to_date({iv_value: is_node.get().value}))); } else if (abap.compare.eq(is_node_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$time)) { fs_container_.set((await this.to_time({iv_value: is_node.get().value}))); } else if (abap.compare.eq(is_node_type.get().dd.get().absolute_name, abap.CharacterFactory.get(15, '\\TYPE=TIMESTAMP'))) { fs_container_.set((await this.to_timestamp({iv_value: is_node.get().value}))); } else if (abap.compare.eq(is_node_type.get().dd.get().absolute_name, abap.CharacterFactory.get(16, '\\TYPE=TIMESTAMPL'))) { fs_container_.set((await this.to_timestampl({iv_value: is_node.get().value}))); } else if (abap.compare.eq(is_node_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$packed)) { fs_container_.set(is_node.get().value); } else { fs_container_.set(is_node.get().value); } } else { fs_container_.set(is_node.get().value); } } else { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unexpected JSON type [${abap.templateFormatting(is_node.get().type)}]`)}); } } async to_date(INPUT) { let rv_result = new abap.types.Date({qualifiedName: "D"}); let iv_value = INPUT?.iv_value; if (iv_value?.getQualifiedName === undefined || iv_value.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE") { iv_value = undefined; } if (iv_value === undefined) { iv_value = new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}).set(INPUT.iv_value); } let lv_y = new abap.types.Character(4, {}); let lv_m = new abap.types.Character(2, {}); let lv_d = new abap.types.Character(2, {}); abap.statements.find(iv_value, {regex: abap.CharacterFactory.get(29, '^(\\d{4})-(\\d{2})-(\\d{2})(T|$)'), first: true, submatches: [lv_y,lv_m,lv_d]}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(22, 'Unexpected date format')}); } abap.statements.concatenate({source: [lv_y, lv_m, lv_d], target: rv_result}); return rv_result; } async to_timestamp(INPUT) { let rv_result = new abap.types.Packed({length: 15, decimals: 0, qualifiedName: "TIMESTAMP"}); let iv_value = INPUT?.iv_value; if (iv_value?.getQualifiedName === undefined || iv_value.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE") { iv_value = undefined; } if (iv_value === undefined) { iv_value = new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}).set(INPUT.iv_value); } let lv_timestampl = new abap.types.Packed({length: 21, decimals: 7, qualifiedName: "TIMESTAMPL"}); let lv_int_part = new abap.types.String({qualifiedName: "STRING"}); let lv_frac_part = new abap.types.String({qualifiedName: "STRING"}); lv_timestampl.set((await this.to_timestampl({iv_value: iv_value}))); abap.statements.split({source: new abap.types.String().set(`${abap.templateFormatting(lv_timestampl)}`), at: abap.CharacterFactory.get(1, '.'), targets: [lv_int_part,lv_frac_part]}); if (abap.compare.ca(lv_frac_part, abap.CharacterFactory.get(9, '123456789'))) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(27, 'Unexpected timestamp format')}); } rv_result.set(lv_int_part); return rv_result; } async to_timestampl(INPUT) { let rv_result = new abap.types.Packed({length: 21, decimals: 7, qualifiedName: "TIMESTAMPL"}); let iv_value = INPUT?.iv_value; if (iv_value?.getQualifiedName === undefined || iv_value.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE") { iv_value = undefined; } if (iv_value === undefined) { iv_value = new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}).set(INPUT.iv_value); } let lc_utc = new abap.types.Character(6, {}); lc_utc.set('UTC'); let lc_regex_ts_with_hour = new abap.types.String({qualifiedName: "STRING"}); lc_regex_ts_with_hour.set(`^(\\d{4})-(\\d{2})-(\\d{2})(T)(\\d{2}):(\\d{2}):(\\d{2})(\\+)(\\d{2}):(\\d{2})`); let lc_regex_ts_utc = new abap.types.String({qualifiedName: "STRING"}); lc_regex_ts_utc.set(`^(\\d{4})-(\\d{2})-(\\d{2})(T)(\\d{2}):(\\d{2}):(\\d{2})(\\.\\d+)?(Z|$)`); let ls_timestamp = new abap.types.Structure({ "year": new abap.types.Character(4, {}), "month": new abap.types.Character(2, {}), "day": new abap.types.Character(2, {}), "t": new abap.types.Character(1, {}), "hour": new abap.types.Character(2, {}), "minute": new abap.types.Character(2, {}), "second": new abap.types.Character(2, {}), "frac": new abap.types.Character(8, {}), "local_sign": new abap.types.Character(1, {}), "local_hour": new abap.types.Character(2, {}), "local_minute": new abap.types.Character(2, {})}, undefined, undefined, {}, {}); let lv_date = new abap.types.Date({qualifiedName: "D"}); let lv_time = new abap.types.Time({qualifiedName: "T"}); let lv_seconds_conv = new abap.types.Integer({qualifiedName: "I"}); let lv_timestamp = new abap.types.Packed({length: 21, decimals: 7, qualifiedName: "TIMESTAMPL"}); abap.statements.find(iv_value, {regex: lc_regex_ts_with_hour, first: true, submatches: [ls_timestamp.get().year,ls_timestamp.get().month,ls_timestamp.get().day,ls_timestamp.get().t,ls_timestamp.get().hour,ls_timestamp.get().minute,ls_timestamp.get().second,ls_timestamp.get().local_sign,ls_timestamp.get().local_hour,ls_timestamp.get().local_minute]}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { lv_seconds_conv.set(abap.operators.add(abap.operators.multiply(ls_timestamp.get().local_hour,new abap.types.Integer().set(3600)),abap.operators.multiply(ls_timestamp.get().local_minute,abap.IntegerFactory.get(60)))); } else { abap.statements.find(iv_value, {regex: lc_regex_ts_utc, first: true, submatches: [ls_timestamp.get().year,ls_timestamp.get().month,ls_timestamp.get().day,ls_timestamp.get().t,ls_timestamp.get().hour,ls_timestamp.get().minute,ls_timestamp.get().second,ls_timestamp.get().frac]}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(27, 'Unexpected timestamp format')}); } } abap.statements.concatenate({source: [ls_timestamp.get().year, ls_timestamp.get().month, ls_timestamp.get().day], target: lv_date}); abap.statements.concatenate({source: [ls_timestamp.get().hour, ls_timestamp.get().minute, ls_timestamp.get().second], target: lv_time}); abap.statements.convert({date: lv_date,time: lv_time,zone: lc_utc}, {stamp: lv_timestamp}); if (abap.compare.initial(ls_timestamp.get().frac) === false) { ls_timestamp.get().frac.set(abap.operators.concat(abap.CharacterFactory.get(1, '0'),ls_timestamp.get().frac)); lv_timestamp.set(abap.operators.add(lv_timestamp,ls_timestamp.get().frac)); } try { let unique266 = ls_timestamp.get().local_sign; if (abap.compare.eq(unique266, abap.CharacterFactory.get(1, '-'))) { lv_timestamp.set((await abap.Classes['CL_ABAP_TSTMP'].add({tstmp: lv_timestamp, secs: lv_seconds_conv}))); } else if (abap.compare.eq(unique266, abap.CharacterFactory.get(1, '+'))) { lv_timestamp.set((await abap.Classes['CL_ABAP_TSTMP'].subtractsecs({tstmp: lv_timestamp, secs: lv_seconds_conv}))); } } catch (e) { if ((abap.Classes['CX_PARAMETER_INVALID_RANGE'] && e instanceof abap.Classes['CX_PARAMETER_INVALID_RANGE']) || (abap.Classes['CX_PARAMETER_INVALID_TYPE'] && e instanceof abap.Classes['CX_PARAMETER_INVALID_TYPE'])) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(38, 'Unexpected error calculating timestamp')}); } else { throw e; } } if (abap.compare.initial(lv_timestamp) === false) { await abap.Classes['CL_ABAP_TSTMP'].move({tstmp_src: lv_timestamp, tstmp_tgt: rv_result}); } return rv_result; } async to_time(INPUT) { let rv_result = new abap.types.Time({qualifiedName: "T"}); let iv_value = INPUT?.iv_value; if (iv_value?.getQualifiedName === undefined || iv_value.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE") { iv_value = undefined; } if (iv_value === undefined) { iv_value = new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}).set(INPUT.iv_value); } let lv_h = new abap.types.Character(2, {}); let lv_m = new abap.types.Character(2, {}); let lv_s = new abap.types.Character(2, {}); abap.statements.find(iv_value, {regex: abap.CharacterFactory.get(29, '^(\\d{2}):(\\d{2}):(\\d{2})(T|$)'), first: true, submatches: [lv_h,lv_m,lv_s]}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(22, 'Unexpected time format')}); } abap.statements.concatenate({source: [lv_h, lv_m, lv_s], target: rv_result}); return rv_result; } } abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_JSON_TO_ABAP'] = lcl_json_to_abap; lcl_json_to_abap.ty_type_cache = new abap.types.Structure({ "type_path": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TYPE_PATH"}), "target_field_name": new abap.types.String({qualifiedName: "LCL_JSON_TO_ABAP=>TY_TYPE_CACHE-TARGET_FIELD_NAME"}), "dd": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "type_kind": new abap.types.Character(1, {"qualifiedName":"lif_kind=>ty_kind"}), "tab_item_buf": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_json_to_abap=>ty_type_cache", undefined, {}, {}); class lcl_abap_to_json { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_AJSON-LCL_ABAP_TO_JSON'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"GV_AJSON_ABSOLUTE_TYPE_NAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": " ", "is_class": "X"}, "MI_CUSTOM_MAPPING": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_KEEP_ITEM_ORDER": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_FORMAT_DATETIME": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"CONVERT_ANY": {"visibility": "I", "parameters": {"IV_DATA": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}, "IO_TYPE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"});}, "is_optional": " "}, "IS_PREFIX": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {});}, "is_optional": " "}, "IV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "IV_ITEM_ORDER": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "CT_NODES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt");}, "is_optional": " "}}}, "CONVERT_AJSON": {"visibility": "I", "parameters": {"IO_JSON": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON"});}, "is_optional": " "}, "IS_PREFIX": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {});}, "is_optional": " "}, "IV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "IV_ITEM_ORDER": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "CT_NODES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt");}, "is_optional": " "}}}, "CONVERT_VALUE": {"visibility": "I", "parameters": {"IV_DATA": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}, "IO_TYPE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"});}, "is_optional": " "}, "IS_PREFIX": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {});}, "is_optional": " "}, "IV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "IV_ITEM_ORDER": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "CT_NODES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt");}, "is_optional": " "}}}, "CONVERT_REF": {"visibility": "I", "parameters": {"IV_DATA": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}, "IS_PREFIX": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {});}, "is_optional": " "}, "IV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "IV_ITEM_ORDER": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "CT_NODES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt");}, "is_optional": " "}}}, "CONVERT_STRUC": {"visibility": "I", "parameters": {"IV_DATA": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}, "IO_TYPE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"});}, "is_optional": " "}, "IS_PREFIX": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {});}, "is_optional": " "}, "IV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "IV_ITEM_ORDER": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "CT_NODES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt");}, "is_optional": " "}}}, "CONVERT_TABLE": {"visibility": "I", "parameters": {"IV_DATA": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}, "IO_TYPE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"});}, "is_optional": " "}, "IS_PREFIX": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {});}, "is_optional": " "}, "IV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "IV_ITEM_ORDER": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "CT_NODES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt");}, "is_optional": " "}}}, "INSERT_VALUE_WITH_TYPE": {"visibility": "I", "parameters": {"IV_DATA": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}, "IV_TYPE": {"type": () => {return new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"});}, "is_optional": " "}, "IO_TYPE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"});}, "is_optional": " "}, "IS_PREFIX": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {});}, "is_optional": " "}, "IV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "IV_ITEM_ORDER": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "CT_NODES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt");}, "is_optional": " "}}}, "CONVERT": {"visibility": "U", "parameters": {"RT_NODES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt");}, "is_optional": " "}, "IV_DATA": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}, "IS_PREFIX": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {});}, "is_optional": " "}, "IV_ARRAY_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "II_CUSTOM_MAPPING": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"});}, "is_optional": " "}, "IS_OPTS": {"type": () => {return new abap.types.Structure({ "read_only": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "keep_item_order": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "format_datetime": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "to_abap_corresponding_only": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_ajson=>ty_opts", undefined, {}, {});}, "is_optional": " "}, "IV_ITEM_ORDER": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}}, "INSERT_WITH_TYPE": {"visibility": "U", "parameters": {"RT_NODES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt");}, "is_optional": " "}, "IV_DATA": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}, "IV_TYPE": {"type": () => {return new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"});}, "is_optional": " "}, "IS_PREFIX": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {});}, "is_optional": " "}, "IV_ARRAY_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "II_CUSTOM_MAPPING": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"});}, "is_optional": " "}, "IS_OPTS": {"type": () => {return new abap.types.Structure({ "read_only": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "keep_item_order": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "format_datetime": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "to_abap_corresponding_only": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_ajson=>ty_opts", undefined, {}, {});}, "is_optional": " "}, "IV_ITEM_ORDER": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}}, "FORMAT_DATE": {"visibility": "U", "parameters": {"RV_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_DATE": {"type": () => {return new abap.types.Date({qualifiedName: "D"});}, "is_optional": " "}}}, "FORMAT_TIME": {"visibility": "U", "parameters": {"RV_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_TIME": {"type": () => {return new abap.types.Time({qualifiedName: "T"});}, "is_optional": " "}}}, "FORMAT_TIMESTAMP": {"visibility": "U", "parameters": {"RV_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_TS": {"type": () => {return new abap.types.Packed({length: 15, decimals: 0, qualifiedName: "TIMESTAMP"});}, "is_optional": " "}}}, "FORMAT_TIMESTAMPL": {"visibility": "U", "parameters": {"RV_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_TS": {"type": () => {return new abap.types.Packed({length: 21, decimals: 7, qualifiedName: "TIMESTAMPL"});}, "is_optional": " "}}}, "CLASS_CONSTRUCTOR": {"visibility": "U", "parameters": {}}}; #gv_ajson_absolute_type_name; #mi_custom_mapping; #mv_keep_item_order; #mv_format_datetime; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "convert_any": this.#convert_any.bind(this), "convert_ajson": this.#convert_ajson.bind(this), "convert_value": this.#convert_value.bind(this), "convert_ref": this.#convert_ref.bind(this), "convert_struc": this.#convert_struc.bind(this), "convert_table": this.#convert_table.bind(this), "insert_value_with_type": this.#insert_value_with_type.bind(this), }; this.gv_ajson_absolute_type_name = lcl_abap_to_json.gv_ajson_absolute_type_name; this.#mi_custom_mapping = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"}); this.FRIENDS_ACCESS_INSTANCE["mi_custom_mapping"] = this.#mi_custom_mapping; this.#mv_keep_item_order = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_keep_item_order"] = this.#mv_keep_item_order; this.#mv_format_datetime = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_format_datetime"] = this.#mv_format_datetime; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async class_constructor() { return lcl_abap_to_json.class_constructor(); } static async class_constructor() { let lo_dummy = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_AJSON", RTTIName: "\\CLASS=ZCL_ABAPGIT_AJSON"}); let lo_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_REFDESCR", RTTIName: "\\CLASS=CL_ABAP_REFDESCR"}); await abap.statements.cast(lo_type, (await abap.Classes['CL_ABAP_TYPEDESCR'].describe_by_data({p_data: lo_dummy}))); lcl_abap_to_json.gv_ajson_absolute_type_name.set(((await lo_type.get().get_referenced_type())).get().absolute_name); } async convert(INPUT) { return lcl_abap_to_json.convert(INPUT); } static async convert(INPUT) { let rt_nodes = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt"); let iv_data = INPUT?.iv_data; let is_prefix = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}); if (INPUT && INPUT.is_prefix) {is_prefix.set(INPUT.is_prefix);} let iv_array_index = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_array_index) {iv_array_index.set(INPUT.iv_array_index);} if (INPUT === undefined || INPUT.iv_array_index === undefined) {iv_array_index = abap.IntegerFactory.get(0);} let ii_custom_mapping = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"}); if (INPUT && INPUT.ii_custom_mapping) {ii_custom_mapping.set(INPUT.ii_custom_mapping);} let is_opts = new abap.types.Structure({ "read_only": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "keep_item_order": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "format_datetime": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "to_abap_corresponding_only": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_ajson=>ty_opts", undefined, {}, {}); if (INPUT && INPUT.is_opts) {is_opts.set(INPUT.is_opts);} let iv_item_order = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_item_order) {iv_item_order.set(INPUT.iv_item_order);} if (INPUT === undefined || INPUT.iv_item_order === undefined) {iv_item_order = abap.IntegerFactory.get(0);} let lo_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}); let lo_converter = new abap.types.ABAPObject({qualifiedName: "LCL_ABAP_TO_JSON", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\CLASS=LCL_ABAP_TO_JSON"}); lo_type.set((await abap.Classes['CL_ABAP_TYPEDESCR'].describe_by_data({p_data: iv_data}))); lo_converter.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_ABAP_TO_JSON']()).constructor_()); lo_converter.get().FRIENDS_ACCESS_INSTANCE["mi_custom_mapping"].set(ii_custom_mapping); lo_converter.get().FRIENDS_ACCESS_INSTANCE["mv_keep_item_order"].set(is_opts.get().keep_item_order); lo_converter.get().FRIENDS_ACCESS_INSTANCE["mv_format_datetime"].set(is_opts.get().format_datetime); await lo_converter.get().FRIENDS_ACCESS_INSTANCE["convert_any"]({iv_data: iv_data, io_type: lo_type, is_prefix: is_prefix, iv_index: iv_array_index, iv_item_order: iv_item_order, ct_nodes: rt_nodes}); return rt_nodes; } async #convert_any(INPUT) { let iv_data = INPUT?.iv_data; let io_type = INPUT?.io_type; if (io_type?.getQualifiedName === undefined || io_type.getQualifiedName() !== "CL_ABAP_TYPEDESCR") { io_type = undefined; } if (io_type === undefined) { io_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}).set(INPUT.io_type); } let is_prefix = INPUT?.is_prefix; if (is_prefix?.getQualifiedName === undefined || is_prefix.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME") { is_prefix = undefined; } if (is_prefix === undefined) { is_prefix = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}).set(INPUT.is_prefix); } let iv_index = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_index) {iv_index.set(INPUT.iv_index);} if (INPUT === undefined || INPUT.iv_index === undefined) {iv_index = abap.IntegerFactory.get(0);} let iv_item_order = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_item_order) {iv_item_order.set(INPUT.iv_item_order);} if (INPUT === undefined || INPUT.iv_item_order === undefined) {iv_item_order = abap.IntegerFactory.get(0);} let ct_nodes = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt"); if (INPUT && INPUT.ct_nodes) {ct_nodes = INPUT.ct_nodes;} let unique267 = io_type.get().kind; if (abap.compare.eq(unique267, abap.Classes['CL_ABAP_TYPEDESCR'].kind_elem)) { await this.#convert_value({iv_data: iv_data, io_type: io_type, is_prefix: is_prefix, iv_index: iv_index, iv_item_order: iv_item_order, ct_nodes: ct_nodes}); } else if (abap.compare.eq(unique267, abap.Classes['CL_ABAP_TYPEDESCR'].kind_struct)) { await this.#convert_struc({iv_data: iv_data, io_type: io_type, is_prefix: is_prefix, iv_index: iv_index, iv_item_order: iv_item_order, ct_nodes: ct_nodes}); } else if (abap.compare.eq(unique267, abap.Classes['CL_ABAP_TYPEDESCR'].kind_table)) { await this.#convert_table({iv_data: iv_data, io_type: io_type, is_prefix: is_prefix, iv_index: iv_index, iv_item_order: iv_item_order, ct_nodes: ct_nodes}); } else { if (abap.compare.eq(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$data_ref) || abap.compare.initial(iv_data)) { await this.#convert_ref({iv_data: iv_data, is_prefix: is_prefix, iv_index: iv_index, iv_item_order: iv_item_order, ct_nodes: ct_nodes}); } else if (abap.compare.eq(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$object_ref) && abap.compare.eq(((await abap.Classes['CL_ABAP_TYPEDESCR'].describe_by_object_ref({p_object_ref: iv_data}))).get().absolute_name, lcl_abap_to_json.gv_ajson_absolute_type_name)) { await this.#convert_ajson({io_json: iv_data, is_prefix: is_prefix, iv_index: iv_index, iv_item_order: iv_item_order, ct_nodes: ct_nodes}); } else { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unsupported type [${abap.templateFormatting(io_type.get().type_kind)}] @${abap.templateFormatting(abap.operators.concat(is_prefix.get().path,is_prefix.get().name))}`)}); } } } async #convert_ajson(INPUT) { let io_json = INPUT?.io_json; if (io_json?.getQualifiedName === undefined || io_json.getQualifiedName() !== "ZIF_ABAPGIT_AJSON") { io_json = undefined; } if (io_json === undefined) { io_json = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON"}).set(INPUT.io_json); } let is_prefix = INPUT?.is_prefix; if (is_prefix?.getQualifiedName === undefined || is_prefix.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME") { is_prefix = undefined; } if (is_prefix === undefined) { is_prefix = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}).set(INPUT.is_prefix); } let iv_index = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_index) {iv_index.set(INPUT.iv_index);} if (INPUT === undefined || INPUT.iv_index === undefined) {iv_index = abap.IntegerFactory.get(0);} let iv_item_order = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_item_order) {iv_item_order.set(INPUT.iv_item_order);} if (INPUT === undefined || INPUT.iv_item_order === undefined) {iv_item_order = abap.IntegerFactory.get(0);} let ct_nodes = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt"); if (INPUT && INPUT.ct_nodes) {ct_nodes = INPUT.ct_nodes;} let fs_src_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})); let fs_dst_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})); if (abap.compare.initial(io_json)) { return; } for await (const unique268 of abap.statements.loop(io_json.get().zif_abapgit_ajson$mt_json_tree)) { fs_src_.assign(unique268); abap.statements.append({source: fs_src_, assigning: fs_dst_, target: ct_nodes}); if (abap.compare.initial(fs_dst_.get().path) && abap.compare.initial(fs_dst_.get().name)) { fs_dst_.get().path.set(is_prefix.get().path); fs_dst_.get().name.set(is_prefix.get().name); fs_dst_.get().index.set(iv_index); fs_dst_.get().order.set(iv_item_order); } else { fs_dst_.get().path.set(abap.operators.concat(is_prefix.get().path,abap.operators.concat(is_prefix.get().name,fs_dst_.get().path))); } } } async format_date(INPUT) { return lcl_abap_to_json.format_date(INPUT); } static async format_date(INPUT) { let rv_str = new abap.types.String({qualifiedName: "STRING"}); let iv_date = INPUT?.iv_date; if (iv_date?.getQualifiedName === undefined || iv_date.getQualifiedName() !== "D") { iv_date = undefined; } if (iv_date === undefined) { iv_date = new abap.types.Date({qualifiedName: "D"}).set(INPUT.iv_date); } if (abap.compare.initial(iv_date) === false) { rv_str.set(abap.operators.concat(iv_date.getOffset({offset: 0, length: 4}),abap.operators.concat(abap.CharacterFactory.get(1, '-'),abap.operators.concat(iv_date.getOffset({offset: 4, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, '-'),iv_date.getOffset({offset: 6, length: 2})))))); } return rv_str; } async format_time(INPUT) { return lcl_abap_to_json.format_time(INPUT); } static async format_time(INPUT) { let rv_str = new abap.types.String({qualifiedName: "STRING"}); let iv_time = INPUT?.iv_time; if (iv_time?.getQualifiedName === undefined || iv_time.getQualifiedName() !== "T") { iv_time = undefined; } if (iv_time === undefined) { iv_time = new abap.types.Time({qualifiedName: "T"}).set(INPUT.iv_time); } if (abap.compare.initial(iv_time) === false) { rv_str.set(abap.operators.concat(iv_time.getOffset({offset: 0, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, ':'),abap.operators.concat(iv_time.getOffset({offset: 2, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, ':'),iv_time.getOffset({offset: 4, length: 2})))))); } return rv_str; } async format_timestamp(INPUT) { return lcl_abap_to_json.format_timestamp(INPUT); } static async format_timestamp(INPUT) { let rv_str = new abap.types.String({qualifiedName: "STRING"}); let iv_ts = INPUT?.iv_ts; if (iv_ts?.getQualifiedName === undefined || iv_ts.getQualifiedName() !== "TIMESTAMP") { iv_ts = undefined; } if (iv_ts === undefined) { iv_ts = new abap.types.Packed({length: 15, decimals: 0, qualifiedName: "TIMESTAMP"}).set(INPUT.iv_ts); } let lc_utc = new abap.types.Character(6, {}); lc_utc.set('UTC'); let lv_date = new abap.types.Date({qualifiedName: "D"}); let lv_time = new abap.types.Time({qualifiedName: "T"}); abap.statements.convert({stamp: iv_ts,zone: lc_utc}, {date: lv_date,time: lv_time}); rv_str.set(abap.operators.concat(lv_date.getOffset({offset: 0, length: 4}),abap.operators.concat(abap.CharacterFactory.get(1, '-'),abap.operators.concat(lv_date.getOffset({offset: 4, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, '-'),abap.operators.concat(lv_date.getOffset({offset: 6, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, 'T'),abap.operators.concat(lv_time.getOffset({offset: 0, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, ':'),abap.operators.concat(lv_time.getOffset({offset: 2, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, ':'),abap.operators.concat(lv_time.getOffset({offset: 4, length: 2}),abap.CharacterFactory.get(1, 'Z'))))))))))))); return rv_str; } async format_timestampl(INPUT) { return lcl_abap_to_json.format_timestampl(INPUT); } static async format_timestampl(INPUT) { let rv_str = new abap.types.String({qualifiedName: "STRING"}); let iv_ts = INPUT?.iv_ts; if (iv_ts?.getQualifiedName === undefined || iv_ts.getQualifiedName() !== "TIMESTAMPL") { iv_ts = undefined; } if (iv_ts === undefined) { iv_ts = new abap.types.Packed({length: 21, decimals: 7, qualifiedName: "TIMESTAMPL"}).set(INPUT.iv_ts); } let lc_utc = new abap.types.Character(6, {}); lc_utc.set('UTC'); let lv_date = new abap.types.Date({qualifiedName: "D"}); let lv_time = new abap.types.Time({qualifiedName: "T"}); let lv_frac = new abap.types.String({qualifiedName: "STRING"}); let lv_int = new abap.types.String({qualifiedName: "STRING"}); abap.statements.convert({stamp: iv_ts,zone: lc_utc}, {date: lv_date,time: lv_time}); abap.statements.split({source: new abap.types.String().set(`${abap.templateFormatting(iv_ts)}`), at: abap.CharacterFactory.get(1, '.'), targets: [lv_int,lv_frac]}); abap.statements.shift(lv_frac, {direction: 'RIGHT',deletingTrailing: abap.CharacterFactory.get(1, '0')}); abap.statements.shift(lv_frac, {direction: 'LEFT',deletingLeading: abap.builtin.space}); rv_str.set(abap.operators.concat(lv_date.getOffset({offset: 0, length: 4}),abap.operators.concat(abap.CharacterFactory.get(1, '-'),abap.operators.concat(lv_date.getOffset({offset: 4, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, '-'),abap.operators.concat(lv_date.getOffset({offset: 6, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, 'T'),abap.operators.concat(lv_time.getOffset({offset: 0, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, ':'),abap.operators.concat(lv_time.getOffset({offset: 2, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, ':'),abap.operators.concat(lv_time.getOffset({offset: 4, length: 2}),abap.operators.concat(abap.CharacterFactory.get(1, '.'),abap.operators.concat(lv_frac,abap.CharacterFactory.get(1, 'Z'))))))))))))))); return rv_str; } async #convert_value(INPUT) { let iv_data = INPUT?.iv_data; let io_type = INPUT?.io_type; if (io_type?.getQualifiedName === undefined || io_type.getQualifiedName() !== "CL_ABAP_TYPEDESCR") { io_type = undefined; } if (io_type === undefined) { io_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}).set(INPUT.io_type); } let is_prefix = INPUT?.is_prefix; if (is_prefix?.getQualifiedName === undefined || is_prefix.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME") { is_prefix = undefined; } if (is_prefix === undefined) { is_prefix = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}).set(INPUT.is_prefix); } let iv_index = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_index) {iv_index.set(INPUT.iv_index);} if (INPUT === undefined || INPUT.iv_index === undefined) {iv_index = abap.IntegerFactory.get(0);} let iv_item_order = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_item_order) {iv_item_order.set(INPUT.iv_item_order);} if (INPUT === undefined || INPUT.iv_item_order === undefined) {iv_item_order = abap.IntegerFactory.get(0);} let ct_nodes = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt"); if (INPUT && INPUT.ct_nodes) {ct_nodes = INPUT.ct_nodes;} let ls_node = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}); ls_node.get().path.set(is_prefix.get().path); ls_node.get().name.set(is_prefix.get().name); ls_node.get().index.set(iv_index); ls_node.get().order.set(iv_item_order); if (abap.compare.initial(ls_node.get().name)) { ls_node.get().name.set(is_prefix.get().name); } if (abap.compare.eq(io_type.get().absolute_name, abap.CharacterFactory.get(30, '\\TYPE-POOL=ABAP\\TYPE=ABAP_BOOL')) || abap.compare.eq(io_type.get().absolute_name, abap.CharacterFactory.get(18, '\\TYPE=ABAP_BOOLEAN')) || abap.compare.eq(io_type.get().absolute_name, abap.CharacterFactory.get(16, '\\TYPE=XSDBOOLEAN')) || abap.compare.eq(io_type.get().absolute_name, abap.CharacterFactory.get(10, '\\TYPE=FLAG')) || abap.compare.eq(io_type.get().absolute_name, abap.CharacterFactory.get(11, '\\TYPE=XFELD'))) { ls_node.get().type.set(abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().boolean); if (abap.compare.initial(iv_data) === false) { ls_node.get().value.set(abap.CharacterFactory.get(4, 'true')); } else { ls_node.get().value.set(abap.CharacterFactory.get(5, 'false')); } } else if (abap.compare.eq(io_type.get().absolute_name, abap.CharacterFactory.get(15, '\\TYPE=TIMESTAMP'))) { if (abap.compare.eq(this.#mv_format_datetime, abap.builtin.abap_true)) { ls_node.get().type.set(abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().string); ls_node.get().value.set((await this.format_timestamp({iv_ts: iv_data}))); } else { ls_node.get().type.set(abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().number); ls_node.get().value.set(new abap.types.String().set(`${abap.templateFormatting(iv_data)}`)); } } else if (abap.compare.co(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$texts) || abap.compare.co(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$binary) || abap.compare.co(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$enum)) { ls_node.get().type.set(abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().string); ls_node.get().value.set(new abap.types.String().set(`${abap.templateFormatting(iv_data)}`)); } else if (abap.compare.eq(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$date)) { ls_node.get().type.set(abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().string); if (abap.compare.eq(this.#mv_format_datetime, abap.builtin.abap_true)) { ls_node.get().value.set((await this.format_date({iv_date: iv_data}))); } else { ls_node.get().value.set(new abap.types.String().set(`${abap.templateFormatting(iv_data)}`)); } } else if (abap.compare.eq(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$time)) { ls_node.get().type.set(abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().string); if (abap.compare.eq(this.#mv_format_datetime, abap.builtin.abap_true)) { ls_node.get().value.set((await this.format_time({iv_time: iv_data}))); } else { ls_node.get().value.set(new abap.types.String().set(`${abap.templateFormatting(iv_data)}`)); } } else if (abap.compare.co(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$numeric)) { ls_node.get().type.set(abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().number); ls_node.get().value.set(new abap.types.String().set(`${abap.templateFormatting(iv_data)}`)); } else { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unexpected elementary type [${abap.templateFormatting(io_type.get().type_kind)}] @${abap.templateFormatting(abap.operators.concat(is_prefix.get().path,is_prefix.get().name))}`)}); } abap.statements.append({source: ls_node, target: ct_nodes}); } async #convert_ref(INPUT) { let iv_data = INPUT?.iv_data; let is_prefix = INPUT?.is_prefix; if (is_prefix?.getQualifiedName === undefined || is_prefix.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME") { is_prefix = undefined; } if (is_prefix === undefined) { is_prefix = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}).set(INPUT.is_prefix); } let iv_index = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_index) {iv_index.set(INPUT.iv_index);} if (INPUT === undefined || INPUT.iv_index === undefined) {iv_index = abap.IntegerFactory.get(0);} let iv_item_order = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_item_order) {iv_item_order.set(INPUT.iv_item_order);} if (INPUT === undefined || INPUT.iv_item_order === undefined) {iv_item_order = abap.IntegerFactory.get(0);} let ct_nodes = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt"); if (INPUT && INPUT.ct_nodes) {ct_nodes = INPUT.ct_nodes;} let ls_node = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}); let lo_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}); let fs_data_ = new abap.types.FieldSymbol(new abap.types.Character(4)); ls_node.get().path.set(is_prefix.get().path); ls_node.get().name.set(is_prefix.get().name); ls_node.get().index.set(iv_index); ls_node.get().order.set(iv_item_order); if (abap.compare.initial(this.#mi_custom_mapping) === false) { ls_node.get().name.set((await this.#mi_custom_mapping.get().zif_abapgit_ajson_mapping$to_json({iv_path: is_prefix.get().path, iv_name: is_prefix.get().name}))); } if (abap.compare.initial(ls_node.get().name)) { ls_node.get().name.set(is_prefix.get().name); } if (abap.compare.initial(iv_data)) { ls_node.get().type.set(abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().null); ls_node.get().value.set(abap.CharacterFactory.get(4, 'null')); abap.statements.append({source: ls_node, target: ct_nodes}); } else { abap.statements.assign({target: fs_data_, source: iv_data.dereference()}); lo_type.set((await abap.Classes['CL_ABAP_TYPEDESCR'].describe_by_data({p_data: fs_data_}))); await this.#convert_any({iv_data: fs_data_, io_type: lo_type, is_prefix: is_prefix, iv_index: iv_index, iv_item_order: iv_item_order, ct_nodes: ct_nodes}); } } async #convert_struc(INPUT) { let iv_data = INPUT?.iv_data; let io_type = INPUT?.io_type; if (io_type?.getQualifiedName === undefined || io_type.getQualifiedName() !== "CL_ABAP_TYPEDESCR") { io_type = undefined; } if (io_type === undefined) { io_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}).set(INPUT.io_type); } let is_prefix = INPUT?.is_prefix; if (is_prefix?.getQualifiedName === undefined || is_prefix.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME") { is_prefix = undefined; } if (is_prefix === undefined) { is_prefix = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}).set(INPUT.is_prefix); } let iv_index = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_index) {iv_index.set(INPUT.iv_index);} if (INPUT === undefined || INPUT.iv_index === undefined) {iv_index = abap.IntegerFactory.get(0);} let iv_item_order = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_item_order) {iv_item_order.set(INPUT.iv_item_order);} if (INPUT === undefined || INPUT.iv_item_order === undefined) {iv_item_order = abap.IntegerFactory.get(0);} let ct_nodes = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt"); if (INPUT && INPUT.ct_nodes) {ct_nodes = INPUT.ct_nodes;} let lo_struc = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_STRUCTDESCR", RTTIName: "\\CLASS=CL_ABAP_STRUCTDESCR"}); let lt_comps = abap.types.TableFactory.construct(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "NAME"}), "type": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"})}, "abap_simple_componentdescr", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["NAME"]},"secondary":[]}, "abap_component_view_tab"); let ls_next_prefix = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}); let lv_mapping_prefix_name = new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"}); let lv_item_order = new abap.types.Integer({qualifiedName: "I"}); let ls_root = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}); let fs_root_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})); let fs_c_ = new abap.types.FieldSymbol(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "NAME"}), "type": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"})}, "abap_simple_componentdescr", undefined, {}, {})); let fs_val_ = new abap.types.FieldSymbol(new abap.types.Character(4)); ls_root.get().path.set(is_prefix.get().path); ls_root.get().name.set(is_prefix.get().name); ls_root.get().type.set(abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().object); ls_root.get().index.set(iv_index); if (abap.compare.initial(this.#mi_custom_mapping) === false) { ls_root.get().name.set((await this.#mi_custom_mapping.get().zif_abapgit_ajson_mapping$to_json({iv_path: is_prefix.get().path, iv_name: is_prefix.get().name}))); } if (abap.compare.initial(ls_root.get().name)) { ls_root.get().name.set(is_prefix.get().name); } ls_root.get().order.set(iv_item_order); abap.statements.append({source: ls_root, assigning: fs_root_, target: ct_nodes}); await abap.statements.cast(lo_struc, io_type); lt_comps.set((await lo_struc.get().get_included_view())); ls_next_prefix.get().path.set(abap.operators.concat(is_prefix.get().path,abap.operators.concat(fs_root_.get().name,abap.CharacterFactory.get(1, '/')))); for await (const unique269 of abap.statements.loop(lt_comps)) { fs_c_.assign(unique269); lv_mapping_prefix_name.clear(); fs_root_.get().children.set(abap.operators.add(fs_root_.get().children,abap.IntegerFactory.get(1))); ls_next_prefix.get().name.set(abap.builtin.to_lower({val: fs_c_.get().name})); abap.statements.assign({component: fs_c_.get().name, target: fs_val_, source: iv_data}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); if (abap.compare.initial(this.#mi_custom_mapping) === false && abap.compare.eq(fs_c_.get().type.get().kind, abap.Classes['CL_ABAP_TYPEDESCR'].kind_elem)) { lv_mapping_prefix_name.set((await this.#mi_custom_mapping.get().zif_abapgit_ajson_mapping$to_json({iv_path: ls_next_prefix.get().path, iv_name: ls_next_prefix.get().name}))); } if (abap.compare.initial(lv_mapping_prefix_name) === false) { ls_next_prefix.get().name.set(lv_mapping_prefix_name); } if (abap.compare.eq(this.#mv_keep_item_order, abap.builtin.abap_true)) { lv_item_order.set(fs_root_.get().children); } await this.#convert_any({iv_data: fs_val_, io_type: fs_c_.get().type, is_prefix: ls_next_prefix, iv_item_order: lv_item_order, ct_nodes: ct_nodes}); } } async #convert_table(INPUT) { let iv_data = INPUT?.iv_data; let io_type = INPUT?.io_type; if (io_type?.getQualifiedName === undefined || io_type.getQualifiedName() !== "CL_ABAP_TYPEDESCR") { io_type = undefined; } if (io_type === undefined) { io_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}).set(INPUT.io_type); } let is_prefix = INPUT?.is_prefix; if (is_prefix?.getQualifiedName === undefined || is_prefix.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME") { is_prefix = undefined; } if (is_prefix === undefined) { is_prefix = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}).set(INPUT.is_prefix); } let iv_index = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_index) {iv_index.set(INPUT.iv_index);} if (INPUT === undefined || INPUT.iv_index === undefined) {iv_index = abap.IntegerFactory.get(0);} let iv_item_order = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_item_order) {iv_item_order.set(INPUT.iv_item_order);} if (INPUT === undefined || INPUT.iv_item_order === undefined) {iv_item_order = abap.IntegerFactory.get(0);} let ct_nodes = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt"); if (INPUT && INPUT.ct_nodes) {ct_nodes = INPUT.ct_nodes;} let lo_table = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TABLEDESCR", RTTIName: "\\CLASS=CL_ABAP_TABLEDESCR"}); let lo_ltype = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}); let ls_next_prefix = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}); let lv_tabix = new abap.types.Integer({qualifiedName: "I"}); let ls_root = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}); let fs_root_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})); let fs_tab_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); let fs_val_ = new abap.types.FieldSymbol(new abap.types.Character(4)); ls_root.get().path.set(is_prefix.get().path); ls_root.get().name.set(is_prefix.get().name); ls_root.get().type.set(abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array); ls_root.get().index.set(iv_index); ls_root.get().order.set(iv_item_order); if (abap.compare.initial(this.#mi_custom_mapping) === false) { ls_root.get().name.set((await this.#mi_custom_mapping.get().zif_abapgit_ajson_mapping$to_json({iv_path: is_prefix.get().path, iv_name: is_prefix.get().name}))); } if (abap.compare.initial(ls_root.get().name)) { ls_root.get().name.set(is_prefix.get().name); } abap.statements.append({source: ls_root, assigning: fs_root_, target: ct_nodes}); await abap.statements.cast(lo_table, io_type); lo_ltype.set((await lo_table.get().get_table_line_type())); ls_next_prefix.get().path.set(abap.operators.concat(is_prefix.get().path,abap.operators.concat(fs_root_.get().name,abap.CharacterFactory.get(1, '/')))); abap.statements.assign({target: fs_tab_, source: iv_data}); lv_tabix.set(abap.IntegerFactory.get(1)); for await (const unique270 of abap.statements.loop(fs_tab_)) { fs_val_.assign(unique270); ls_next_prefix.get().name.set(abap.builtin.to_lower({val: new abap.types.String().set(`${abap.templateFormatting(lv_tabix)}`)})); await this.#convert_any({iv_data: fs_val_, io_type: lo_ltype, is_prefix: ls_next_prefix, iv_index: abap.operators.add(fs_root_.get().children,abap.IntegerFactory.get(1)), ct_nodes: ct_nodes}); fs_root_.get().children.set(abap.operators.add(fs_root_.get().children,abap.IntegerFactory.get(1))); lv_tabix.set(abap.operators.add(lv_tabix,abap.IntegerFactory.get(1))); } } async insert_with_type(INPUT) { return lcl_abap_to_json.insert_with_type(INPUT); } static async insert_with_type(INPUT) { let rt_nodes = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt"); let iv_data = INPUT?.iv_data; let iv_type = INPUT?.iv_type; if (iv_type?.getQualifiedName === undefined || iv_type.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE") { iv_type = undefined; } if (iv_type === undefined) { iv_type = new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}).set(INPUT.iv_type); } let is_prefix = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}); if (INPUT && INPUT.is_prefix) {is_prefix.set(INPUT.is_prefix);} let iv_array_index = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_array_index) {iv_array_index.set(INPUT.iv_array_index);} if (INPUT === undefined || INPUT.iv_array_index === undefined) {iv_array_index = abap.IntegerFactory.get(0);} let ii_custom_mapping = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"}); if (INPUT && INPUT.ii_custom_mapping) {ii_custom_mapping.set(INPUT.ii_custom_mapping);} let is_opts = new abap.types.Structure({ "read_only": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "keep_item_order": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "format_datetime": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "to_abap_corresponding_only": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_ajson=>ty_opts", undefined, {}, {}); if (INPUT && INPUT.is_opts) {is_opts.set(INPUT.is_opts);} let iv_item_order = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_item_order) {iv_item_order.set(INPUT.iv_item_order);} if (INPUT === undefined || INPUT.iv_item_order === undefined) {iv_item_order = abap.IntegerFactory.get(0);} let lo_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}); let lo_converter = new abap.types.ABAPObject({qualifiedName: "LCL_ABAP_TO_JSON", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\CLASS=LCL_ABAP_TO_JSON"}); lo_type.set((await abap.Classes['CL_ABAP_TYPEDESCR'].describe_by_data({p_data: iv_data}))); lo_converter.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_ABAP_TO_JSON']()).constructor_()); lo_converter.get().FRIENDS_ACCESS_INSTANCE["mi_custom_mapping"].set(ii_custom_mapping); lo_converter.get().FRIENDS_ACCESS_INSTANCE["mv_keep_item_order"].set(is_opts.get().keep_item_order); lo_converter.get().FRIENDS_ACCESS_INSTANCE["mv_format_datetime"].set(is_opts.get().format_datetime); await lo_converter.get().FRIENDS_ACCESS_INSTANCE["insert_value_with_type"]({iv_data: iv_data, iv_type: iv_type, io_type: lo_type, is_prefix: is_prefix, iv_index: iv_array_index, iv_item_order: iv_item_order, ct_nodes: rt_nodes}); return rt_nodes; } async #insert_value_with_type(INPUT) { let iv_data = INPUT?.iv_data; let iv_type = INPUT?.iv_type; if (iv_type?.getQualifiedName === undefined || iv_type.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE") { iv_type = undefined; } if (iv_type === undefined) { iv_type = new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}).set(INPUT.iv_type); } let io_type = INPUT?.io_type; if (io_type?.getQualifiedName === undefined || io_type.getQualifiedName() !== "CL_ABAP_TYPEDESCR") { io_type = undefined; } if (io_type === undefined) { io_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}).set(INPUT.io_type); } let is_prefix = INPUT?.is_prefix; if (is_prefix?.getQualifiedName === undefined || is_prefix.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME") { is_prefix = undefined; } if (is_prefix === undefined) { is_prefix = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_PATH_NAME-NAME"})}, "zif_abapgit_ajson_types=>ty_path_name", undefined, {}, {}).set(INPUT.is_prefix); } let iv_index = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_index) {iv_index.set(INPUT.iv_index);} if (INPUT === undefined || INPUT.iv_index === undefined) {iv_index = abap.IntegerFactory.get(0);} let iv_item_order = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.iv_item_order) {iv_item_order.set(INPUT.iv_item_order);} if (INPUT === undefined || INPUT.iv_item_order === undefined) {iv_item_order = abap.IntegerFactory.get(0);} let ct_nodes = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["PATH","NAME"]},"secondary":[]}, "zif_abapgit_ajson_types=>ty_nodes_tt"); if (INPUT && INPUT.ct_nodes) {ct_nodes = INPUT.ct_nodes;} let lv_prefix = new abap.types.String({qualifiedName: "STRING"}); let ls_node = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}); lv_prefix.set(abap.operators.concat(is_prefix.get().path,is_prefix.get().name)); if (abap.compare.co(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$texts) || abap.compare.co(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$date) || abap.compare.co(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$time)) { if (abap.compare.eq(iv_type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().boolean) && abap.compare.ne(iv_data, abap.CharacterFactory.get(4, 'true')) && abap.compare.ne(iv_data, abap.CharacterFactory.get(5, 'false'))) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unexpected boolean value [${abap.templateFormatting(iv_data)}] @${abap.templateFormatting(lv_prefix)}`)}); } else if (abap.compare.eq(iv_type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().null) && abap.compare.initial(iv_data) === false) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unexpected null value [${abap.templateFormatting(iv_data)}] @${abap.templateFormatting(lv_prefix)}`)}); } else if (abap.compare.eq(iv_type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().number) && abap.compare.cn(iv_data, abap.CharacterFactory.get(15, '0123456789. E+-'))) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unexpected numeric value [${abap.templateFormatting(iv_data)}] @${abap.templateFormatting(lv_prefix)}`)}); } else if (abap.compare.ne(iv_type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().string) && abap.compare.ne(iv_type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().boolean) && abap.compare.ne(iv_type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().null) && abap.compare.ne(iv_type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().number)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unexpected type for value [${abap.templateFormatting(iv_type)},${abap.templateFormatting(iv_data)}] @${abap.templateFormatting(lv_prefix)}`)}); } } else if (abap.compare.co(io_type.get().type_kind, abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_KIND'].lif_kind$numeric)) { if (abap.compare.ne(iv_type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().number)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unexpected value for numeric [${abap.templateFormatting(iv_data)}] @${abap.templateFormatting(lv_prefix)}`)}); } } else { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unexpected type [${abap.templateFormatting(io_type.get().type_kind)}] @${abap.templateFormatting(lv_prefix)}`)}); } ls_node.get().path.set(is_prefix.get().path); ls_node.get().name.set(is_prefix.get().name); ls_node.get().index.set(iv_index); ls_node.get().value.set(iv_data); ls_node.get().type.set(iv_type); ls_node.get().order.set(iv_item_order); if (abap.compare.initial(this.#mi_custom_mapping) === false) { ls_node.get().name.set((await this.#mi_custom_mapping.get().zif_abapgit_ajson_mapping$to_json({iv_path: is_prefix.get().path, iv_name: is_prefix.get().name}))); } if (abap.compare.initial(ls_node.get().name)) { ls_node.get().name.set(is_prefix.get().name); } abap.statements.append({source: ls_node, target: ct_nodes}); } } abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_ABAP_TO_JSON'] = lcl_abap_to_json; lcl_abap_to_json.gv_ajson_absolute_type_name = new abap.types.String({qualifiedName: "STRING"}); class lif_mutator_runner { static INTERNAL_TYPE = 'INTF'; static ATTRIBUTES = {}; static METHODS = {"RUN": {"visibility": "U", "parameters": {"IT_SOURCE_TREE": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts");}, "is_optional": " "}, "ET_DEST_TREE": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts");}, "is_optional": " "}}}}; } abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LIF_MUTATOR_RUNNER'] = lif_mutator_runner;class lcl_filter_runner { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_AJSON-LCL_FILTER_RUNNER'; static IMPLEMENTED_INTERFACES = ["LIF_MUTATOR_RUNNER"]; static ATTRIBUTES = {"MI_FILTER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_FILTER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_FILTER"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MR_SOURCE_TREE": {"type": () => {return new abap.types.DataReference(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts"));}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MR_DEST_TREE": {"type": () => {return new abap.types.DataReference(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts"));}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"WALK": {"visibility": "I", "parameters": {"IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "CS_PARENT": {"type": () => {return new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {});}, "is_optional": " "}}}, "NEW": {"visibility": "U", "parameters": {"RO_INSTANCE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "LCL_FILTER_RUNNER", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\CLASS=LCL_FILTER_RUNNER"});}, "is_optional": " "}, "II_FILTER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_FILTER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_FILTER"});}, "is_optional": " "}}}, "CONSTRUCTOR": {"visibility": "U", "parameters": {"II_FILTER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_FILTER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_FILTER"});}, "is_optional": " "}}}}; #mi_filter; #mr_source_tree; #mr_dest_tree; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "walk": this.#walk.bind(this), }; this.#mi_filter = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_FILTER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_FILTER"}); this.FRIENDS_ACCESS_INSTANCE["mi_filter"] = this.#mi_filter; this.#mr_source_tree = new abap.types.DataReference(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts")); this.FRIENDS_ACCESS_INSTANCE["mr_source_tree"] = this.#mr_source_tree; this.#mr_dest_tree = new abap.types.DataReference(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts")); this.FRIENDS_ACCESS_INSTANCE["mr_dest_tree"] = this.#mr_dest_tree; } async new(INPUT) { return lcl_filter_runner.new(INPUT); } static async new(INPUT) { let ro_instance = new abap.types.ABAPObject({qualifiedName: "LCL_FILTER_RUNNER", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\CLASS=LCL_FILTER_RUNNER"}); let ii_filter = INPUT?.ii_filter; if (ii_filter?.getQualifiedName === undefined || ii_filter.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_FILTER") { ii_filter = undefined; } if (ii_filter === undefined) { ii_filter = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_FILTER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_FILTER"}).set(INPUT.ii_filter); } ro_instance.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_FILTER_RUNNER']()).constructor_({ii_filter: ii_filter})); return ro_instance; } async constructor_(INPUT) { let ii_filter = INPUT?.ii_filter; if (ii_filter?.getQualifiedName === undefined || ii_filter.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_FILTER") { ii_filter = undefined; } if (ii_filter === undefined) { ii_filter = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_FILTER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_FILTER"}).set(INPUT.ii_filter); } abap.statements.assert(abap.compare.initial(ii_filter) === false); this.#mi_filter.set(ii_filter); return this; } async lif_mutator_runner$run(INPUT) { let it_source_tree = INPUT?.it_source_tree; if (it_source_tree?.getQualifiedName === undefined || it_source_tree.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODES_TS") { it_source_tree = undefined; } if (it_source_tree === undefined) { it_source_tree = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts").set(INPUT.it_source_tree); } let et_dest_tree = INPUT?.et_dest_tree || abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts"); et_dest_tree.clear(); this.#mr_source_tree.assign(it_source_tree); this.#mr_dest_tree.assign(et_dest_tree); await this.#walk({iv_path: abap.CharacterFactory.get(1, '')}); } async #walk(INPUT) { let iv_path = INPUT?.iv_path; if (iv_path?.getQualifiedName === undefined || iv_path.getQualifiedName() !== "STRING") { iv_path = undefined; } if (iv_path === undefined) { iv_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_path); } let cs_parent = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}); if (INPUT && INPUT.cs_parent) {cs_parent = INPUT.cs_parent;} let ls_node = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}); let lv_tab_key = new abap.types.String({qualifiedName: "STRING"}); if (abap.compare.eq(cs_parent.get().type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array)) { lv_tab_key.set(abap.CharacterFactory.get(11, 'array_index')); } for await (const unique271 of abap.statements.loop(this.#mr_source_tree.dereference(),{usingKey: lv_tab_key.get(),where: async (I) => {return abap.compare.eq(I.path, iv_path);},topEquals: {"path": iv_path}})) { ls_node.set(unique271); let unique272 = ls_node.get().type; if (abap.compare.eq(unique272, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().boolean) || abap.compare.eq(unique272, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().null) || abap.compare.eq(unique272, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().number) || abap.compare.eq(unique272, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().string)) { if (abap.compare.eq((await this.#mi_filter.get().zif_abapgit_ajson_filter$keep_node({is_node: ls_node})), abap.builtin.abap_false)) { continue; } } else if (abap.compare.eq(unique272, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array) || abap.compare.eq(unique272, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().object)) { if (abap.compare.eq((await this.#mi_filter.get().zif_abapgit_ajson_filter$keep_node({is_node: ls_node, iv_visit: abap.Classes['ZIF_ABAPGIT_AJSON_FILTER'].zif_abapgit_ajson_filter$visit_type.get().open})), abap.builtin.abap_false)) { continue; } ls_node.get().children.clear(); await this.#walk({iv_path: abap.operators.concat(iv_path,abap.operators.concat(ls_node.get().name,new abap.types.String().set(`/`))), cs_parent: ls_node}); if (abap.compare.eq((await this.#mi_filter.get().zif_abapgit_ajson_filter$keep_node({is_node: ls_node, iv_visit: abap.Classes['ZIF_ABAPGIT_AJSON_FILTER'].zif_abapgit_ajson_filter$visit_type.get().close})), abap.builtin.abap_false)) { continue; } } else { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: new abap.types.String().set(`Unexpected node type ${abap.templateFormatting(ls_node.get().type)}`)}); } if (INPUT && INPUT.cs_parent) { cs_parent.get().children.set(abap.operators.add(cs_parent.get().children,abap.IntegerFactory.get(1))); if (abap.compare.eq(cs_parent.get().type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array)) { ls_node.get().name.set(new abap.types.String().set(`${abap.templateFormatting(cs_parent.get().children)}`)); ls_node.get().index.set(cs_parent.get().children); } } abap.statements.insertInternal({data: ls_node, table: this.#mr_dest_tree.dereference()}); } } } abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_FILTER_RUNNER'] = lcl_filter_runner; class lcl_mapper_runner { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_AJSON-LCL_MAPPER_RUNNER'; static IMPLEMENTED_INTERFACES = ["LIF_MUTATOR_RUNNER"]; static ATTRIBUTES = {"MI_MAPPER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MR_SOURCE_TREE": {"type": () => {return new abap.types.DataReference(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts"));}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MR_DEST_TREE": {"type": () => {return new abap.types.DataReference(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts"));}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"PROCESS_DEEP_NODE": {"visibility": "I", "parameters": {"IV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_RENAMED_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_NODE_TYPE": {"type": () => {return new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"});}, "is_optional": " "}}}, "NEW": {"visibility": "U", "parameters": {"RO_INSTANCE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "LCL_MAPPER_RUNNER", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\CLASS=LCL_MAPPER_RUNNER"});}, "is_optional": " "}, "II_MAPPER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"});}, "is_optional": " "}}}, "CONSTRUCTOR": {"visibility": "U", "parameters": {"II_MAPPER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"});}, "is_optional": " "}}}}; #mi_mapper; #mr_source_tree; #mr_dest_tree; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "process_deep_node": this.#process_deep_node.bind(this), }; this.#mi_mapper = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"}); this.FRIENDS_ACCESS_INSTANCE["mi_mapper"] = this.#mi_mapper; this.#mr_source_tree = new abap.types.DataReference(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts")); this.FRIENDS_ACCESS_INSTANCE["mr_source_tree"] = this.#mr_source_tree; this.#mr_dest_tree = new abap.types.DataReference(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts")); this.FRIENDS_ACCESS_INSTANCE["mr_dest_tree"] = this.#mr_dest_tree; } async new(INPUT) { return lcl_mapper_runner.new(INPUT); } static async new(INPUT) { let ro_instance = new abap.types.ABAPObject({qualifiedName: "LCL_MAPPER_RUNNER", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\CLASS=LCL_MAPPER_RUNNER"}); let ii_mapper = INPUT?.ii_mapper; if (ii_mapper?.getQualifiedName === undefined || ii_mapper.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_MAPPING") { ii_mapper = undefined; } if (ii_mapper === undefined) { ii_mapper = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"}).set(INPUT.ii_mapper); } ro_instance.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_MAPPER_RUNNER']()).constructor_({ii_mapper: ii_mapper})); return ro_instance; } async constructor_(INPUT) { let ii_mapper = INPUT?.ii_mapper; if (ii_mapper?.getQualifiedName === undefined || ii_mapper.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_MAPPING") { ii_mapper = undefined; } if (ii_mapper === undefined) { ii_mapper = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_AJSON_MAPPING", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_AJSON_MAPPING"}).set(INPUT.ii_mapper); } abap.statements.assert(abap.compare.initial(ii_mapper) === false); this.#mi_mapper.set(ii_mapper); return this; } async lif_mutator_runner$run(INPUT) { let it_source_tree = INPUT?.it_source_tree; if (it_source_tree?.getQualifiedName === undefined || it_source_tree.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODES_TS") { it_source_tree = undefined; } if (it_source_tree === undefined) { it_source_tree = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts").set(INPUT.it_source_tree); } let et_dest_tree = INPUT?.et_dest_tree || abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts"); let fs_root_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})); abap.statements.readTable(it_source_tree,{assigning: fs_root_, withKey: (i) => {return abap.compare.eq(i.path, new abap.types.String().set(``)) && abap.compare.eq(i.name, new abap.types.String().set(``));}, withKeyValue: [{key: (i) => {return i.path}, value: new abap.types.String().set(``)},{key: (i) => {return i.name}, value: new abap.types.String().set(``)}], usesTableLine: false, withKeySimple: {"path": new abap.types.String().set(``),"name": new abap.types.String().set(``)}}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)) || !(abap.compare.eq(fs_root_.get().type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array) || abap.compare.eq(fs_root_.get().type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().object))) { et_dest_tree.set(it_source_tree); return; } et_dest_tree.clear(); this.#mr_source_tree.assign(it_source_tree); this.#mr_dest_tree.assign(et_dest_tree); abap.statements.insertInternal({data: fs_root_, table: et_dest_tree}); await this.#process_deep_node({iv_path: new abap.types.String().set(`/`), iv_renamed_path: new abap.types.String().set(`/`), iv_node_type: fs_root_.get().type}); } async #process_deep_node(INPUT) { let iv_path = INPUT?.iv_path; if (iv_path?.getQualifiedName === undefined || iv_path.getQualifiedName() !== "STRING") { iv_path = undefined; } if (iv_path === undefined) { iv_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_path); } let iv_renamed_path = INPUT?.iv_renamed_path; if (iv_renamed_path?.getQualifiedName === undefined || iv_renamed_path.getQualifiedName() !== "STRING") { iv_renamed_path = undefined; } if (iv_renamed_path === undefined) { iv_renamed_path = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_renamed_path); } let iv_node_type = INPUT?.iv_node_type; if (iv_node_type?.getQualifiedName === undefined || iv_node_type.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE") { iv_node_type = undefined; } if (iv_node_type === undefined) { iv_node_type = new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}).set(INPUT.iv_node_type); } let fs_item_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {})); let ls_renamed_node = new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}); for await (const unique273 of abap.statements.loop(this.#mr_source_tree.dereference(),{where: async (I) => {return abap.compare.eq(I.path, iv_path);},topEquals: {"path": iv_path}})) { fs_item_.assign(unique273); ls_renamed_node.set(fs_item_); if (abap.compare.ne(iv_node_type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array)) { await this.#mi_mapper.get().zif_abapgit_ajson_mapping$rename_node({is_node: fs_item_, cv_name: ls_renamed_node.get().name}); if (abap.compare.initial(ls_renamed_node.get().name)) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(33, 'Renamed node name cannot be empty'), is_node: fs_item_}); } } ls_renamed_node.get().path.set(iv_renamed_path); abap.statements.insertInternal({data: ls_renamed_node, table: this.#mr_dest_tree.dereference()}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { await abap.Classes['ZCX_ABAPGIT_AJSON_ERROR'].raise({iv_msg: abap.CharacterFactory.get(28, 'Renamed node has a duplicate'), is_node: ls_renamed_node}); } if (abap.compare.eq(fs_item_.get().type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().array) || abap.compare.eq(fs_item_.get().type, abap.Classes['ZIF_ABAPGIT_AJSON_TYPES'].zif_abapgit_ajson_types$node_type.get().object)) { await this.#process_deep_node({iv_path: abap.operators.concat(iv_path,abap.operators.concat(fs_item_.get().name,new abap.types.String().set(`/`))), iv_renamed_path: abap.operators.concat(iv_renamed_path,abap.operators.concat(ls_renamed_node.get().name,new abap.types.String().set(`/`))), iv_node_type: fs_item_.get().type}); } } } } abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_MAPPER_RUNNER'] = lcl_mapper_runner; class lcl_mutator_queue { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_AJSON-LCL_MUTATOR_QUEUE'; static IMPLEMENTED_INTERFACES = ["LIF_MUTATOR_RUNNER"]; static ATTRIBUTES = {"MT_QUEUE": {"type": () => {return abap.types.TableFactory.construct(new abap.types.ABAPObject({qualifiedName: "LIF_MUTATOR_RUNNER", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\INTERFACE=LIF_MUTATOR_RUNNER"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"NEW": {"visibility": "U", "parameters": {"RO_INSTANCE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "LCL_MUTATOR_QUEUE", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\CLASS=LCL_MUTATOR_QUEUE"});}, "is_optional": " "}}}, "ADD": {"visibility": "U", "parameters": {"RO_SELF": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "LCL_MUTATOR_QUEUE", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\CLASS=LCL_MUTATOR_QUEUE"});}, "is_optional": " "}, "II_MUTATOR": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "LIF_MUTATOR_RUNNER", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\INTERFACE=LIF_MUTATOR_RUNNER"});}, "is_optional": " "}}}}; #mt_queue; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "add": this.add.bind(this), }; this.#mt_queue = abap.types.TableFactory.construct(new abap.types.ABAPObject({qualifiedName: "LIF_MUTATOR_RUNNER", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\INTERFACE=LIF_MUTATOR_RUNNER"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, ""); this.FRIENDS_ACCESS_INSTANCE["mt_queue"] = this.#mt_queue; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async add(INPUT) { let ro_self = new abap.types.ABAPObject({qualifiedName: "LCL_MUTATOR_QUEUE", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\CLASS=LCL_MUTATOR_QUEUE"}); let ii_mutator = INPUT?.ii_mutator; if (ii_mutator?.getQualifiedName === undefined || ii_mutator.getQualifiedName() !== "LIF_MUTATOR_RUNNER") { ii_mutator = undefined; } if (ii_mutator === undefined) { ii_mutator = new abap.types.ABAPObject({qualifiedName: "LIF_MUTATOR_RUNNER", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\INTERFACE=LIF_MUTATOR_RUNNER"}).set(INPUT.ii_mutator); } if (abap.compare.initial(ii_mutator) === false) { abap.statements.append({source: ii_mutator, target: this.#mt_queue}); } ro_self.set(this.me); return ro_self; } async new() { return lcl_mutator_queue.new(); } static async new() { let ro_instance = new abap.types.ABAPObject({qualifiedName: "LCL_MUTATOR_QUEUE", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\CLASS=LCL_MUTATOR_QUEUE"}); ro_instance.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_MUTATOR_QUEUE']()).constructor_()); return ro_instance; } async lif_mutator_runner$run(INPUT) { let it_source_tree = INPUT?.it_source_tree; if (it_source_tree?.getQualifiedName === undefined || it_source_tree.getQualifiedName() !== "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODES_TS") { it_source_tree = undefined; } if (it_source_tree === undefined) { it_source_tree = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts").set(INPUT.it_source_tree); } let et_dest_tree = INPUT?.et_dest_tree || abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts"); let li_mutator = new abap.types.ABAPObject({qualifiedName: "LIF_MUTATOR_RUNNER", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_AJSON\\INTERFACE=LIF_MUTATOR_RUNNER"}); let lv_qsize = new abap.types.Integer({qualifiedName: "I"}); let fs_from_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts")); let fs_to_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts")); let lr_buf = new abap.types.DataReference(abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-PATH"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-NAME"}), "type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE_TYPE"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-VALUE"}), "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-INDEX"}), "order": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-ORDER"}), "children": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_AJSON_TYPES=>TY_NODE-CHILDREN"})}, "zif_abapgit_ajson_types=>ty_node", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["PATH","NAME"]},"secondary":[{"name":"array_index","type":"SORTED","isUnique":false,"keyFields":["PATH","INDEX"]},{"name":"item_order","type":"SORTED","isUnique":false,"keyFields":["PATH","ORDER"]}]}, "zif_abapgit_ajson_types=>ty_nodes_ts")); lv_qsize.set(abap.builtin.lines({val: this.#mt_queue})); if (abap.compare.eq(lv_qsize, abap.IntegerFactory.get(0))) { et_dest_tree.set(it_source_tree); return; } for await (const unique274 of abap.statements.loop(this.#mt_queue)) { li_mutator.set(unique274); if (abap.compare.eq(abap.builtin.sy.get().tabix, abap.IntegerFactory.get(1))) { abap.statements.assign({target: fs_from_, source: it_source_tree}); } else { abap.statements.assign({target: fs_from_, source: lr_buf.dereference()}); } if (abap.compare.eq(abap.builtin.sy.get().tabix, lv_qsize)) { abap.statements.assign({target: fs_to_, source: et_dest_tree}); } else { abap.statements.createData(lr_buf); abap.statements.assign({target: fs_to_, source: lr_buf.dereference()}); } await li_mutator.get().lif_mutator_runner$run({it_source_tree: fs_from_, et_dest_tree: fs_to_}); } } } abap.Classes['CLAS-ZCL_ABAPGIT_AJSON-LCL_MUTATOR_QUEUE'] = lcl_mutator_queue; export {lcl_utils, lcl_json_parser, lcl_json_serializer, lcl_json_to_abap, lcl_abap_to_json, lcl_filter_runner, lcl_mapper_runner, lcl_mutator_queue, lif_kind, lif_mutator_runner}; |