mirror of
https://github.com/stleary/JSON-java.git
synced 2026-01-24 00:03:17 -05:00
Merge pull request #1017 from Md-Yasir/enhancement/refactors
Code Refactors
This commit is contained in:
@@ -27,7 +27,9 @@ public class CDL {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new CDL object.
|
* Constructs a new CDL object.
|
||||||
|
* @deprecated (Utility class cannot be instantiated)
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public CDL() {
|
public CDL() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ public class Cookie {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new Cookie object.
|
* Constructs a new Cookie object.
|
||||||
|
* @deprecated (Utility class cannot be instantiated)
|
||||||
*/
|
*/
|
||||||
|
@Deprecated()
|
||||||
public Cookie() {
|
public Cookie() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ public class CookieList {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new CookieList object.
|
* Constructs a new CookieList object.
|
||||||
|
* @deprecated (Utility class cannot be instantiated)
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public CookieList() {
|
public CookieList() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,10 +16,13 @@ public class JSONML {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new JSONML object.
|
* Constructs a new JSONML object.
|
||||||
|
* @deprecated (Utility class cannot be instantiated)
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public JSONML() {
|
public JSONML() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse XML values and store them in a JSONArray.
|
* Parse XML values and store them in a JSONArray.
|
||||||
* @param x The XMLTokener containing the source string.
|
* @param x The XMLTokener containing the source string.
|
||||||
@@ -239,9 +242,21 @@ public class JSONML {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ja != null) {
|
if (ja != null) {
|
||||||
ja.put(token instanceof String
|
Object value;
|
||||||
? (config.isKeepStrings() ? XML.unescape((String)token) : XML.stringToValue((String)token))
|
|
||||||
: token);
|
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