org.springframework.data.couchbase.core.convert.translation
Class JacksonTranslationService
java.lang.Object
org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService
- All Implemented Interfaces:
- InitializingBean, TranslationService
public class JacksonTranslationService
- extends Object
- implements TranslationService, InitializingBean
A Jackson JSON Translator that implements the TranslationService contract.
- Author:
- Michael Nitschinger
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JacksonTranslationService
public JacksonTranslationService()
encode
public final Object encode(CouchbaseStorable source)
- Encode a
CouchbaseStorable to a JSON string.
- Specified by:
encode in interface TranslationService
- Parameters:
source - the source document to encode.
- Returns:
- the encoded JSON String.
decode
public final CouchbaseStorable decode(Object source,
CouchbaseStorable target)
- Decode a JSON string into the
CouchbaseStorable structure.
- Specified by:
decode in interface TranslationService
- Parameters:
source - the source formatted document.target - the target of the populated data.
- Returns:
- the decoded structure.
setObjectMapper
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet in interface InitializingBean
Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.