mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-08 11:34:43 +08:00
Merge branch 'stleary:master' into master
This commit is contained in:
@@ -139,6 +139,11 @@ public class JSONObject {
|
||||
*/
|
||||
private final Map<String, Object> map;
|
||||
|
||||
/**
|
||||
* Retrieves the type of the underlying Map in this class.
|
||||
*
|
||||
* @return The class object representing the type of the underlying Map.
|
||||
*/
|
||||
public Class<? extends Map> getMapType() {
|
||||
return map.getClass();
|
||||
}
|
||||
@@ -375,7 +380,6 @@ public class JSONObject {
|
||||
* @JSONPropertyIgnore
|
||||
* public String getName() { return this.name; }
|
||||
* </pre>
|
||||
* <p>
|
||||
*
|
||||
* @param bean
|
||||
* An object that has getter methods that should be used to make
|
||||
@@ -2256,6 +2260,14 @@ public class JSONObject {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Quotes a string and appends the result to a given Writer.
|
||||
*
|
||||
* @param string The input string to be quoted.
|
||||
* @param w The Writer to which the quoted string will be appended.
|
||||
* @return The same Writer instance after appending the quoted string.
|
||||
* @throws IOException If an I/O error occurs while writing to the Writer.
|
||||
*/
|
||||
public static Writer quote(String string, Writer w) throws IOException {
|
||||
if (string == null || string.isEmpty()) {
|
||||
w.write("\"\"");
|
||||
|
Reference in New Issue
Block a user