mirror of
https://github.com/stleary/JSON-java.git
synced 2026-01-24 00:03:17 -05:00
refactor: rename XMLtoJSONMLParserConfiguration to JSONMLParserConfiguration
This commit is contained in:
@@ -31,7 +31,7 @@ public class JSONML {
|
||||
int currentNestingDepth
|
||||
) throws JSONException {
|
||||
return parse(x,arrayForm, ja,
|
||||
keepStrings ? XMLtoJSONMLParserConfiguration.KEEP_STRINGS : XMLtoJSONMLParserConfiguration.ORIGINAL,
|
||||
keepStrings ? JSONMLParserConfiguration.KEEP_STRINGS : JSONMLParserConfiguration.ORIGINAL,
|
||||
currentNestingDepth);
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ public class JSONML {
|
||||
* @param arrayForm true if array form, false if object form.
|
||||
* @param ja The JSONArray that is containing the current tag or null
|
||||
* if we are at the outermost level.
|
||||
* @param config The XML parser configuration:
|
||||
* XMLtoJSONMLParserConfiguration.ORIGINAL is the default behaviour;
|
||||
* XMLtoJSONMLParserConfiguration.KEEP_STRINGS means Don't type-convert text nodes and attribute values.
|
||||
* @param config The parser configuration:
|
||||
* JSONMLParserConfiguration.ORIGINAL is the default behaviour;
|
||||
* JSONMLParserConfiguration.KEEP_STRINGS means Don't type-convert text nodes and attribute values.
|
||||
* @return A JSONArray if the value is the outermost tag, otherwise null.
|
||||
* @throws JSONException if a parsing error occurs
|
||||
*/
|
||||
@@ -51,7 +51,7 @@ public class JSONML {
|
||||
XMLTokener x,
|
||||
boolean arrayForm,
|
||||
JSONArray ja,
|
||||
XMLtoJSONMLParserConfiguration config,
|
||||
JSONMLParserConfiguration config,
|
||||
int currentNestingDepth
|
||||
) throws JSONException {
|
||||
String attribute;
|
||||
@@ -254,7 +254,7 @@ public class JSONML {
|
||||
* @throws JSONException Thrown on error converting to a JSONArray
|
||||
*/
|
||||
public static JSONArray toJSONArray(String string) throws JSONException {
|
||||
return (JSONArray)parse(new XMLTokener(string), true, null, XMLtoJSONMLParserConfiguration.ORIGINAL, 0);
|
||||
return (JSONArray)parse(new XMLTokener(string), true, null, JSONMLParserConfiguration.ORIGINAL, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -293,14 +293,14 @@ public class JSONML {
|
||||
* but just leaves it as a string.
|
||||
* Comments, prologs, DTDs, and <pre>{@code <[ [ ]]>}</pre> are ignored.
|
||||
* @param string The source string.
|
||||
* @param config The XML parser configuration:
|
||||
* XMLtoJSONMLParserConfiguration.ORIGINAL is the default behaviour;
|
||||
* XMLtoJSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean
|
||||
* @param config The parser configuration:
|
||||
* JSONMLParserConfiguration.ORIGINAL is the default behaviour;
|
||||
* JSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean
|
||||
* or numeric values and will instead be left as strings
|
||||
* @return A JSONArray containing the structured data from the XML string.
|
||||
* @throws JSONException Thrown on error converting to a JSONArray
|
||||
*/
|
||||
public static JSONArray toJSONArray(String string, XMLtoJSONMLParserConfiguration config) throws JSONException {
|
||||
public static JSONArray toJSONArray(String string, JSONMLParserConfiguration config) throws JSONException {
|
||||
return (JSONArray)parse(new XMLTokener(string), true, null, config, 0);
|
||||
}
|
||||
|
||||
@@ -317,14 +317,14 @@ public class JSONML {
|
||||
* but just leaves it as a string.
|
||||
* Comments, prologs, DTDs, and <pre>{@code <[ [ ]]>}</pre> are ignored.
|
||||
* @param x An XMLTokener.
|
||||
* @param config The XML parser configuration:
|
||||
* XMLtoJSONMLParserConfiguration.ORIGINAL is the default behaviour;
|
||||
* XMLtoJSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean
|
||||
* @param config The parser configuration:
|
||||
* JSONMLParserConfiguration.ORIGINAL is the default behaviour;
|
||||
* JSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean
|
||||
* or numeric values and will instead be left as strings
|
||||
* @return A JSONArray containing the structured data from the XML string.
|
||||
* @throws JSONException Thrown on error converting to a JSONArray
|
||||
*/
|
||||
public static JSONArray toJSONArray(XMLTokener x, XMLtoJSONMLParserConfiguration config) throws JSONException {
|
||||
public static JSONArray toJSONArray(XMLTokener x, JSONMLParserConfiguration config) throws JSONException {
|
||||
return (JSONArray)parse(x, true, null, config, 0);
|
||||
}
|
||||
|
||||
@@ -416,14 +416,14 @@ public class JSONML {
|
||||
|
||||
* Comments, prologs, DTDs, and <pre>{@code <[ [ ]]>}</pre> are ignored.
|
||||
* @param string The XML source text.
|
||||
* @param config The XML parser configuration:
|
||||
* XMLtoJSONMLParserConfiguration.ORIGINAL is the default behaviour;
|
||||
* XMLtoJSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean
|
||||
* @param config The parser configuration:
|
||||
* JSONMLParserConfiguration.ORIGINAL is the default behaviour;
|
||||
* JSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean
|
||||
* or numeric values and will instead be left as strings
|
||||
* @return A JSONObject containing the structured data from the XML string.
|
||||
* @throws JSONException Thrown on error converting to a JSONObject
|
||||
*/
|
||||
public static JSONObject toJSONObject(String string, XMLtoJSONMLParserConfiguration config) throws JSONException {
|
||||
public static JSONObject toJSONObject(String string, JSONMLParserConfiguration config) throws JSONException {
|
||||
return (JSONObject)parse(new XMLTokener(string), false, null, config, 0);
|
||||
}
|
||||
|
||||
@@ -476,14 +476,14 @@ public class JSONML {
|
||||
|
||||
* Comments, prologs, DTDs, and <pre>{@code <[ [ ]]>}</pre> are ignored.
|
||||
* @param x An XMLTokener of the XML source text.
|
||||
* @param config The XML parser configuration:
|
||||
* XMLtoJSONMLParserConfiguration.ORIGINAL is the default behaviour;
|
||||
* XMLtoJSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean
|
||||
* @param config The parser configuration:
|
||||
* JSONMLParserConfiguration.ORIGINAL is the default behaviour;
|
||||
* JSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean
|
||||
* or numeric values and will instead be left as strings
|
||||
* @return A JSONObject containing the structured data from the XML string.
|
||||
* @throws JSONException Thrown on error converting to a JSONObject
|
||||
*/
|
||||
public static JSONObject toJSONObject(XMLTokener x, XMLtoJSONMLParserConfiguration config) throws JSONException {
|
||||
public static JSONObject toJSONObject(XMLTokener x, JSONMLParserConfiguration config) throws JSONException {
|
||||
return (JSONObject)parse(x, false, null, config, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user