public final class JsonMapper extends Object
Modifier and Type | Method and Description |
---|---|
static com.fasterxml.jackson.databind.JsonNode |
asJsonNode(String json)
Return a
JsonNode for the passed in JSON string. |
static <T> T |
fromJson(String json,
Class<T> type)
Transforms from JSON to the type specified.
|
static com.fasterxml.jackson.databind.node.ArrayNode |
newArrayNode() |
static com.fasterxml.jackson.databind.node.ObjectNode |
newObjectNode() |
static String |
toJson(Object obj)
Transforms from Java object notation to JSON.
|
static String |
toString(com.fasterxml.jackson.databind.JsonNode jsonNode) |
public static <T> T fromJson(String json, Class<T> type)
T
- the type the class to convert tojson
- the json to be transformed.type
- the Java type that the JSON should be transformed to.public static String toJson(Object obj)
obj
- the Java object to transform into JSON.String
the json representation for the object.public static String toString(com.fasterxml.jackson.databind.JsonNode jsonNode)
public static com.fasterxml.jackson.databind.JsonNode asJsonNode(String json)
JsonNode
for the passed in JSON string.json
- the string to be parsed.public static com.fasterxml.jackson.databind.node.ObjectNode newObjectNode()
public static com.fasterxml.jackson.databind.node.ArrayNode newArrayNode()
Copyright © 2015 JBoss by Red Hat. All Rights Reserved.