001/* 002Below is the copyright agreement for the Ptolemy II system. 003 004Copyright (c) 2010-2011 The Regents of the University of California. 005All rights reserved. 006 007Permission is hereby granted, without written agreement and without 008license or royalty fees, to use, copy, modify, and distribute this 009software and its documentation for any purpose, provided that the above 010copyright notice and the following two paragraphs appear in all copies 011of this software. 012 013IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 014FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 015ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 016THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 017SUCH DAMAGE. 018 019THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 020INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 021MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 022PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 023CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 024ENHANCEMENTS, OR MODIFICATIONS. 025 026Ptolemy II includes the work of others, to see those copyrights, follow 027the copyright link on the splash page or see copyright.htm. 028 */ 029package org.json; 030 031/** 032 * The <code>JSONString</code> interface allows a <code>toJSONString()</code> 033 * method so that a class can change the behavior of 034 * <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>, 035 * and <code>JSONWriter.value(</code>Object<code>)</code>. The 036 * <code>toJSONString</code> method will be used instead of the default behavior 037 * of using the Object's <code>toString()</code> method and quoting the result. 038 */ 039public interface JSONString { 040 /** 041 * The <code>toJSONString</code> method allows a class to produce its own JSON 042 * serialization. 043 * 044 * @return A strictly syntactically correct JSON text. 045 */ 046 public String toJSONString(); 047}