JsonUtils.Impl| Constructor and Description |
|---|
JsonUtils.Impl(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Required-Args constructor
|
| Modifier and Type | Method and Description |
|---|---|
<P> P |
fromJson(javax.servlet.http.HttpServletRequest request)
Convert the body of an
HttpServletRequest into an of the proper
type as found in the "@class" directive in the Json. |
<P> P |
fromJson(com.fasterxml.jackson.databind.JsonNode jsonNode)
Convert a
JsonNode into an object of the proper type as found in
the "@class" directive in the JsonNode. |
com.fasterxml.jackson.databind.JsonNode |
getJsonContentFromRequest(javax.servlet.http.HttpServletRequest request)
Retrieves the
JsonNode from the request. |
<T> String |
toJson(T payload)
Convert an object of type
|
<P> String |
toJsonUnchecked(P payload)
Convert an object of type
|
protected static final Logger logger
public JsonUtils.Impl(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
objectMapper - public <T> String toJson(T payload) throws com.fasterxml.jackson.core.JsonProcessingException
JsonUtilsinto a Json String.
public <P> String toJsonUnchecked(P payload) throws RuntimeException
JsonUtilsinto a Json String.
toJsonUnchecked in interface JsonUtilsRuntimeExceptionpublic <P> P fromJson(com.fasterxml.jackson.databind.JsonNode jsonNode)
throws ClassNotFoundException
JsonUtilsJsonNode into an object of the proper type as found in
the "@class" directive in the JsonNode.fromJson in interface JsonUtilsClassNotFoundExceptionpublic com.fasterxml.jackson.databind.JsonNode getJsonContentFromRequest(javax.servlet.http.HttpServletRequest request)
throws IOException,
ClassNotFoundException
JsonUtilsJsonNode from the request.getJsonContentFromRequest in interface JsonUtilsIOExceptionClassNotFoundExceptionpublic <P> P fromJson(javax.servlet.http.HttpServletRequest request)
throws IOException,
ClassNotFoundException
JsonUtilsHttpServletRequest into an of the proper
type as found in the "@class" directive in the Json.fromJson in interface JsonUtilsIOExceptionClassNotFoundExceptionCopyright © 2014 Sappenin Inc.. All rights reserved.