Reinstate JSON license notices in datarouter
[dmaap/datarouter.git] / datarouter-prov / src / main / java / org / json / JSONWriter.java
index ebb5ce0..a9b0bab 100644 (file)
@@ -25,8 +25,59 @@ package org.json;
 import java.io.IOException;\r
 import java.io.Writer;\r
 \r
+/*\r
+Copyright (c) 2006 JSON.org\r
 \r
+Permission is hereby granted, free of charge, to any person obtaining a copy\r
+of this software and associated documentation files (the "Software"), to deal\r
+in the Software without restriction, including without limitation the rights\r
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+copies of the Software, and to permit persons to whom the Software is\r
+furnished to do so, subject to the following conditions:\r
 \r
+The above copyright notice and this permission notice shall be included in all\r
+copies or substantial portions of the Software.\r
+\r
+The Software shall be used for Good, not Evil.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+SOFTWARE.\r
+*/\r
+\r
+/**\r
+ * JSONWriter provides a quick and convenient way of producing JSON text.\r
+ * The texts produced strictly conform to JSON syntax rules. No whitespace is\r
+ * added, so the results are ready for transmission or storage. Each instance of\r
+ * JSONWriter can produce one JSON text.\r
+ * <p>\r
+ * A JSONWriter instance provides a <code>value</code> method for appending\r
+ * values to the\r
+ * text, and a <code>key</code>\r
+ * method for adding keys before values in objects. There are <code>array</code>\r
+ * and <code>endArray</code> methods that make and bound array values, and\r
+ * <code>object</code> and <code>endObject</code> methods which make and bound\r
+ * object values. All of these methods return the JSONWriter instance,\r
+ * permitting a cascade style. For example, <pre>\r
+ * new JSONWriter(myWriter)\r
+ *     .object()\r
+ *         .key("JSON")\r
+ *         .value("Hello, World!")\r
+ *     .endObject();</pre> which writes <pre>\r
+ * {"JSON":"Hello, World!"}</pre>\r
+ * <p>\r
+ * The first method called must be <code>array</code> or <code>object</code>.\r
+ * There are no methods for adding commas or colons. JSONWriter adds them for\r
+ * you. Objects and arrays can be nested up to 20 levels deep.\r
+ * <p>\r
+ * This can sometimes be easier than using a JSONObject to build a string.\r
+ * @author JSON.org\r
+ * @version 2011-11-24\r
+ */\r
 public class JSONWriter {\r
     private static final int maxdepth = 200;\r
 \r