va-json-tools.jackson-coreutils.1.9.source-code.overview.html Maven / Gradle / Ivy
Show all versions of jackson-coreutils Show documentation
JSON core utilities for Jackson
What this is
This package provides the following utilities over Jackson (2.2.x):
- "single" JSON text read from sources;
- an {@link com.google.common.base.Equivalence} over {@link
com.fasterxml.jackson.databind.JsonNode} for numeric JSON values;
- a generalized JSON
pointer implementation over Jackson's {@link
com.fasterxml.jackson.core.TreeNode};
- a JSON Pointer implementation for {@link
com.fasterxml.jackson.databind.JsonNode}.
Single value reads
By default, when you read an input source with Jackson using an {@link
com.fasterxml.jackson.databind.ObjectMapper}, the first JSON text is read and
the rest is ignored. For instance, with input:
[]]
the read will stop after the empty array has been read.
However, this may not be desirable. This package raises an error in this
case. The central class performing such reads is {@link
com.github.fge.jackson.JsonNodeReader}.
JSON numeric equivalence
Several IETF RFCs, or drafts, require that two JSON numeric values be
considered equal if their mathematical value is equal. Among these are JSON
Schema and JSON Patch. But this is not the case with {@link
com.fasterxml.jackson.databind.JsonNode}: 1
and 1.0 yield different
types of nodes.
This package provides an {@link com.google.common.base.Equivalence} to
ensure that two numeric nodes are considered equivalent if their mathematical
value is the same. See the javadoc for more information on how to use it.
JSON Pointer
JSON Pointer is an IETF draft which allows to unambiguously address a single
value in a JSON document. This package contains an implementation which can not
only address nodes in a {@link com.fasterxml.jackson.databind.JsonNode}, but any
{@link com.fasterxml.jackson.core.TreeNode} implementation.
All JSON Pointer related classes are in the following package: {@link
com.github.fge.jackson.jsonpointer.JsonPointer}.