2010-01-29 22:13:57 +00:00
|
|
|
package org.json;
|
|
|
|
/**
|
2016-06-23 20:08:14 +01:00
|
|
|
* The {@code JSONString} interface allows a {@code toJSONString()}
|
2010-01-29 22:13:57 +00:00
|
|
|
* method so that a class can change the behavior of
|
2016-06-23 20:08:14 +01:00
|
|
|
* {@code JSONObject.toString()}, {@code JSONArray.toString()},
|
|
|
|
* and {@code JSONWriter.value(}Object{@code )}. The
|
|
|
|
* {@code toJSONString} method will be used instead of the default behavior
|
|
|
|
* of using the Object's {@code toString()} method and quoting the result.
|
2010-01-29 22:13:57 +00:00
|
|
|
*/
|
|
|
|
public interface JSONString {
|
|
|
|
/**
|
2016-06-23 20:08:14 +01:00
|
|
|
* The {@code toJSONString} method allows a class to produce its own JSON
|
2010-01-29 22:13:57 +00:00
|
|
|
* serialization.
|
|
|
|
*
|
|
|
|
* @return A strictly syntactically correct JSON text.
|
|
|
|
*/
|
|
|
|
public String toJSONString();
|
|
|
|
}
|