public class JacksonTranslationService extends Object implements TranslationService, InitializingBean
TranslationService contract.| Constructor and Description |
|---|
JacksonTranslationService() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
CouchbaseStorable |
decode(String source,
CouchbaseStorable target)
Decode a JSON string into the
CouchbaseStorable structure. |
<T> T |
decodeFragment(String source,
Class<T> target)
Decodes an ad-hoc JSON object into a corresponding "case" class.
|
String |
encode(CouchbaseStorable source)
Encode a
CouchbaseStorable to a JSON string. |
void |
setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
public final String encode(CouchbaseStorable source)
CouchbaseStorable to a JSON string.encode in interface TranslationServicesource - the source document to encode.public final CouchbaseStorable decode(String source, CouchbaseStorable target)
CouchbaseStorable structure.decode in interface TranslationServicesource - the source formatted document.target - the target of the populated data.public <T> T decodeFragment(String source, Class<T> target)
TranslationServicedecodeFragment in interface TranslationServiceT - the target class.source - the JSON for the ad-hoc JSON object (from a N1QL query for instance).target - the target class information.public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanCopyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.