JSONStringer.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="en">
  4. <head>
  5. <!-- Generated by javadoc (1.8.0_161) on Thu Aug 16 18:54:13 JST 2018 -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <title>JSONStringer (twitter4j-core 4.0.7 API)</title>
  8. <meta name="date" content="2018-08-16">
  9. <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
  10. <script type="text/javascript" src="../script.js"></script>
  11. </head>
  12. <body>
  13. <script type="text/javascript"><!--
  14. try {
  15. if (location.href.indexOf('is-external=true') == -1) {
  16. parent.document.title="JSONStringer (twitter4j-core 4.0.7 API)";
  17. }
  18. }
  19. catch(err) {
  20. }
  21. //-->
  22. var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10};
  23. var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
  24. var altColor = "altColor";
  25. var rowColor = "rowColor";
  26. var tableTab = "tableTab";
  27. var activeTableTab = "activeTableTab";
  28. </script>
  29. <noscript>
  30. <div>JavaScript is disabled on your browser.</div>
  31. </noscript>
  32. <!-- ========= START OF TOP NAVBAR ======= -->
  33. <div class="topNav"><a name="navbar.top">
  34. <!-- -->
  35. </a>
  36. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  37. <a name="navbar.top.firstrow">
  38. <!-- -->
  39. </a>
  40. <ul class="navList" title="Navigation">
  41. <li><a href="../overview-summary.html">Overview</a></li>
  42. <li><a href="package-summary.html">Package</a></li>
  43. <li class="navBarCell1Rev">Class</li>
  44. <li><a href="class-use/JSONStringer.html">Use</a></li>
  45. <li><a href="package-tree.html">Tree</a></li>
  46. <li><a href="../deprecated-list.html">Deprecated</a></li>
  47. <li><a href="../index-all.html">Index</a></li>
  48. <li><a href="../help-doc.html">Help</a></li>
  49. </ul>
  50. </div>
  51. <div class="subNav">
  52. <ul class="navList">
  53. <li><a href="../twitter4j/JSONObjectType.Type.html" title="enum in twitter4j"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  54. <li><a href="../twitter4j/JSONTokener.html" title="class in twitter4j"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  55. </ul>
  56. <ul class="navList">
  57. <li><a href="../index.html?twitter4j/JSONStringer.html" target="_top">Frames</a></li>
  58. <li><a href="JSONStringer.html" target="_top">No&nbsp;Frames</a></li>
  59. </ul>
  60. <ul class="navList" id="allclasses_navbar_top">
  61. <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
  62. </ul>
  63. <div>
  64. <script type="text/javascript"><!--
  65. allClassesLink = document.getElementById("allclasses_navbar_top");
  66. if(window==top) {
  67. allClassesLink.style.display = "block";
  68. }
  69. else {
  70. allClassesLink.style.display = "none";
  71. }
  72. //-->
  73. </script>
  74. </div>
  75. <div>
  76. <ul class="subNavList">
  77. <li>Summary:&nbsp;</li>
  78. <li>Nested&nbsp;|&nbsp;</li>
  79. <li>Field&nbsp;|&nbsp;</li>
  80. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  81. <li><a href="#method.summary">Method</a></li>
  82. </ul>
  83. <ul class="subNavList">
  84. <li>Detail:&nbsp;</li>
  85. <li>Field&nbsp;|&nbsp;</li>
  86. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  87. <li><a href="#method.detail">Method</a></li>
  88. </ul>
  89. </div>
  90. <a name="skip.navbar.top">
  91. <!-- -->
  92. </a></div>
  93. <!-- ========= END OF TOP NAVBAR ========= -->
  94. <!-- ======== START OF CLASS DATA ======== -->
  95. <div class="header">
  96. <div class="subTitle">twitter4j</div>
  97. <h2 title="Class JSONStringer" class="title">Class JSONStringer</h2>
  98. </div>
  99. <div class="contentContainer">
  100. <ul class="inheritance">
  101. <li><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
  102. <li>
  103. <ul class="inheritance">
  104. <li>twitter4j.JSONStringer</li>
  105. </ul>
  106. </li>
  107. </ul>
  108. <div class="description">
  109. <ul class="blockList">
  110. <li class="blockList">
  111. <hr>
  112. <br>
  113. <pre>public class <span class="typeNameLabel">JSONStringer</span>
  114. extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
  115. <div class="block">Implements <a href="../twitter4j/JSONObject.html#toString--"><code>JSONObject.toString()</code></a> and <a href="../twitter4j/JSONArray.html#toString--"><code>JSONArray.toString()</code></a>. Most
  116. application developers should use those methods directly and disregard this
  117. API. For example:<pre>
  118. JSONObject object = ...
  119. String json = object.toString();</pre>
  120. <p>Stringers only encode well-formed JSON strings. In particular:
  121. <ul>
  122. <li>The stringer must have exactly one top-level array or object.
  123. <li>Lexical scopes must be balanced: every call to <a href="../twitter4j/JSONStringer.html#array--"><code>array()</code></a> must
  124. have a matching call to <a href="../twitter4j/JSONStringer.html#endArray--"><code>endArray()</code></a> and every call to <a href="../twitter4j/JSONStringer.html#object--"><code>object()</code></a> must have a matching call to <a href="../twitter4j/JSONStringer.html#endObject--"><code>endObject()</code></a>.
  125. <li>Arrays may not contain keys (property names).
  126. <li>Objects must alternate keys (property names) and values.
  127. <li>Values are inserted with either literal <a href="../twitter4j/JSONStringer.html#value-java.lang.Object-"><code>value</code></a>
  128. calls, or by nesting arrays or objects.
  129. </ul>
  130. Calls that would result in a malformed JSON string will fail with a
  131. <a href="../twitter4j/JSONException.html" title="class in twitter4j"><code>JSONException</code></a>.
  132. <p>This class provides no facility for pretty-printing (ie. indenting)
  133. output. To encode indented output, use <a href="../twitter4j/JSONObject.html#toString-int-"><code>JSONObject.toString(int)</code></a> or
  134. <a href="../twitter4j/JSONArray.html#toString-int-"><code>JSONArray.toString(int)</code></a>.
  135. <p>Some implementations of the API support at most 20 levels of nesting.
  136. Attempts to create more than 20 levels of nesting may fail with a <a href="../twitter4j/JSONException.html" title="class in twitter4j"><code>JSONException</code></a>.
  137. <p>Each stringer may be used to encode a single top level value. Instances of
  138. this class are not thread safe. Although this class is nonfinal, it was not
  139. designed for inheritance and should not be subclassed. In particular,
  140. self-use by overrideable methods is not specified. See <i>Effective Java</i>
  141. Item 17, "Design and Document or inheritance or else prohibit it" for further
  142. information.</div>
  143. </li>
  144. </ul>
  145. </div>
  146. <div class="summary">
  147. <ul class="blockList">
  148. <li class="blockList">
  149. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  150. <ul class="blockList">
  151. <li class="blockList"><a name="constructor.summary">
  152. <!-- -->
  153. </a>
  154. <h3>Constructor Summary</h3>
  155. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  156. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  157. <tr>
  158. <th class="colOne" scope="col">Constructor and Description</th>
  159. </tr>
  160. <tr class="altColor">
  161. <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONStringer.html#JSONStringer--">JSONStringer</a></span>()</code>&nbsp;</td>
  162. </tr>
  163. </table>
  164. </li>
  165. </ul>
  166. <!-- ========== METHOD SUMMARY =========== -->
  167. <ul class="blockList">
  168. <li class="blockList"><a name="method.summary">
  169. <!-- -->
  170. </a>
  171. <h3>Method Summary</h3>
  172. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  173. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  174. <tr>
  175. <th class="colFirst" scope="col">Modifier and Type</th>
  176. <th class="colLast" scope="col">Method and Description</th>
  177. </tr>
  178. <tr id="i0" class="altColor">
  179. <td class="colFirst"><code><a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a></code></td>
  180. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONStringer.html#array--">array</a></span>()</code>
  181. <div class="block">Begins encoding a new array.</div>
  182. </td>
  183. </tr>
  184. <tr id="i1" class="rowColor">
  185. <td class="colFirst"><code><a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a></code></td>
  186. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONStringer.html#endArray--">endArray</a></span>()</code>
  187. <div class="block">Ends encoding the current array.</div>
  188. </td>
  189. </tr>
  190. <tr id="i2" class="altColor">
  191. <td class="colFirst"><code><a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a></code></td>
  192. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONStringer.html#endObject--">endObject</a></span>()</code>
  193. <div class="block">Ends encoding the current object.</div>
  194. </td>
  195. </tr>
  196. <tr id="i3" class="rowColor">
  197. <td class="colFirst"><code><a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a></code></td>
  198. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONStringer.html#key-java.lang.String-">key</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code>
  199. <div class="block">Encodes the key (property name) to this stringer.</div>
  200. </td>
  201. </tr>
  202. <tr id="i4" class="altColor">
  203. <td class="colFirst"><code><a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a></code></td>
  204. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONStringer.html#object--">object</a></span>()</code>
  205. <div class="block">Begins encoding a new object.</div>
  206. </td>
  207. </tr>
  208. <tr id="i5" class="rowColor">
  209. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
  210. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONStringer.html#toString--">toString</a></span>()</code>
  211. <div class="block">Returns the encoded JSON string.</div>
  212. </td>
  213. </tr>
  214. <tr id="i6" class="altColor">
  215. <td class="colFirst"><code><a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a></code></td>
  216. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONStringer.html#value-boolean-">value</a></span>(boolean&nbsp;value)</code>
  217. <div class="block">Encodes <code>value</code> to this stringer.</div>
  218. </td>
  219. </tr>
  220. <tr id="i7" class="rowColor">
  221. <td class="colFirst"><code><a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a></code></td>
  222. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONStringer.html#value-double-">value</a></span>(double&nbsp;value)</code>
  223. <div class="block">Encodes <code>value</code> to this stringer.</div>
  224. </td>
  225. </tr>
  226. <tr id="i8" class="altColor">
  227. <td class="colFirst"><code><a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a></code></td>
  228. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONStringer.html#value-long-">value</a></span>(long&nbsp;value)</code>
  229. <div class="block">Encodes <code>value</code> to this stringer.</div>
  230. </td>
  231. </tr>
  232. <tr id="i9" class="rowColor">
  233. <td class="colFirst"><code><a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a></code></td>
  234. <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONStringer.html#value-java.lang.Object-">value</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</code>
  235. <div class="block">Encodes <code>value</code>.</div>
  236. </td>
  237. </tr>
  238. </table>
  239. <ul class="blockList">
  240. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  241. <!-- -->
  242. </a>
  243. <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
  244. <code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
  245. </ul>
  246. </li>
  247. </ul>
  248. </li>
  249. </ul>
  250. </div>
  251. <div class="details">
  252. <ul class="blockList">
  253. <li class="blockList">
  254. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  255. <ul class="blockList">
  256. <li class="blockList"><a name="constructor.detail">
  257. <!-- -->
  258. </a>
  259. <h3>Constructor Detail</h3>
  260. <a name="JSONStringer--">
  261. <!-- -->
  262. </a>
  263. <ul class="blockListLast">
  264. <li class="blockList">
  265. <h4>JSONStringer</h4>
  266. <pre>public&nbsp;JSONStringer()</pre>
  267. </li>
  268. </ul>
  269. </li>
  270. </ul>
  271. <!-- ============ METHOD DETAIL ========== -->
  272. <ul class="blockList">
  273. <li class="blockList"><a name="method.detail">
  274. <!-- -->
  275. </a>
  276. <h3>Method Detail</h3>
  277. <a name="array--">
  278. <!-- -->
  279. </a>
  280. <ul class="blockList">
  281. <li class="blockList">
  282. <h4>array</h4>
  283. <pre>public&nbsp;<a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a>&nbsp;array()
  284. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  285. <div class="block">Begins encoding a new array. Each call to this method must be paired with
  286. a call to <a href="../twitter4j/JSONStringer.html#endArray--"><code>endArray()</code></a>.</div>
  287. <dl>
  288. <dt><span class="returnLabel">Returns:</span></dt>
  289. <dd>this stringer.</dd>
  290. <dt><span class="throwsLabel">Throws:</span></dt>
  291. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - On internal errors. Shouldn't happen.</dd>
  292. </dl>
  293. </li>
  294. </ul>
  295. <a name="endArray--">
  296. <!-- -->
  297. </a>
  298. <ul class="blockList">
  299. <li class="blockList">
  300. <h4>endArray</h4>
  301. <pre>public&nbsp;<a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a>&nbsp;endArray()
  302. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  303. <div class="block">Ends encoding the current array.</div>
  304. <dl>
  305. <dt><span class="returnLabel">Returns:</span></dt>
  306. <dd>this stringer.</dd>
  307. <dt><span class="throwsLabel">Throws:</span></dt>
  308. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - On internal errors. Shouldn't happen.</dd>
  309. </dl>
  310. </li>
  311. </ul>
  312. <a name="object--">
  313. <!-- -->
  314. </a>
  315. <ul class="blockList">
  316. <li class="blockList">
  317. <h4>object</h4>
  318. <pre>public&nbsp;<a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a>&nbsp;object()
  319. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  320. <div class="block">Begins encoding a new object. Each call to this method must be paired
  321. with a call to <a href="../twitter4j/JSONStringer.html#endObject--"><code>endObject()</code></a>.</div>
  322. <dl>
  323. <dt><span class="returnLabel">Returns:</span></dt>
  324. <dd>this stringer.</dd>
  325. <dt><span class="throwsLabel">Throws:</span></dt>
  326. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - On internal errors. Shouldn't happen.</dd>
  327. </dl>
  328. </li>
  329. </ul>
  330. <a name="endObject--">
  331. <!-- -->
  332. </a>
  333. <ul class="blockList">
  334. <li class="blockList">
  335. <h4>endObject</h4>
  336. <pre>public&nbsp;<a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a>&nbsp;endObject()
  337. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  338. <div class="block">Ends encoding the current object.</div>
  339. <dl>
  340. <dt><span class="returnLabel">Returns:</span></dt>
  341. <dd>this stringer.</dd>
  342. <dt><span class="throwsLabel">Throws:</span></dt>
  343. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - On internal errors. Shouldn't happen.</dd>
  344. </dl>
  345. </li>
  346. </ul>
  347. <a name="value-java.lang.Object-">
  348. <!-- -->
  349. </a>
  350. <ul class="blockList">
  351. <li class="blockList">
  352. <h4>value</h4>
  353. <pre>public&nbsp;<a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a>&nbsp;value(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)
  354. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  355. <div class="block">Encodes <code>value</code>.</div>
  356. <dl>
  357. <dt><span class="paramLabel">Parameters:</span></dt>
  358. <dd><code>value</code> - a <a href="../twitter4j/JSONObject.html" title="class in twitter4j"><code>JSONObject</code></a>, <a href="../twitter4j/JSONArray.html" title="class in twitter4j"><code>JSONArray</code></a>, String, Boolean,
  359. Integer, Long, Double or null. May not be <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isNaN--" title="class or interface in java.lang"><code>NaNs</code></a>
  360. or <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isInfinite--" title="class or interface in java.lang"><code>infinities</code></a>.</dd>
  361. <dt><span class="returnLabel">Returns:</span></dt>
  362. <dd>this stringer.</dd>
  363. <dt><span class="throwsLabel">Throws:</span></dt>
  364. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - On internal errors. Shouldn't happen.</dd>
  365. </dl>
  366. </li>
  367. </ul>
  368. <a name="value-boolean-">
  369. <!-- -->
  370. </a>
  371. <ul class="blockList">
  372. <li class="blockList">
  373. <h4>value</h4>
  374. <pre>public&nbsp;<a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a>&nbsp;value(boolean&nbsp;value)
  375. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  376. <div class="block">Encodes <code>value</code> to this stringer.</div>
  377. <dl>
  378. <dt><span class="paramLabel">Parameters:</span></dt>
  379. <dd><code>value</code> - The value to encode.</dd>
  380. <dt><span class="returnLabel">Returns:</span></dt>
  381. <dd>this stringer.</dd>
  382. <dt><span class="throwsLabel">Throws:</span></dt>
  383. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - On internal errors. Shouldn't happen.</dd>
  384. </dl>
  385. </li>
  386. </ul>
  387. <a name="value-double-">
  388. <!-- -->
  389. </a>
  390. <ul class="blockList">
  391. <li class="blockList">
  392. <h4>value</h4>
  393. <pre>public&nbsp;<a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a>&nbsp;value(double&nbsp;value)
  394. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  395. <div class="block">Encodes <code>value</code> to this stringer.</div>
  396. <dl>
  397. <dt><span class="paramLabel">Parameters:</span></dt>
  398. <dd><code>value</code> - a finite value. May not be <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isNaN--" title="class or interface in java.lang"><code>NaNs</code></a> or
  399. <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isInfinite--" title="class or interface in java.lang"><code>infinities</code></a>.</dd>
  400. <dt><span class="returnLabel">Returns:</span></dt>
  401. <dd>this stringer.</dd>
  402. <dt><span class="throwsLabel">Throws:</span></dt>
  403. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - On internal errors. Shouldn't happen.</dd>
  404. </dl>
  405. </li>
  406. </ul>
  407. <a name="value-long-">
  408. <!-- -->
  409. </a>
  410. <ul class="blockList">
  411. <li class="blockList">
  412. <h4>value</h4>
  413. <pre>public&nbsp;<a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a>&nbsp;value(long&nbsp;value)
  414. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  415. <div class="block">Encodes <code>value</code> to this stringer.</div>
  416. <dl>
  417. <dt><span class="paramLabel">Parameters:</span></dt>
  418. <dd><code>value</code> - The value to encode.</dd>
  419. <dt><span class="returnLabel">Returns:</span></dt>
  420. <dd>this stringer.</dd>
  421. <dt><span class="throwsLabel">Throws:</span></dt>
  422. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - If we have an internal error. Shouldn't happen.</dd>
  423. </dl>
  424. </li>
  425. </ul>
  426. <a name="key-java.lang.String-">
  427. <!-- -->
  428. </a>
  429. <ul class="blockList">
  430. <li class="blockList">
  431. <h4>key</h4>
  432. <pre>public&nbsp;<a href="../twitter4j/JSONStringer.html" title="class in twitter4j">JSONStringer</a>&nbsp;key(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)
  433. throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
  434. <div class="block">Encodes the key (property name) to this stringer.</div>
  435. <dl>
  436. <dt><span class="paramLabel">Parameters:</span></dt>
  437. <dd><code>name</code> - the name of the forthcoming value. May not be null.</dd>
  438. <dt><span class="returnLabel">Returns:</span></dt>
  439. <dd>this stringer.</dd>
  440. <dt><span class="throwsLabel">Throws:</span></dt>
  441. <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - on internal errors, shouldn't happen.</dd>
  442. </dl>
  443. </li>
  444. </ul>
  445. <a name="toString--">
  446. <!-- -->
  447. </a>
  448. <ul class="blockListLast">
  449. <li class="blockList">
  450. <h4>toString</h4>
  451. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
  452. <div class="block">Returns the encoded JSON string.
  453. <p>If invoked with unterminated arrays or unclosed objects, this method's
  454. return value is undefined.
  455. <p><strong>Warning:</strong> although it contradicts the general contract
  456. of <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang"><code>Object.toString()</code></a>, this method returns null if the stringer
  457. contains no data.</div>
  458. <dl>
  459. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  460. <dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
  461. </dl>
  462. </li>
  463. </ul>
  464. </li>
  465. </ul>
  466. </li>
  467. </ul>
  468. </div>
  469. </div>
  470. <!-- ========= END OF CLASS DATA ========= -->
  471. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  472. <div class="bottomNav"><a name="navbar.bottom">
  473. <!-- -->
  474. </a>
  475. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  476. <a name="navbar.bottom.firstrow">
  477. <!-- -->
  478. </a>
  479. <ul class="navList" title="Navigation">
  480. <li><a href="../overview-summary.html">Overview</a></li>
  481. <li><a href="package-summary.html">Package</a></li>
  482. <li class="navBarCell1Rev">Class</li>
  483. <li><a href="class-use/JSONStringer.html">Use</a></li>
  484. <li><a href="package-tree.html">Tree</a></li>
  485. <li><a href="../deprecated-list.html">Deprecated</a></li>
  486. <li><a href="../index-all.html">Index</a></li>
  487. <li><a href="../help-doc.html">Help</a></li>
  488. </ul>
  489. </div>
  490. <div class="subNav">
  491. <ul class="navList">
  492. <li><a href="../twitter4j/JSONObjectType.Type.html" title="enum in twitter4j"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  493. <li><a href="../twitter4j/JSONTokener.html" title="class in twitter4j"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  494. </ul>
  495. <ul class="navList">
  496. <li><a href="../index.html?twitter4j/JSONStringer.html" target="_top">Frames</a></li>
  497. <li><a href="JSONStringer.html" target="_top">No&nbsp;Frames</a></li>
  498. </ul>
  499. <ul class="navList" id="allclasses_navbar_bottom">
  500. <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
  501. </ul>
  502. <div>
  503. <script type="text/javascript"><!--
  504. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  505. if(window==top) {
  506. allClassesLink.style.display = "block";
  507. }
  508. else {
  509. allClassesLink.style.display = "none";
  510. }
  511. //-->
  512. </script>
  513. </div>
  514. <div>
  515. <ul class="subNavList">
  516. <li>Summary:&nbsp;</li>
  517. <li>Nested&nbsp;|&nbsp;</li>
  518. <li>Field&nbsp;|&nbsp;</li>
  519. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  520. <li><a href="#method.summary">Method</a></li>
  521. </ul>
  522. <ul class="subNavList">
  523. <li>Detail:&nbsp;</li>
  524. <li>Field&nbsp;|&nbsp;</li>
  525. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  526. <li><a href="#method.detail">Method</a></li>
  527. </ul>
  528. </div>
  529. <a name="skip.navbar.bottom">
  530. <!-- -->
  531. </a></div>
  532. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  533. <p class="legalCopy"><small>Copyright &#169; 2018. All rights reserved.</small></p>
  534. </body>
  535. </html>