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:
@@ -30,7 +30,11 @@ import java.io.Writer;
|
||||
import java.lang.reflect.Array;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* A JSONArray is an ordered sequence of values. Its external text form is a
|
||||
@@ -955,6 +959,10 @@ public class JSONArray implements Iterable<Object> {
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object query(String jsonPointer) {
|
||||
return new JSONPointer(jsonPointer).queryFrom(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an index and close the hole.
|
||||
|
Reference in New Issue
Block a user