Package org.cakelab.json.format
Interface JSONFormatter
-
- All Known Implementing Classes:
JSONFormatterBase
,JSONFormatterCompact
,JSONFormatterPrettyprint
public interface JSONFormatter
JSONFormatter creates and formats JSON strings from JSON objects. The implementing string formatter can format the string output such as to add indenting.- Author:
- homac
- See Also:
JSONFormatterPrettyprint
,Multi-Threading Formatters are supposed to be thread-safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
format(java.io.OutputStream out, java.lang.Object jsonValue)
void
format(java.io.OutputStream out, JSONArray jsonArray)
void
format(java.io.OutputStream out, JSONCompoundType jsonCompound)
void
format(java.io.OutputStream out, JSONObject jsonObject)
java.lang.String
format(java.lang.Object jsonValue)
java.lang.String
format(JSONArray jsonArray)
java.lang.String
format(JSONCompoundType jsonCompound)
java.lang.String
format(JSONObject jsonObject)
JSONFormatterConfiguration
getConfiguration()
-
-
-
Method Detail
-
getConfiguration
JSONFormatterConfiguration getConfiguration()
-
format
java.lang.String format(JSONObject jsonObject) throws JSONException
- Throws:
JSONException
-
format
java.lang.String format(JSONArray jsonArray) throws JSONException
- Throws:
JSONException
-
format
java.lang.String format(JSONCompoundType jsonCompound) throws JSONException
- Throws:
JSONException
-
format
java.lang.String format(java.lang.Object jsonValue) throws JSONException
- Throws:
JSONException
-
format
void format(java.io.OutputStream out, JSONObject jsonObject) throws JSONException
- Throws:
JSONException
-
format
void format(java.io.OutputStream out, JSONArray jsonArray) throws JSONException
- Throws:
JSONException
-
format
void format(java.io.OutputStream out, JSONCompoundType jsonCompound) throws JSONException
- Throws:
JSONException
-
format
void format(java.io.OutputStream out, java.lang.Object jsonValue) throws JSONException
- Throws:
JSONException
-
-