Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit ca42281

Browse files
committed
Rephrase things in the readme
[ci skip]
1 parent b057abd commit ca42281

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
_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))._
66

7-
An implementation of [JMESPath](http://jmespath.org/) for Java. It supports searching JSON documents (via Jackson) and structures containing basic Java objects (`Map`, `List`, `String`, etc.) – but can also be extended to work with any JSON-like structure.
7+
This is an implementation of [JMESPath](http://jmespath.org/) for Java and it supports searching JSON documents (via Jackson) and structures containing basic Java objects (`Map`, `List`, `String`, etc.) – but can also be extended to work with any JSON-like structure.
88

99
## Installation
1010

@@ -24,9 +24,9 @@ If you don't want the Jackson implementation you can change the `artifactId` to
2424

2525
### Dependencies
2626

27-
`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.
27+
`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 external dependencies.
2828

29-
`jmespath-jackson` obviously depends on Jackson, specifically Jackson DataBind (`com.fasterxml.jackson.core:jackson-databind`).
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`.
3030

3131
## Basic usage
3232

@@ -65,7 +65,7 @@ JsonNode result = expression.search(input);
6565

6666
### Adding custom functions
6767

68-
In addition to the built in functions like `sort`, `to_string`, and `sum` you can add your own. All you need to do is to create a class that extends `io.burt.jmespath.function.BaseFunction` (actually implement `Function` in the same package, but then you'd need to do much more work yourself) and then register it with your runtime.
68+
In addition to the built in functions like `sort`, `to_string`, and `sum` you can add your own. All you need to do is to create a class that extends `io.burt.jmespath.function.BaseFunction` (actually implement `Function` from the same package, but then you'd need to do much more work yourself) and then register it with your runtime.
6969

7070
Here's how you add a `sin` function:
7171

@@ -118,7 +118,7 @@ import io.burt.jmespath.jackson.JacksonRuntime;
118118
FunctionRegistry defaultFunctions = FunctionRegistry.defaultRegistry();
119119
// And we can create a new registry with additional functions by extending it
120120
FunctionRegistry customFunctions = defaultFunctions.extend(new SinFunction());
121-
// We need to tell the runtime to use our custom registry
121+
// We need to create a runtime that uses our custom registry
122122
JmesPath<JsonNode> runtime = new JacksonRuntime(functionRegistry);
123123
// Now the function is available in expressions
124124
JsonNode result = runtime.compile("sin(measurements.angle)").search(input);
@@ -134,7 +134,7 @@ Creating a runtime adapter is a bit more work than adding a function, but not ex
134134

135135
Most of the work a runtime does is converting back and forth between Java types. The core runtime can't know about all of the types of structures you want to search, but it knows that they will be JSON-like, so it uses the runtime adapters to help translate. The Jackson runtime adapter, for example, translates the world of `JsonNode`s into Java types like `List` and `String` when asked by the core runtime.
136136

137-
Runtime adapters can wrap libraries like [Gson](https://github.com/google/gson), but can also make it possible to search Java beans with JMESPath. A runtime adapter could translate "get property X" to a `getX()` method call via reflection, for example. The structure to search doesn't have to be JSON, it just has to be JSON-_like_.
137+
Runtime adapters can wrap libraries like [Gson](https://github.com/google/gson), but can also make it possible, for example, to search Java beans with JMESPath by translating JMESPath operations to reflection calls. The structure to search doesn't have to be JSON, it just has to be JSON-_like_.
138138

139139
A good starting point for writing a new runtime adapter is reading the code of the existing adapters and the docs for `Adapter` and `BaseAdapter`. There are also JUnit tests in `JmesPathRuntimeTest` and `JmesPathComplianceTest` that can be subclassed and run against any runtime.
140140

@@ -151,4 +151,4 @@ And all dependencies should be installed, the code compiled and the tests run.
151151

152152
# Copyright
153153

154-
© 2016 Burt AB, see LICENSE.txt (BSD 3-Clause).
154+
© 2016 Burt AB, see LICENSE.txt (BSD 3-Clause).

0 commit comments

Comments
 (0)