Skip to content

Commit 4a458a9

Browse files
committed
add timestamps to recent commits, javadocs for JSONObject, JSONArray queryFrom() methods
1 parent 8a72509 commit 4a458a9

File tree

4 files changed

+48
-4
lines changed

4 files changed

+48
-4
lines changed

JSONArray.java

+20-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ of this software and associated documentation files (the "Software"), to deal
7878
* </ul>
7979
*
8080
* @author JSON.org
81-
* @version 2016-03-05
81+
* @version 2016-05-13
8282
*/
8383
public class JSONArray implements Iterable<Object> {
8484

@@ -960,6 +960,25 @@ public JSONArray put(int index, Object value) throws JSONException {
960960
return this;
961961
}
962962

963+
/**
964+
* Creates a JSONPointer using an intialization string and tries to
965+
* match it to an item within this JSONArray. For example, given a
966+
* JSONArray initialized with this document:
967+
* <pre>
968+
* [
969+
* {"b":"c"}
970+
* ]
971+
* </pre>
972+
* and this JSONPointer string:
973+
* <pre>
974+
* "/0/b"
975+
* </pre>
976+
* Then this method will return the String "c"
977+
* A JSONPointerException may be thrown from code called by this method.
978+
*
979+
* @param jsonPointer string that can be used to create a JSONPointer
980+
* @return the item matched by the JSONPointer, otherwise null
981+
*/
963982
public Object query(String jsonPointer) {
964983
return new JSONPointer(jsonPointer).queryFrom(this);
965984
}

JSONObject.java

+21-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ of this software and associated documentation files (the "Software"), to deal
9393
* </ul>
9494
*
9595
* @author JSON.org
96-
* @version 2016-05-01
96+
* @version 2016-05-13
9797
*/
9898
public class JSONObject {
9999
/**
@@ -1337,7 +1337,26 @@ public JSONObject putOpt(String key, Object value) throws JSONException {
13371337
}
13381338
return this;
13391339
}
1340-
1340+
1341+
/**
1342+
* Creates a JSONPointer using an intialization string and tries to
1343+
* match it to an item within this JSONObject. For example, given a
1344+
* JSONObject initialized with this document:
1345+
* <pre>
1346+
* {
1347+
* "a":{"b":"c"}
1348+
* }
1349+
* </pre>
1350+
* and this JSONPointer string:
1351+
* <pre>
1352+
* "/a/b"
1353+
* </pre>
1354+
* Then this method will return the String "c".
1355+
* A JSONPointerException may be thrown from code called by this method.
1356+
*
1357+
* @param jsonPointer string that can be used to create a JSONPointer
1358+
* @return the item matched by the JSONPointer, otherwise null
1359+
*/
13411360
public Object query(String jsonPointer) {
13421361
return new JSONPointer(jsonPointer).queryFrom(this);
13431362
}

JSONPointer.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ of this software and associated documentation files (the "Software"), to deal
3535

3636
/**
3737
* A JSON Pointer is a simple query language defined for JSON documents by
38-
* <a href="https://tools.ietf.org/html/rfc6901">RFC 6901</a>.
38+
* <a href="https://tools.ietf.org/html/rfc6901">RFC 6901</a>.
39+
*
40+
* @author JSON.org
41+
* @version 2016-05-13
3942
*/
4043
public class JSONPointer {
4144

JSONPointerException.java

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ of this software and associated documentation files (the "Software"), to deal
2727
/**
2828
* The JSONPointerException is thrown by {@link JSONPointer} if an error occurs
2929
* during evaluating a pointer.
30+
*
31+
* @author JSON.org
32+
* @version 2016-05-13
3033
*/
3134
public class JSONPointerException extends JSONException {
3235
private static final long serialVersionUID = 8872944667561856751L;

0 commit comments

Comments
 (0)