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

org.spincast.plugins.jacksonjson.SpincastJacksonJsonPluginGuiceModule Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package org.spincast.plugins.jacksonjson;

import java.lang.reflect.Type;

import org.spincast.core.guice.SpincastPluginGuiceModuleBase;
import org.spincast.core.json.IJsonManager;

import com.google.inject.Scopes;
import com.google.inject.multibindings.Multibinder;

public class SpincastJacksonJsonPluginGuiceModule extends SpincastPluginGuiceModuleBase {

    /**
     * Constructor.
     */
    public SpincastJacksonJsonPluginGuiceModule(Type requestContextType, Type websocketContextType) {
        super(requestContextType, websocketContextType);
    }

    @Override
    protected void configure() {

        bindJsonManager();
        bindJsonMixinsMultiBinder();

    }

    protected void bindJsonManager() {
        bind(IJsonManager.class).to(getSpincastJsonManager()).in(Scopes.SINGLETON);
    }

    protected Class getSpincastJsonManager() {
        return SpincastJsonManager.class;
    }

    protected void bindJsonMixinsMultiBinder() {

        //==========================================
        // Create the Json mixin info multibinder so it's not null,
        // even if no mixin infos are added.
        //==========================================
        @SuppressWarnings("unused")
        Multibinder uriBinder = Multibinder.newSetBinder(binder(), IJsonMixinInfo.class);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy