Interface JSONObjects
public interface JSONObjects
API for creating in memory JSON Object representations, and for serializing
in memory Object Graphs to JSON representations.
- Author:
- cdivilly
-
Method Summary
Modifier and TypeMethodDescriptionarray()Create a newJSONArray.Builderinstanceobject()Create a newJSONObject.Builderinstanceread(InputStream stream) Parse a byte stream into aJSONObjectorJSONArrayinstanceParse a character stream into aJSONObjectorJSONArrayinstanceread(CharSequence text) Parse a character stream into aJSONObjectorJSONArrayinstanceParse a JSONToken stream into aJSONObjectorJSONArrayinstancevoidwrite(OutputStream stream, Object objectGraph) Serialize any Java Object graph to it's textual representation.voidwrite(OutputStream stream, JSONNode node) Serialize a JSON Object graph to it's textual representationvoidwrite(Appendable stream, Object objectGraph) Serialize any Java Object graph to it's textual representation.voidwrite(Appendable stream, JSONNode node) Serialize a JSON Object graph to it's textual representationvoidwrite(JSONWriter stream, Object objectGraph) Serialize any Java Object graph to aJSONWriterstream.voidwrite(JSONWriter stream, JSONNode node) Serialize a JSON Object graph to aJSONWriterstream
-
Method Details
-
array
JSONArray.Builder array()Create a newJSONArray.Builderinstance- Returns:
JSONArray.Builderinstance
-
object
JSONObject.Builder object()Create a newJSONObject.Builderinstance- Returns:
JSONObject.Builderinstance
-
read
Parse a character stream into aJSONObjectorJSONArrayinstance- Parameters:
text- The JSON textual representation to be parsed- Returns:
JSONObjectorJSONArrayinstance
-
read
Parse a byte stream into aJSONObjectorJSONArrayinstance- Parameters:
stream- The JSON textual representation to be parsed- Returns:
JSONObjectorJSONArrayinstance- Throws:
JSONIOException- if anIOExceptionoccurs reading from the stream
-
read
Parse a JSONToken stream into aJSONObjectorJSONArrayinstance- Parameters:
stream- TheJSONTokenstream to be parsed- Returns:
JSONObjectorJSONArrayinstance- Throws:
JSONIOException- if anIOExceptionoccurs reading from the stream
-
read
Parse a character stream into aJSONObjectorJSONArrayinstance- Parameters:
stream- The JSON textual representation to be parsed- Returns:
JSONObjectorJSONArrayinstance if anIOExceptionoccurs reading from the stream- Throws:
JSONIOException
-
write
Serialize a JSON Object graph to it's textual representation- Parameters:
stream- The character stream to serialize tonode- TheJSONObjectorJSONNodeat the root of the object graph- Throws:
JSONIOException- if an IO error occurs
-
write
Serialize any Java Object graph to it's textual representation.
- Parameters:
stream- The character stream to serialize toobjectGraph- The root node in the object graph- Throws:
JSONIOException- if an IO error occurs- See Also:
-
write
Serialize a JSON Object graph to aJSONWriterstream- Parameters:
stream- TheJSONWriterstream to serialize tonode- TheJSONObjectorJSONNodeat the root of the object graph- Throws:
JSONIOException- if an IO error occurs
-
write
Serialize any Java Object graph to a
JSONWriterstream.- Parameters:
stream- TheJSONWriterstream to serialize toobjectGraph- The root node in the object graph- Throws:
JSONIOException- if an IO error occurs- See Also:
-
write
Serialize a JSON Object graph to it's textual representation- Parameters:
stream- The byte stream to serialize tonode- TheJSONObjectorJSONNodeat the root of the object graph- Throws:
JSONIOException- if an IO error occurs
-
write
Serialize any Java Object graph to it's textual representation.
- Parameters:
stream- The byte stream to serialize toobjectGraph- The root node in the object graph- Throws:
JSONIOException- if an IO error occurs- See Also:
-