public class JSONML
extends java.lang.Object
Constructor and Description |
---|
JSONML() |
Modifier and Type | Method and Description |
---|---|
static JSONArray |
toJSONArray(java.lang.String string)
Convert a well-formed (but not necessarily valid) XML string into a
JSONArray using the JsonML transform.
|
static JSONArray |
toJSONArray(java.lang.String string,
boolean keepStrings)
Convert a well-formed (but not necessarily valid) XML string into a
JSONArray using the JsonML transform.
|
static JSONArray |
toJSONArray(XMLTokener x)
Convert a well-formed (but not necessarily valid) XML string into a
JSONArray using the JsonML transform.
|
static JSONArray |
toJSONArray(XMLTokener x,
boolean keepStrings)
Convert a well-formed (but not necessarily valid) XML string into a
JSONArray using the JsonML transform.
|
static JSONObject |
toJSONObject(java.lang.String string)
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject using the JsonML transform.
|
static JSONObject |
toJSONObject(java.lang.String string,
boolean keepStrings)
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject using the JsonML transform.
|
static JSONObject |
toJSONObject(XMLTokener x)
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject using the JsonML transform.
|
static JSONObject |
toJSONObject(XMLTokener x,
boolean keepStrings)
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject using the JsonML transform.
|
static java.lang.String |
toString(JSONArray ja)
Reverse the JSONML transformation, making an XML text from a JSONArray.
|
static java.lang.String |
toString(JSONObject jo)
Reverse the JSONML transformation, making an XML text from a JSONObject.
|
public static JSONArray toJSONArray(java.lang.String string) throws JSONException
<[ [ ]]>
are ignored.string
- The source string.JSONException
- Thrown on error converting to a JSONArraypublic static JSONArray toJSONArray(java.lang.String string, boolean keepStrings) throws JSONException
<[ [ ]]>
are ignored.string
- The source string.keepStrings
- If true, then values will not be coerced into boolean
or numeric values and will instead be left as stringsJSONException
- Thrown on error converting to a JSONArraypublic static JSONArray toJSONArray(XMLTokener x, boolean keepStrings) throws JSONException
<[ [ ]]>
are ignored.x
- An XMLTokener.keepStrings
- If true, then values will not be coerced into boolean
or numeric values and will instead be left as stringsJSONException
- Thrown on error converting to a JSONArraypublic static JSONArray toJSONArray(XMLTokener x) throws JSONException
<[ [ ]]>
are ignored.x
- An XMLTokener.JSONException
- Thrown on error converting to a JSONArraypublic static JSONObject toJSONObject(java.lang.String string) throws JSONException
<[ [ ]]>
are ignored.string
- The XML source text.JSONException
- Thrown on error converting to a JSONObjectpublic static JSONObject toJSONObject(java.lang.String string, boolean keepStrings) throws JSONException
<[ [ ]]>
are ignored.string
- The XML source text.keepStrings
- If true, then values will not be coerced into boolean
or numeric values and will instead be left as stringsJSONException
- Thrown on error converting to a JSONObjectpublic static JSONObject toJSONObject(XMLTokener x) throws JSONException
<[ [ ]]>
are ignored.x
- An XMLTokener of the XML source text.JSONException
- Thrown on error converting to a JSONObjectpublic static JSONObject toJSONObject(XMLTokener x, boolean keepStrings) throws JSONException
<[ [ ]]>
are ignored.x
- An XMLTokener of the XML source text.keepStrings
- If true, then values will not be coerced into boolean
or numeric values and will instead be left as stringsJSONException
- Thrown on error converting to a JSONObjectpublic static java.lang.String toString(JSONArray ja) throws JSONException
ja
- A JSONArray.JSONException
- Thrown on error converting to a stringpublic static java.lang.String toString(JSONObject jo) throws JSONException
jo
- A JSONObject.JSONException
- Thrown on error converting to a stringCopyright © 2007 Hyfinity Ltd. All Rights Reserved.