public class JsonConversionService
extends java.lang.Object
| Constructor and Description |
|---|
JsonConversionService() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
fromJson(java.io.InputStream in,
java.lang.Class<T> type)
Parses JSON from an input stream to create a casper type object
|
<T> T |
fromJson(java.lang.String json,
java.lang.Class<T> type)
Converts a JSON string to a casper type object
|
java.lang.String |
toJson(java.lang.Object clObject)
Converts a Casper type object ot a JSON string
|
void |
toJson(java.lang.Object clObject,
java.io.OutputStream out)
Writes a Casper type object ot a JSON string to an
OutputStream |
java.lang.String |
writeValueAsString(java.lang.Object value) |
public java.lang.String toJson(java.lang.Object clObject)
throws java.io.IOException
clObject - the type object to writejava.io.IOException - - on write errorpublic java.lang.String writeValueAsString(java.lang.Object value)
throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic void toJson(java.lang.Object clObject,
java.io.OutputStream out)
throws java.io.IOException
OutputStreamclObject - the type object to writeout - the stream to write JSON representation of the clObject tojava.io.IOException - - on write errorpublic <T> T fromJson(java.lang.String json,
java.lang.Class<T> type)
throws java.io.IOException
T - type of object to create from JSONjson - the JSON to parsetype - the class of the object to create from JSONjava.io.IOException - - on a read errorpublic <T> T fromJson(java.io.InputStream in,
java.lang.Class<T> type)
throws java.io.IOException
T - the type of the object to create from JSONin - the stream to of JSON to parsetype - the class of the object to create from JSONjava.io.IOException - - on a read error