|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.ralscha.extdirectspring.util.JsonHandler
@Component public class JsonHandler
| Constructor Summary | |
|---|---|
JsonHandler()
|
|
| Method Summary | ||
|---|---|---|
|
convertValue(Object object,
Class<T> clazz)
|
|
|
readValue(String json,
Class<T> clazz)
Creates a object from a json String. |
|
|
readValue(String json,
org.codehaus.jackson.type.TypeReference<T> typeReference)
Creates a object from a json String. |
|
void |
setIndentMapper(org.codehaus.jackson.map.ObjectMapper indentMapper)
|
|
void |
setMapper(org.codehaus.jackson.map.ObjectMapper mapper)
|
|
String |
writeValueAsString(Object obj)
Converts a object into a String containing the json representation of this object. |
|
String |
writeValueAsString(Object obj,
boolean indent)
Converts a object into a String containing the json representation of this object. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonHandler()
| Method Detail |
|---|
public void setMapper(org.codehaus.jackson.map.ObjectMapper mapper)
public void setIndentMapper(org.codehaus.jackson.map.ObjectMapper indentMapper)
public String writeValueAsString(Object obj)
obj - the object to serialize into json
public String writeValueAsString(Object obj,
boolean indent)
obj - the object to serialize into jsonindent - if false writes json on one line
public <T> T readValue(String json,
org.codehaus.jackson.type.TypeReference<T> typeReference)
T - type of the object to createjson - String with the jsontypeReference - TypeReference instance of the desired result type
TypeReference
public <T> T readValue(String json,
Class<T> clazz)
T - type of the object to createjson - String with the jsonclazz - Class of object to create
public <T> T convertValue(Object object,
Class<T> clazz)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||