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

it.espr.mvc.json.JacksonImpl Maven / Gradle / Ivy

There is a newer version: 0.3.4
Show newest version
package it.espr.mvc.json;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class JacksonImpl implements Json {

	private ObjectMapper objectMapper = new ObjectMapper();

	@Override
	public  Type deserialise(Class type, String string) throws Exception {
		return objectMapper.readValue(string, type);
	}

	@Override
	public String serialise(Object object) throws JsonProcessingException {
		return objectMapper.writeValueAsString(object);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy