aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/external/json/JSONString.java
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2011-11-24 15:27:47 +0200
committerLeif Åstrand <leif@vaadin.com>2011-11-24 15:27:47 +0200
commit181b76b3a041d061e0a8fff3fbfaf7f0e64da2da (patch)
tree308a59073a4631db565dd9031a745eb075a0a8db /src/com/vaadin/external/json/JSONString.java
parent744f3a68d3c85d6856475f7caa5abd968a8d2e9c (diff)
downloadvaadin-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.java21
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();
+}