JAVASCRIPT 7
JSONArray.js Guest on 8th April 2021 05:55:19 AM
  1. (function(){var P$=Clazz.newPackage("org.json.simple"),I$=[[0,'org.json.simple.JSONValue','java.io.StringWriter']],$I$=function(i){return I$[i]||(I$[i]=Clazz.load(I$[0][i]))};
  2. var C$=Clazz.newClass(P$, "JSONArray", null, 'java.util.ArrayList', ['org.json.simple.JSONAware', 'org.json.simple.JSONStreamAware']);
  3.  
  4. C$.$clinit$ = function() {Clazz.load(C$, 1);
  5. }
  6.  
  7. Clazz.newMeth(C$, '$init$', function () {
  8. }, 1);
  9.  
  10. Clazz.newMeth(C$, 'c$', function () {
  11. C$.superclazz.c$.apply(this, []);
  12. C$.$init$.apply(this);
  13. }, 1);
  14.  
  15. Clazz.newMeth(C$, 'c$$java_util_Collection', function (c) {
  16. C$.superclazz.c$$java_util_Collection.apply(this, [c]);
  17. C$.$init$.apply(this);
  18. }, 1);
  19.  
  20. Clazz.newMeth(C$, 'writeJSONString$java_util_Collection$java_io_Writer', function (collection, out) {
  21. if (collection == null ) {
  22. out.write$S("null");
  23. return;
  24. }var first=true;
  25. var iter=collection.iterator$();
  26. out.write$I("[".$c());
  27. while (iter.hasNext$()){
  28. if (first) first=false;
  29.  else out.write$I(",".$c());
  30. var value=iter.next$();
  31. if (value == null ) {
  32. out.write$S("null");
  33. continue;
  34. }$I$(1).writeJSONString$O$java_io_Writer(value, out);
  35. }
  36. out.write$I("]".$c());
  37. }, 1);
  38.  
  39. Clazz.newMeth(C$, ['writeJSONString$java_io_Writer','writeJSONString$'], function (out) {
  40. C$.writeJSONString$java_util_Collection$java_io_Writer(this, out);
  41. });
  42.  
  43. Clazz.newMeth(C$, 'toJSONString$java_util_Collection', function (collection) {
  44. var writer=Clazz.new_($I$(2));
  45. try {
  46. C$.writeJSONString$java_util_Collection$java_io_Writer(collection, writer);
  47. return writer.toString();
  48. } catch (e) {
  49. if (Clazz.exceptionOf(e,"java.io.IOException")){
  50. throw Clazz.new_(Clazz.load('RuntimeException').c$$Throwable,[e]);
  51. } else {
  52. throw e;
  53. }
  54. }
  55. }, 1);
  56.  
  57. Clazz.newMeth(C$, 'writeJSONString$BA$java_io_Writer', function (array, out) {
  58. if (array == null ) {
  59. out.write$S("null");
  60. } else if (array.length == 0) {
  61. out.write$S("[]");
  62. } else {
  63. out.write$S("[");
  64. out.write$S(String.valueOf$I(array[0]));
  65. for (var i=1; i < array.length; i++) {
  66. out.write$S(",");
  67. out.write$S(String.valueOf$I(array[i]));
  68. }
  69. out.write$S("]");
  70. }}, 1);
  71.  
  72. Clazz.newMeth(C$, 'toJSONString$BA', function (array) {
  73. var writer=Clazz.new_($I$(2));
  74. try {
  75. C$.writeJSONString$BA$java_io_Writer(array, writer);
  76. return writer.toString();
  77. } catch (e) {
  78. if (Clazz.exceptionOf(e,"java.io.IOException")){
  79. throw Clazz.new_(Clazz.load('RuntimeException').c$$Throwable,[e]);
  80. } else {
  81. throw e;
  82. }
  83. }
  84. }, 1);
  85.  
  86. Clazz.newMeth(C$, 'writeJSONString$HA$java_io_Writer', function (array, out) {
  87. if (array == null ) {
  88. out.write$S("null");
  89. } else if (array.length == 0) {
  90. out.write$S("[]");
  91. } else {
  92. out.write$S("[");
  93. out.write$S(String.valueOf$I(array[0]));
  94. for (var i=1; i < array.length; i++) {
  95. out.write$S(",");
  96. out.write$S(String.valueOf$I(array[i]));
  97. }
  98. out.write$S("]");
  99. }}, 1);
  100.  
  101. Clazz.newMeth(C$, 'toJSONString$HA', function (array) {
  102. var writer=Clazz.new_($I$(2));
  103. try {
  104. C$.writeJSONString$HA$java_io_Writer(array, writer);
  105. return writer.toString();
  106. } catch (e) {
  107. if (Clazz.exceptionOf(e,"java.io.IOException")){
  108. throw Clazz.new_(Clazz.load('RuntimeException').c$$Throwable,[e]);
  109. } else {
  110. throw e;
  111. }
  112. }
  113. }, 1);
  114.  
  115. Clazz.newMeth(C$, 'writeJSONString$IA$java_io_Writer', function (array, out) {
  116. if (array == null ) {
  117. out.write$S("null");
  118. } else if (array.length == 0) {
  119. out.write$S("[]");
  120. } else {
  121. out.write$S("[");
  122. out.write$S(String.valueOf$I(array[0]));
  123. for (var i=1; i < array.length; i++) {
  124. out.write$S(",");
  125. out.write$S(String.valueOf$I(array[i]));
  126. }
  127. out.write$S("]");
  128. }}, 1);
  129.  
  130. Clazz.newMeth(C$, 'toJSONString$IA', function (array) {
  131. var writer=Clazz.new_($I$(2));
  132. try {
  133. C$.writeJSONString$IA$java_io_Writer(array, writer);
  134. return writer.toString();
  135. } catch (e) {
  136. if (Clazz.exceptionOf(e,"java.io.IOException")){
  137. throw Clazz.new_(Clazz.load('RuntimeException').c$$Throwable,[e]);
  138. } else {
  139. throw e;
  140. }
  141. }
  142. }, 1);
  143.  
  144. Clazz.newMeth(C$, 'writeJSONString$JA$java_io_Writer', function (array, out) {
  145. if (array == null ) {
  146. out.write$S("null");
  147. } else if (array.length == 0) {
  148. out.write$S("[]");
  149. } else {
  150. out.write$S("[");
  151. out.write$S(String.valueOf$J(array[0]));
  152. for (var i=1; i < array.length; i++) {
  153. out.write$S(",");
  154. out.write$S(String.valueOf$J(array[i]));
  155. }
  156. out.write$S("]");
  157. }}, 1);
  158.  
  159. Clazz.newMeth(C$, 'toJSONString$JA', function (array) {
  160. var writer=Clazz.new_($I$(2));
  161. try {
  162. C$.writeJSONString$JA$java_io_Writer(array, writer);
  163. return writer.toString();
  164. } catch (e) {
  165. if (Clazz.exceptionOf(e,"java.io.IOException")){
  166. throw Clazz.new_(Clazz.load('RuntimeException').c$$Throwable,[e]);
  167. } else {
  168. throw e;
  169. }
  170. }
  171. }, 1);
  172.  
  173. Clazz.newMeth(C$, 'writeJSONString$FA$java_io_Writer', function (array, out) {
  174. if (array == null ) {
  175. out.write$S("null");
  176. } else if (array.length == 0) {
  177. out.write$S("[]");
  178. } else {
  179. out.write$S("[");
  180. out.write$S(String.valueOf$F(array[0]));
  181. for (var i=1; i < array.length; i++) {
  182. out.write$S(",");
  183. out.write$S(String.valueOf$F(array[i]));
  184. }
  185. out.write$S("]");
  186. }}, 1);
  187.  
  188. Clazz.newMeth(C$, 'toJSONString$FA', function (array) {
  189. var writer=Clazz.new_($I$(2));
  190. try {
  191. C$.writeJSONString$FA$java_io_Writer(array, writer);
  192. return writer.toString();
  193. } catch (e) {
  194. if (Clazz.exceptionOf(e,"java.io.IOException")){
  195. throw Clazz.new_(Clazz.load('RuntimeException').c$$Throwable,[e]);
  196. } else {
  197. throw e;
  198. }
  199. }
  200. }, 1);
  201.  
  202. Clazz.newMeth(C$, 'writeJSONString$DA$java_io_Writer', function (array, out) {
  203. if (array == null ) {
  204. out.write$S("null");
  205. } else if (array.length == 0) {
  206. out.write$S("[]");
  207. } else {
  208. out.write$S("[");
  209. out.write$S(String.valueOf$D(array[0]));
  210. for (var i=1; i < array.length; i++) {
  211. out.write$S(",");
  212. out.write$S(String.valueOf$D(array[i]));
  213. }
  214. out.write$S("]");
  215. }}, 1);
  216.  
  217. Clazz.newMeth(C$, 'toJSONString$DA', function (array) {
  218. var writer=Clazz.new_($I$(2));
  219. try {
  220. C$.writeJSONString$DA$java_io_Writer(array, writer);
  221. return writer.toString();
  222. } catch (e) {
  223. if (Clazz.exceptionOf(e,"java.io.IOException")){
  224. throw Clazz.new_(Clazz.load('RuntimeException').c$$Throwable,[e]);
  225. } else {
  226. throw e;
  227. }
  228. }
  229. }, 1);
  230.  
  231. Clazz.newMeth(C$, 'writeJSONString$ZA$java_io_Writer', function (array, out) {
  232. if (array == null ) {
  233. out.write$S("null");
  234. } else if (array.length == 0) {
  235. out.write$S("[]");
  236. } else {
  237. out.write$S("[");
  238. out.write$S(String.valueOf$Z(array[0]));
  239. for (var i=1; i < array.length; i++) {
  240. out.write$S(",");
  241. out.write$S(String.valueOf$Z(array[i]));
  242. }
  243. out.write$S("]");
  244. }}, 1);
  245.  
  246. Clazz.newMeth(C$, 'toJSONString$ZA', function (array) {
  247. var writer=Clazz.new_($I$(2));
  248. try {
  249. C$.writeJSONString$ZA$java_io_Writer(array, writer);
  250. return writer.toString();
  251. } catch (e) {
  252. if (Clazz.exceptionOf(e,"java.io.IOException")){
  253. throw Clazz.new_(Clazz.load('RuntimeException').c$$Throwable,[e]);
  254. } else {
  255. throw e;
  256. }
  257. }
  258. }, 1);
  259.  
  260. Clazz.newMeth(C$, 'writeJSONString$CA$java_io_Writer', function (array, out) {
  261. if (array == null ) {
  262. out.write$S("null");
  263. } else if (array.length == 0) {
  264. out.write$S("[]");
  265. } else {
  266. out.write$S("[\"");
  267. out.write$S(String.valueOf$C(array[0]));
  268. for (var i=1; i < array.length; i++) {
  269. out.write$S("\",\"");
  270. out.write$S(String.valueOf$C(array[i]));
  271. }
  272. out.write$S("\"]");
  273. }}, 1);
  274.  
  275. Clazz.newMeth(C$, 'toJSONString$CA', function (array) {
  276. var writer=Clazz.new_($I$(2));
  277. try {
  278. C$.writeJSONString$CA$java_io_Writer(array, writer);
  279. return writer.toString();
  280. } catch (e) {
  281. if (Clazz.exceptionOf(e,"java.io.IOException")){
  282. throw Clazz.new_(Clazz.load('RuntimeException').c$$Throwable,[e]);
  283. } else {
  284. throw e;
  285. }
  286. }
  287. }, 1);
  288.  
  289. Clazz.newMeth(C$, 'writeJSONString$OA$java_io_Writer', function (array, out) {
  290. if (array == null ) {
  291. out.write$S("null");
  292. } else if (array.length == 0) {
  293. out.write$S("[]");
  294. } else {
  295. out.write$S("[");
  296. $I$(1).writeJSONString$O$java_io_Writer(array[0], out);
  297. for (var i=1; i < array.length; i++) {
  298. out.write$S(",");
  299. $I$(1).writeJSONString$O$java_io_Writer(array[i], out);
  300. }
  301. out.write$S("]");
  302. }}, 1);
  303.  
  304. Clazz.newMeth(C$, 'toJSONString$OA', function (array) {
  305. var writer=Clazz.new_($I$(2));
  306. try {
  307. C$.writeJSONString$OA$java_io_Writer(array, writer);
  308. return writer.toString();
  309. } catch (e) {
  310. if (Clazz.exceptionOf(e,"java.io.IOException")){
  311. throw Clazz.new_(Clazz.load('RuntimeException').c$$Throwable,[e]);
  312. } else {
  313. throw e;
  314. }
  315. }
  316. }, 1);
  317.  
  318. Clazz.newMeth(C$, 'toJSONString$', function () {
  319. return C$.toJSONString$java_util_Collection(this);
  320. });
  321.  
  322. Clazz.newMeth(C$, 'toString', function () {
  323. return this.toJSONString$();
  324. });
  325. })();
  326. ;Clazz.setTVer('3.2.4.07');
  327. //Java2ScriptVisitor version 3.2.4.07 // net.sf.j2s.core.jar version 3.2.4.07

Paste-bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.