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

com.gwtplatform.dispatch.rest.rebind.serialization.JacksonMapperProvider.vm Maven / Gradle / Ivy

There is a newer version: 1.6
Show newest version
package $package;

import javax.inject.Inject;
import javax.inject.Provider;

import com.github.nmorel.gwtjackson.client.ObjectMapper;
import com.google.inject.TypeLiteral;
import com.google.gwt.core.client.GWT;
#if (!$definitions.isEmpty())
import ${package}.mappers.*;
#end

public class $impl extends AbstractJacksonMapperProvider {
    $impl() {
#foreach ($definition in $definitions)
        registerProvider("$definition.serializableType.getParameterizedQualifiedSourceName()",
                new Provider>() {
                    private ObjectMapper mapper;

                    @Override
                    public ObjectMapper get() {
                        if (mapper == null){
                            mapper = (ObjectMapper) GWT.create(${definition.className}.class);
                        }

                        return mapper;
                    }
                });
#end
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy