diff options
author | Leif Åstrand <leif@vaadin.com> | 2011-11-24 15:27:47 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2011-11-24 15:27:47 +0200 |
commit | 181b76b3a041d061e0a8fff3fbfaf7f0e64da2da (patch) | |
tree | 308a59073a4631db565dd9031a745eb075a0a8db /src/com/vaadin/external/json/JSONString.java | |
parent | 744f3a68d3c85d6856475f7caa5abd968a8d2e9c (diff) | |
download | vaadin-framework-181b76b3a041d061e0a8fff3fbfaf7f0e64da2da.tar.gz vaadin-framework-181b76b3a041d061e0a8fff3fbfaf7f0e64da2da.zip |
Add JSON helper library
Diffstat (limited to 'src/com/vaadin/external/json/JSONString.java')
-rw-r--r-- | src/com/vaadin/external/json/JSONString.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/vaadin/external/json/JSONString.java b/src/com/vaadin/external/json/JSONString.java new file mode 100644 index 0000000000..7b574d1915 --- /dev/null +++ b/src/com/vaadin/external/json/JSONString.java @@ -0,0 +1,21 @@ +package com.vaadin.external.json;
+
+import java.io.Serializable;
+
+/**
+ * The <code>JSONString</code> interface allows a <code>toJSONString()</code>
+ * method so that a class can change the behavior of
+ * <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>, and
+ * <code>JSONWriter.value(</code>Object<code>)</code>. The
+ * <code>toJSONString</code> method will be used instead of the default behavior
+ * of using the Object's <code>toString()</code> method and quoting the result.
+ */
+public interface JSONString extends Serializable {
+ /**
+ * The <code>toJSONString</code> method allows a class to produce its own
+ * JSON serialization.
+ *
+ * @return A strictly syntactically correct JSON text.
+ */
+ public String toJSONString();
+}
|