1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-16 23:40:51 -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);
}

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);
}

View file

@ -35,7 +35,10 @@ SOFTWARE.
/**
* A JSON Pointer is a simple query language defined for JSON documents by
* <a href="https://tools.ietf.org/html/rfc6901">RFC 6901</a>.
* <a href="https://tools.ietf.org/html/rfc6901">RFC 6901</a>.
*
* @author JSON.org
* @version 2016-05-13
*/
public class JSONPointer {

View file

@ -27,6 +27,9 @@ SOFTWARE.
/**
* The JSONPointerException is thrown by {@link JSONPointer} if an error occurs
* during evaluating a pointer.
*
* @author JSON.org
* @version 2016-05-13
*/
public class JSONPointerException extends JSONException {
private static final long serialVersionUID = 8872944667561856751L;