Package org.json.simple
Interface Jsonable
-
- All Known Implementing Classes:
JsonArray,JsonObject
public interface Jsonable
Jsonables can be serialized in java script object notation (JSON). Deserializing a String produced by a Jsonable should represent the Jsonable in JSON form.- Since:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringtoJson()Serialize to a JSON formatted string.voidtoJson(java.io.Writer writable)Serialize to a JSON formatted stream.
-
-
-
Method Detail
-
toJson
java.lang.String toJson()
Serialize to a JSON formatted string.- Returns:
- a string, formatted in JSON, that represents the Jsonable.
-
toJson
void toJson(java.io.Writer writable) throws java.io.IOException
Serialize to a JSON formatted stream.- Parameters:
writable- where the resulting JSON text should be sent.- Throws:
java.io.IOException- when the writable encounters an I/O error.
-
-