@Service public final class WebCmsDataObjectMapper extends Object
ObjectMapper for JSON (de-)serialization.
Customized configuration for data importing and exporting.| Constructor and Description |
|---|
WebCmsDataObjectMapper(WebCmsObjectSerializer cmsObjectSerializer,
com.foreach.across.modules.webcms.data.json.WebCmsObjectDeserializers cmsObjectDeserializers) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
readFromString(String json,
Class<T> valueType)
Deserialize a string to the output type.
|
<T> T |
readFromString(String json,
org.springframework.core.convert.TypeDescriptor typeDescriptor)
Deserialize a string to the output type.
|
boolean |
updateFromString(String json,
Object target,
boolean failOnError)
Update an object with properties defined in a JSON string.
|
String |
writeToString(Object object) |
public WebCmsDataObjectMapper(WebCmsObjectSerializer cmsObjectSerializer, com.foreach.across.modules.webcms.data.json.WebCmsObjectDeserializers cmsObjectDeserializers)
public boolean updateFromString(String json, Object target, boolean failOnError)
json - containing the valuestarget - object to update (should not be null)failOnError - true if an exception should be thrown if an error occurspublic <T> T readFromString(String json, Class<T> valueType)
T - value type referencejson - data as stringvalueType - to createpublic <T> T readFromString(String json, org.springframework.core.convert.TypeDescriptor typeDescriptor)
T - output type referencejson - data as stringtypeDescriptor - representing the output type to createCopyright © 2020. All rights reserved.