|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.json.java.JSON
Helper class that does generic parsing of a JSON stream and returns the appropriate JSON structure (JSONArray or JSONObject). Note that it is slightly more efficient to directly parse with the appropriate object than to use this class to do a generalized parse.
Constructor Summary | |
---|---|
JSON()
|
Method Summary | |
---|---|
static JSONArtifact |
parse(java.io.InputStream is)
Parse an InputStream of JSON text into a JSONArtifact. |
static JSONArtifact |
parse(java.io.InputStream is,
boolean order)
Parse a InputStream of JSON text into a JSONArtifact. |
static JSONArtifact |
parse(java.io.Reader reader)
Parse a Reader of JSON text into a JSONArtifact. |
static JSONArtifact |
parse(java.io.Reader reader,
boolean order)
Parse a Reader of JSON text into a JSONArtifact. |
static JSONArtifact |
parse(java.lang.String str)
Parse a string of JSON text into a JSONArtifact. |
static JSONArtifact |
parse(java.lang.String str,
boolean order)
Parse a string of JSON text into a JSONArtifact. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JSON()
Method Detail |
public static JSONArtifact parse(java.io.Reader reader, boolean order) throws java.io.IOException, java.lang.NullPointerException
reader
- The character reader to read the JSON data from.order
- Boolean flag indicating if the order of the JSON data should be preserved. This parameter only has an effect if the stream is JSON Object { ... } formatted data.
Note that the provided reader is not closed on completion of read; that is left to the caller.
java.io.IOException
- Thrown on IO errors during parse.
java.lang.NullPointerException
- Thrown if reader is nullpublic static JSONArtifact parse(java.io.Reader reader) throws java.io.IOException, java.lang.NullPointerException
reader
- The character reader to read the JSON data from.
java.io.IOException
- Thrown on IO errors during parse.
java.lang.NullPointerException
- Thrown if reader is nullpublic static JSONArtifact parse(java.io.InputStream is, boolean order) throws java.io.IOException, java.lang.NullPointerException
is
- The input stream to read from. The content is assumed to be UTF-8 encoded and handled as such.order
- Boolean flag indicating if the order of the JSON data should be preserved. This parameter only has an effect if the stream is JSON Object { ... } formatted data.
java.io.IOException
- Thrown on IO errors during parse.
java.lang.NullPointerException
- Thrown if reader is nullpublic static JSONArtifact parse(java.io.InputStream is) throws java.io.IOException, java.lang.NullPointerException
is
- The input stream to read from. The content is assumed to be UTF-8 encoded and handled as such.
java.io.IOException
- Thrown on IO errors during parse.
java.lang.NullPointerException
- Thrown if reader is nullpublic static JSONArtifact parse(java.lang.String str, boolean order) throws java.io.IOException, java.lang.NullPointerException
str
- The String to read from.order
- Boolean flag indicating if the order of the JSON data should be preserved. This parameter only has an effect if the stream is JSON Object { ... } formatted data.
java.io.IOException
- Thrown on IO errors during parse.
java.lang.NullPointerException
- Thrown if str is nullpublic static JSONArtifact parse(java.lang.String str) throws java.io.IOException, java.lang.NullPointerException
str
- The String to read from.
java.io.IOException
- Thrown on IO errors during parse.
java.lang.NullPointerException
- Thrown if str is null
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |