Kotlin implementation of JSON Pointer

Parent POM for Maven Kotlin projects

License

License

Categories

Categories

Kotlin Languages Net JSON Data
GroupId

GroupId

net.pwall.json
ArtifactId

ArtifactId

json-kotlin-pointer
Last Version

Last Version

0.3
Release Date

Release Date

Type

Type

jar
Description

Description

Kotlin implementation of JSON Pointer
Parent POM for Maven Kotlin projects
Project URL

Project URL

https://github.com/pwall567/json-kotlin-pointer
Source Code Management

Source Code Management

https://github.com/pwall567/json-kotlin-pointer

Download json-kotlin-pointer

How to add to project

<!-- https://jarcasting.com/artifacts/net.pwall.json/json-kotlin-pointer/ -->
<dependency>
    <groupId>net.pwall.json</groupId>
    <artifactId>json-kotlin-pointer</artifactId>
    <version>0.3</version>
</dependency>
// https://jarcasting.com/artifacts/net.pwall.json/json-kotlin-pointer/
implementation 'net.pwall.json:json-kotlin-pointer:0.3'
// https://jarcasting.com/artifacts/net.pwall.json/json-kotlin-pointer/
implementation ("net.pwall.json:json-kotlin-pointer:0.3")
'net.pwall.json:json-kotlin-pointer:jar:0.3'
<dependency org="net.pwall.json" name="json-kotlin-pointer" rev="0.3">
  <artifact name="json-kotlin-pointer" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.pwall.json', module='json-kotlin-pointer', version='0.3')
)
libraryDependencies += "net.pwall.json" % "json-kotlin-pointer" % "0.3"
[net.pwall.json/json-kotlin-pointer "0.3"]

Dependencies

compile (4)

Group / Artifact Type Version
net.pwall.json : jsonutil jar 3.1
net.pwall.util : javautil jar 2.2
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.4.0
org.jetbrains.kotlin : kotlin-reflect jar 1.4.0

test (1)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-test-junit jar 1.4.0

Project Modules

There are no modules declared in this project.

json-kotlin-pointer

Kotlin implementation of JavaScript Object Notation (JSON) Pointer.

Quick Start

This library uses the JSON classes from the jsonutil library. The examples below assume the existence of a JSONObject similar to the one created as follows:

    val json = JSON.parseObject("""{"list":[{"aaa":1},{"aaa":2}]}""")

To create a JSON Pointer from a string:

    val pointer = JSONPointer("/list/0")

This pointer selects the property named "list" from the object, and then selects the first itemfrom the array.

To use the pointer, all of the following three forms are equivalent:

    val result = pointer.eval(json)
    val result = json locate pointer
    val result = json locate "/list/0"

In each case, result will contain the JSONObject representing the nested object:

{"aaa":1}

More information to follow.

Dependency Specification

The latest version of the library is 0.3, and it may be obtained from the Maven Central repository.

Maven

    <dependency>
      <groupId>net.pwall.json</groupId>
      <artifactId>json-kotlin-pointer</artifactId>
      <version>0.3</version>
    </dependency>

Gradle

    implementation 'net.pwall.json:json-kotlin-pointer:0.3'

Gradle (kts)

    implementation("net.pwall.json:json-kotlin-pointer:0.3")

Peter Wall

2020-09-16

Versions

Version
0.3
0.2
0.1