mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 11:25:30 -04:00
Merge branch 'master' of github.com:stleary/JSON-java into NumberOutputFix
# Conflicts: # JSONObject.java
This commit is contained in:
commit
88f65c5bea
@ -1721,6 +1721,9 @@ public class JSONObject {
|
||||
if (value.getClass().isArray()) {
|
||||
return new JSONArray(value).toString();
|
||||
}
|
||||
if(value instanceof Enum<?>){
|
||||
return quote(((Enum<?>)value).name());
|
||||
}
|
||||
return quote(value.toString());
|
||||
}
|
||||
|
||||
@ -1748,7 +1751,7 @@ public class JSONObject {
|
||||
|| object instanceof Long || object instanceof Boolean
|
||||
|| object instanceof Float || object instanceof Double
|
||||
|| object instanceof String || object instanceof BigInteger
|
||||
|| object instanceof BigDecimal) {
|
||||
|| object instanceof BigDecimal || object instanceof Enum) {
|
||||
return object;
|
||||
}
|
||||
|
||||
@ -1818,6 +1821,8 @@ public class JSONObject {
|
||||
}
|
||||
} else if (value instanceof Boolean) {
|
||||
writer.write(value.toString());
|
||||
} else if (value instanceof Enum<?>) {
|
||||
writer.write(quote(((Enum<?>)value).name()));
|
||||
} else if (value instanceof JSONObject) {
|
||||
((JSONObject) value).write(writer, indentFactor, indent);
|
||||
} else if (value instanceof JSONArray) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user