|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.github.fge.jackson.JacksonUtils
public final class JacksonUtils
Utility class for Jackson
This class provides utility methods to get a JsonNodeFactory
and
a preconfigured ObjectReader
. It can also be used to return
preconfigured instances of ObjectMapper
(see newMapper()
.
Method Summary | |
---|---|
static Map<String,JsonNode> |
asMap(JsonNode node)
Return a map out of an object's members |
static ObjectReader |
getReader()
Return a preconfigured ObjectReader to read JSON inputs |
static ObjectMapper |
newMapper()
Return a preconfigured ObjectMapper |
static JsonNodeFactory |
nodeFactory()
Return a preconfigured JsonNodeFactory to generate JSON data as
JsonNode s |
static String |
prettyPrint(JsonNode node)
Pretty print a JSON value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ObjectReader getReader()
ObjectReader
to read JSON inputs
newMapper()
public static JsonNodeFactory nodeFactory()
JsonNodeFactory
to generate JSON data as
JsonNode
s
public static Map<String,JsonNode> asMap(JsonNode node)
If the node given as an argument is not a map, an empty map is returned.
node
- the node
public static String prettyPrint(JsonNode node)
node
- the JSON value to print
newMapper()
public static ObjectMapper newMapper()
ObjectMapper
The returned mapper will have the following features enabled:
DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS
;SerializationFeature.WRITE_BIGDECIMAL_AS_PLAIN
;SerializationFeature.INDENT_OUTPUT
.This returns a new instance each time.
ObjectMapper
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |