root / src / org / json / JSONString.java @ 4bf05cad
History | View | Annotate | Download (694 Bytes)
1 | 14ad7326 | pastith | package org.json; |
---|---|---|---|
2 | 14ad7326 | pastith | /**
|
3 | 14ad7326 | pastith | * The <code>JSONString</code> interface allows a <code>toJSONString()</code>
|
4 | 14ad7326 | pastith | * method so that a class can change the behavior of
|
5 | 14ad7326 | pastith | * <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>,
|
6 | 14ad7326 | pastith | * and <code>JSONWriter.value(</code>Object<code>)</code>. The
|
7 | 14ad7326 | pastith | * <code>toJSONString</code> method will be used instead of the default behavior
|
8 | 14ad7326 | pastith | * of using the Object's <code>toString()</code> method and quoting the result.
|
9 | 14ad7326 | pastith | */
|
10 | 14ad7326 | pastith | public interface JSONString { |
11 | 14ad7326 | pastith | /**
|
12 | 14ad7326 | pastith | * The <code>toJSONString</code> method allows a class to produce its own JSON
|
13 | 14ad7326 | pastith | * serialization.
|
14 | 14ad7326 | pastith | *
|
15 | 14ad7326 | pastith | * @return A strictly syntactically correct JSON text.
|
16 | 14ad7326 | pastith | */
|
17 | 14ad7326 | pastith | public String toJSONString(); |
18 | 14ad7326 | pastith | } |