All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ssf4j.jackson.JacksonSerialization Maven / Gradle / Ivy

There is a newer version: 0.4
Show newest version
package org.ssf4j.jackson;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import org.ssf4j.Serialization;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * Serialization facade that uses Jackson's JSON mapper.
 * 

* Jackson cannot serialize everything, but comes pretty close. * @author robin * */ public class JacksonSerialization implements Serialization { protected ObjectMapper mapper; public JacksonSerialization() {} public JacksonSerialization(ObjectMapper mapper) { this.mapper = mapper; } /** * {@inheritDoc} */ @Override public JacksonSerializer newSerializer(OutputStream out, Class type) throws IOException { return new JacksonSerializer(out, mapper); } /** * {@inheritDoc} */ @Override public JacksonDeserializer newDeserializer(InputStream in, Class type) throws IOException { return new JacksonDeserializer(in, mapper, type); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy