Package com.github.fge.jsonschema.util.jackson

Utility classes for Jackson

See: Description

Package com.github.fge.jsonschema.util.jackson Description

Utility classes for Jackson

There are two utility classes.

JacksonUtils is a utility class with methods to return an appropriate JsonNodeFactory and ObjectMapper for the needs of JSON Schema. While the first is not that important, the second ensures that decimal number nodes are read using BigDecimal instead of double, so that there is no precision loss for numeric comparisons (especially important for divisibility tests). It also contains a method for returning an empty object, and another one to render an ObjectNode as a Map.

JsonNodeEquivalence is an implementation of Guava's Equivalence for JsonNode instances. It exists solely for the purpose of conforming to the JSON Schema definition of equality, which requires that two numeric instances are equal if their mathematical value is the same (that is, 1.0 and 1 are the same). This is not the case by default with Jackson.

Copyright © 2013. All Rights Reserved.