use of com.couchbase.client.java.encryption.databind.jackson.EncryptionModule in project spring-data-couchbase by spring-projects.
the class AbstractCouchbaseConfiguration method couchbaseObjectMapper.
/**
* Creates a {@link ObjectMapper} for the jsonSerializer of the ClusterEnvironment
*
* @return ObjectMapper
*/
public ObjectMapper couchbaseObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.registerModule(new JsonValueModule());
CryptoManager cryptoManager = null;
if (cryptoManager != null) {
mapper.registerModule(new EncryptionModule(cryptoManager));
}
return mapper;
}
use of com.couchbase.client.java.encryption.databind.jackson.EncryptionModule in project couchbase-jvm-clients by couchbase.
the class JacksonJsonSerializer method create.
/**
* Returns a new instance backed by a default ObjectMapper
* with optional encryption support.
*
* @param cryptoManager (nullable) The manager to use for activating the
* {@link Encrypted} annotation, or null to disable encryption support.
* @return the Jackson JSON serializer with a provided crypto manager.
*/
public static JacksonJsonSerializer create(CryptoManager cryptoManager) {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JsonValueModule());
if (cryptoManager != null) {
mapper.registerModule(new EncryptionModule(cryptoManager));
}
return new JacksonJsonSerializer(mapper);
}
Aggregations