public class JSONML extends Object
Constructor and Description |
---|
JSONML() |
Modifier and Type | Method and Description |
---|---|
static JSONArray |
toJSONArray(String string)
Convert a well-formed (but not necessarily valid) XML string into a
JSONArray using the JsonML transform.
|
static JSONArray |
toJSONArray(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(String string)
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject using the JsonML transform.
|
static JSONObject |
toJSONObject(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 String |
toString(JSONArray ja)
Reverse the JSONML transformation, making an XML text from a JSONArray.
|
static String |
toString(JSONObject jo)
Reverse the JSONML transformation, making an XML text from a JSONObject.
|
public static JSONArray toJSONArray(String string) throws JSONException
<[ [ ]]>
are ignored.string
- The source string.JSONException
- Thrown on error converting to a JSONArraypublic static JSONArray toJSONArray(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(String string) throws JSONException
<[ [ ]]>
are ignored.string
- The XML source text.JSONException
- Thrown on error converting to a JSONObjectpublic static JSONObject toJSONObject(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 String toString(JSONArray ja) throws JSONException
ja
- A JSONArray.JSONException
- Thrown on error converting to a stringpublic static String toString(JSONObject jo) throws JSONException
jo
- A JSONObject.JSONException
- Thrown on error converting to a string