mirror of
https://github.com/stleary/JSON-java.git
synced 2026-01-24 00:03:17 -05:00
Made JSONMl constructor to private and refactored ternary operations to independent statement in L243
This commit is contained in:
@@ -17,9 +17,10 @@ public class JSONML {
|
||||
/**
|
||||
* Constructs a new JSONML object.
|
||||
*/
|
||||
public JSONML() {
|
||||
private JSONML() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse XML values and store them in a JSONArray.
|
||||
* @param x The XMLTokener containing the source string.
|
||||
@@ -239,9 +240,21 @@ public class JSONML {
|
||||
}
|
||||
} else {
|
||||
if (ja != null) {
|
||||
ja.put(token instanceof String
|
||||
? (config.isKeepStrings() ? XML.unescape((String)token) : XML.stringToValue((String)token))
|
||||
: token);
|
||||
Object value;
|
||||
|
||||
if (token instanceof String) {
|
||||
String strToken = (String) token;
|
||||
if (config.isKeepStrings()) {
|
||||
value = XML.unescape(strToken);
|
||||
} else {
|
||||
value = XML.stringToValue(strToken);
|
||||
}
|
||||
} else {
|
||||
value = token;
|
||||
}
|
||||
|
||||
ja.put(value);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user