mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-07 03:06:03 +08:00
added JSONObject#query() and JSONPointer#query() methods
This commit is contained in:
@@ -32,8 +32,15 @@ import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* A JSONObject is an unordered collection of name/value pairs. Its external
|
||||
@@ -1330,6 +1337,10 @@ public class JSONObject {
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object query(String jsonPointer) {
|
||||
return new JSONPointer(jsonPointer).queryFrom(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce a string in double quotes with backslash sequences in all the
|
||||
|
Reference in New Issue
Block a user