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

org.atmosphere.jackson.JacksonDeserializer Maven / Gradle / Ivy

There is a newer version: 1.0.18.vaadin3
Show newest version
package org.atmosphere.jackson;

import java.io.IOException;
import java.util.Map;
import org.atmosphere.gwt.server.JSONDeserializer;
import org.atmosphere.gwt.server.SerializationException;

/**
 *
 * @author p.havelaar
 */
public class JacksonDeserializer implements JSONDeserializer {

    final JacksonSerializerProvider provider;

    public JacksonDeserializer(JacksonSerializerProvider provider) {
        this.provider = provider;
    }

    @Override
    public Object deserialize(String data) throws SerializationException{
        try {
            // TODO not the most neat implementation
            return provider.mapper.readValue(data, Map.class);
        } catch (IOException ex) {
            throw new SerializationException("Failed to deserialize data", ex);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy