1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

add timestamps to recent commits, javadocs for JSONObject, JSONArray queryFrom() methods

This commit is contained in:
stleary 2016-05-14 09:22:18 -05:00
parent 8a72509e6e
commit 4a458a9f1c
4 changed files with 48 additions and 4 deletions

View file

@ -93,7 +93,7 @@ import java.util.Set;
* </ul>
*
* @author JSON.org
* @version 2016-05-01
* @version 2016-05-13
*/
public class JSONObject {
/**
@ -1337,7 +1337,26 @@ public class JSONObject {
}
return this;
}
/**
* Creates a JSONPointer using an intialization string and tries to
* match it to an item within this JSONObject. For example, given a
* JSONObject initialized with this document:
* <pre>
* {
* "a":{"b":"c"}
* }
* </pre>
* and this JSONPointer string:
* <pre>
* "/a/b"
* </pre>
* Then this method will return the String "c".
* A JSONPointerException may be thrown from code called by this method.
*
* @param jsonPointer string that can be used to create a JSONPointer
* @return the item matched by the JSONPointer, otherwise null
*/
public Object query(String jsonPointer) {
return new JSONPointer(jsonPointer).queryFrom(this);
}