View Javadoc

1   /*
2    * $Id: JSONString.java,v 1.1 2007/10/22 16:23:08 oeuillot Exp $
3    */
4   package org.rcfaces.core.internal.util.json;
5   
6   /**
7    * The <code>JSONString</code> interface allows a <code>toJSONString()</code>
8    * method so that a class can change the behavior of
9    * <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>,
10   * and <code>JSONWriter.value(</code>Object<code>)</code>. The
11   * <code>toJSONString</code> method will be used instead of the default
12   * behavior of using the Object's <code>toString()</code> method and quoting
13   * the result.
14   */
15  public interface JSONString {
16      /**
17       * The <code>toJSONString</code> method allows a class to produce its own
18       * JSON serialization.
19       * 
20       * @return A strictly syntactically correct JSON text.
21       */
22      String toJSONString();
23  }