|
1 | 1 | # jmespath-java
|
2 | 2 |
|
3 |
| -[](https://travis-ci.org/burtcorp/jmespath-java) |
| 3 | +_If you're reading this on GitHub, please note that this is the readme for the development version and that some features described here might not yet have been released. You can find the readme for a specific version via the release tags ([here is an example](https://github.com/burtcorp/jmespath-java/releases/tag/jmespath-0.5.0))._ |
4 | 4 |
|
5 |
| -_If you're reading this on GitHub, please note that this is the readme for the development version and that some features described here might not yet have been released. You can find the readme for a specific version via the release tags ([here is an example](https://github.com/burtcorp/jmespath-java/releases/tag/jmespath-0.1.0))._ |
6 |
| - |
7 |
| -This is an implementation of [JMESPath](http://jmespath.org/) for Java and it supports searching JSON documents (via [Jackson](https://github.com/FasterXML/jackson) or [Gson](https://github.com/google/gson)) and structures containing basic Java objects (`Map`, `List`, `String`, etc.) – but can also be extended to work with any JSON-like structure. |
| 5 | +This is an implementation of [JMESPath](http://jmespath.org/) for Java. It supports multiple JSON libraries, for example [Jackson](https://github.com/FasterXML/jackson), [Jackson jr](https://github.com/FasterXML/jackson-jr), [Gson](https://github.com/google/gson), and structures containing basic Java objects (`Map`, `List`, `String`, etc.). It can be extended to support any JSON-like structure through a simple adapter. |
8 | 6 |
|
9 | 7 | ## Installation
|
10 | 8 |
|
11 |
| -Using Maven you can add this to your dependencies: |
| 9 | +You can install the library using Maven: |
12 | 10 |
|
13 | 11 | ```xml
|
14 | 12 | <dependency>
|
15 | 13 | <groupId>io.burt</groupId>
|
16 |
| - <artifactId>jmespath</artifactId> |
| 14 | + <artifactId>${jmespath.adapter}</artifactId> |
17 | 15 | <version>${jmespath.version}</version>
|
18 | 16 | </dependency>
|
19 | 17 | ```
|
20 | 18 |
|
21 |
| -Check the [releases page](https://github.com/burtcorp/jmespath-java/releases) for the value of `${jmespath.version}`. |
| 19 | +Replace `${jmespath.adapter}` with the adapter you need for your project, for example `jmespath-jackson` or `jmespath-gson`. You can also use `jmespath-core` if you are going to implement your own adapter in your project. |
22 | 20 |
|
23 |
| -If you don't want both the Jackson and Gson implementations you can change it to `jmespath-jackson` or `jmespath-gson`. Some time before 1.0 the dependencies will probably be reversed so that `jmespath` will not depend on the specific runtimes, so you unless you have the need for multiple runtimes you should depend on the specific runtime you need. |
| 21 | +Replace `${jmespath.version}` with the latest version from the [releases page](https://github.com/burtcorp/jmespath-java/releases). |
24 | 22 |
|
25 | 23 | ### Dependencies
|
26 | 24 |
|
27 | 25 | `jmespath-core` has an ANTLR based parser, but the ANTLR runtime artifact has been shaded into the `io.burt.jmespath` package to avoid conflicts with other artifacts that may depend on ANTLR. This means that `jmespath-core` has no external dependencies.
|
28 | 26 |
|
29 |
| -`jmespath-jackson` obviously depends on Jackson, specifically Jackson DataBind (`com.fasterxml.jackson.core:jackson-databind`), but other than that it only depends on `jmespath-core`. |
30 |
| - |
31 |
| -`jmespath-gson` depends on Gson, specifically `com.google.code.gson:gson`, but other than that only `jmespath-core`. |
| 27 | +The adapters each depend on their supporting libraries, for example Jackson Databind for `jmespath-jackson`. |
32 | 28 |
|
33 | 29 | ## Basic usage
|
34 | 30 |
|
@@ -59,7 +55,7 @@ JsonNode result = expression.search(input);
|
59 | 55 |
|
60 | 56 | ## Description
|
61 | 57 |
|
62 |
| -`jmespath-java` comes in three parts: `jmespath-core`, `jmespath-jackson`, and `jmespath-gson`. The former contains the expression parser, core runtime, default functions and a simple runtime adapter that can search structures made up from numbers, strings, booleans, `List` and `Map` available as `io.burt.jmespath.jcf.JcfRuntime` (for "Java Collections Framework"). The latter contains the Jackson and Gson runtime adapters, respectively, and is what you should be using most of the time. The JCF runtime is just for internal development and testing. It primarily exists to test that there's nothing runtime-specific in the implementation. |
| 58 | +`jmespath-java` comes in multiple parts: `jmespath-core`, and the adapters for different JSON libraries, like `jmespath-jackson`, and `jmespath-gson`. `jmespath-core` contains the expression parser, core runtime, default functions and a simple runtime adapter that can search structures made up from numbers, strings, booleans, `List` and `Map` available as `io.burt.jmespath.jcf.JcfRuntime` (for "Java Collections Framework"). The latter contains runtime adapters for each specific JSON library, and is what you should be using most of the time. The JCF runtime is just for internal development and testing. It primarily exists to test that there's nothing runtime-specific in the implementation. |
63 | 59 |
|
64 | 60 | ## Configuration
|
65 | 61 |
|
@@ -177,4 +173,4 @@ And all dependencies should be installed, the code compiled and the tests run.
|
177 | 173 |
|
178 | 174 | # Copyright
|
179 | 175 |
|
180 |
| -© 2016-2018 Burt AB, see LICENSE.txt (BSD 3-Clause). |
| 176 | +© 2016 Burt Intelligence AB and contributors, see LICENSE.txt (BSD 3-Clause). |
0 commit comments