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

@ -78,7 +78,7 @@ import java.util.Map;
* </ul>
*
* @author JSON.org
* @version 2016-03-05
* @version 2016-05-13
*/
public class JSONArray implements Iterable<Object> {
@ -960,6 +960,25 @@ public class JSONArray implements Iterable<Object> {
return this;
}
/**
* Creates a JSONPointer using an intialization string and tries to
* match it to an item within this JSONArray. For example, given a
* JSONArray initialized with this document:
* <pre>
* [
* {"b":"c"}
* ]
* </pre>
* and this JSONPointer string:
* <pre>
* "/0/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);
}