org.spincast.plugins.jacksonjson.SpincastJacksonJsonPluginGuiceModule Maven / Gradle / Ivy
                 Go to download
                
        
                    Show more of this group  Show more artifacts with this name
Show all versions of spincast-plugins-jackson-json Show documentation
                Show all versions of spincast-plugins-jackson-json Show documentation
The default Spincast Jackson Json plugin
                
            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 extends IJsonManager> 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