Skip to content

Commit 8c02ba1

Browse files
committed
Updated : Readme
1 parent 277e91e commit 8c02ba1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,22 @@ Following API examples are shown based on the sample JSON data given above. To g
210210
### `JSONQ()`
211211

212212
Constructor for initializing JSONQ object with parameter `JSONObject`, `String`, `ByteArray`, `InputStream`. Use which one you are flexible with.
213+
```kotlin
214+
val inputStream = Thread.currentThread().contextClassLoader.getResourceAsStream("data.json")
215+
jsonq = JSONQ(inputStream)
216+
```
213217

214218
### `find(path)`
215219

216220
* `path` -- the path hierarchy of the data you want to find.
217221

218222
This method will return the JSONValue from this json path
219223

224+
```kotlin
225+
val data = jsonq.find("users.2.location")
226+
println(data)
227+
```
228+
220229
### `from(path)`
221230

222231
* `path` (optional) -- the path hierarchy of the data you want to start query from.

0 commit comments

Comments
 (0)