Spring Data Couchbase

org.springframework.data.couchbase.core.convert.translation
Class JacksonTranslationService

java.lang.Object
  extended by 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

Constructor Summary
JacksonTranslationService()
           
 
Method Summary
 void afterPropertiesSet()
           
 CouchbaseStorable decode(Object source, CouchbaseStorable target)
          Decode a JSON string into the CouchbaseStorable structure.
 Object encode(CouchbaseStorable source)
          Encode a CouchbaseStorable to a JSON string.
 void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JacksonTranslationService

public JacksonTranslationService()
Method Detail

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

Spring Data Couchbase

Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.