This is a Java port of dot-notes to work with Jackson JSON. The interface is the same, so please check out the documentation for example usage. You can find the Javadocs from the latest release here - they should be pretty self explanatory.
This lib is built using Travis and has 100% line/branch coverage, making it pretty robust. This does not mean it's perfect however, so make sure you have appropriate tests in your code to cover your usage.
dot-notes-java
available on Maven central, via Sonatype OSS:
<dependency>
<groupId>io.whitfin</groupId>
<artifactId>dot-notes</artifactId>
<version>3.1.0</version>
</dependency>
- The interface is the same for the most part, with the same methods surfaced to the API. Naturally there are a few differences due to the language changes, but it's all pretty straightforward.
- All work is done with the
JsonNode
component ofcom.fasterxml
Jackson, rather than the old Codehaus version. - When passing a callback to
recurse
, please pass an instance of theNodeIterator
class. You can overriderequirePathGeneration
to returnfalse
to disable path generation for faster parsing. - There is a lot more type validation, due to the strictness of Java. This leads to minor parity changes between the libraries cross-language, but it clearly unavoidable. An example of this is trying to create an Array noted key inside an ObjectNode; in Java you get an Exception, in JS it works just fine.
- All keys are wrapped in the
NotedKey
class, as they can either Integer (Array) or String (Object) keys. TheNotedKey
class therefore hasisNumber/isString
methods, andasNumber/asString
methods to deal with appropriately.
If you wish to contribute (awesome!), please file an issue in the main dot-notes repo, as this is just a port (unless it's a bug in this library). All PRs should pass mvn clean test
and maintain 100% test coverage.
Tests are run using Maven. I aim to maintain 100% coverage where possible (both line and branch). These tests can be run as follows:
$ mvn clean verify