Skip to content

Commit 1b1c8e8

Browse files
committed
Annotate parse methods as static, and make PathCompiler internal
1 parent b8d92bd commit 1b1c8e8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/kotlin/com/nfeld/jsonpathlite/JsonPath.kt

+2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class JsonPath(path: String) {
9191
* @throws JSONException
9292
*/
9393
@Throws(JSONException::class)
94+
@JvmStatic
9495
fun parse(jsonString: String): JsonResult = when {
9596
jsonString.isEmpty() -> throw JSONException("JSON string is empty")
9697
jsonString.first() == '{' -> JsonObject(JSONObject(jsonString))
@@ -103,6 +104,7 @@ class JsonPath(path: String) {
103104
* @param jsonString JSON string to parse
104105
* @return instance of parsed [JsonResult] object or null
105106
*/
107+
@JvmStatic
106108
fun parseOrNull(jsonString: String): JsonResult? {
107109
return jsonString.firstOrNull()?.run {
108110
try {

src/main/kotlin/com/nfeld/jsonpathlite/PathCompiler.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.nfeld.jsonpathlite
22

3-
object PathCompiler {
3+
internal object PathCompiler {
44

55
/**
66
* @param path Path string to compile

0 commit comments

Comments
 (0)