package io.induct.yle.ioc;

import com.google.inject.AbstractModule;
import io.induct.yle.api.YleApi;

/**
 * @since 2015-05-09
 */
public class YleApiModule extends AbstractModule {
    @Override
    protected void configure() {
        bind(YleApi.class);
    }
}

@@ -36,224 +36,1791 @@
 com.
-google.inject.AbstractModule;%0Aimport io.induct.yle.api.YleApi;%0A%0A/**%0A * @since 2015-05-09%0A */%0Apublic class YleApiModule extends AbstractModule %7B%0A    @Override%0A    protected void configure() %7B%0A        bind(YleApi.class
+fasterxml.jackson.core.JsonParser;%0Aimport com.fasterxml.jackson.core.JsonProcessingException;%0Aimport com.fasterxml.jackson.core.Version;%0Aimport com.fasterxml.jackson.databind.DeserializationContext;%0Aimport com.fasterxml.jackson.databind.JsonDeserializer;%0Aimport com.fasterxml.jackson.databind.Module;%0Aimport com.fasterxml.jackson.databind.module.SimpleModule;%0Aimport com.google.inject.AbstractModule;%0Aimport com.google.inject.multibindings.Multibinder;%0Aimport com.google.inject.name.Names;%0Aimport com.ning.http.client.AsyncHttpClient;%0Aimport io.induct.http.HttpClient;%0Aimport io.induct.http.ning.NingHttpClient;%0Aimport io.induct.yle.api.YleApi;%0Aimport io.induct.yle.api.YleId;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * @since 2015-05-09%0A */%0Apublic class YleApiModule extends AbstractModule %7B%0A    @Override%0A    protected void configure() %7B%0A        bind(HttpClient.class).toInstance(new NingHttpClient(new AsyncHttpClient()));%0A        bind(YleApi.class);%0A%0A        SimpleModule yleApiCustomDeserializers = new SimpleModule(%22YleApiEntityDeserializers%22, new Version(1, 0, 0, null, %22io.induct%22, %22yleapi%22));%0A        yleApiCustomDeserializers.addDeserializer(YleId.class, new JsonDeserializer%3CYleId%3E() %7B%0A            @Override%0A            public YleId deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException %7B%0A                return new YleId(jp.getText());%0A            %7D%0A        %7D);%0A        Multibinder jacksonModules = Multibinder.newSetBinder(this.binder(), Module.class);%0A        jacksonModules.addBinding().toInstance(yleApiCustomDeserializers);%0A%0A        bind(String.class).annotatedWith(Names.named(%22yle.api.appId%22)).toInstance(%22TODO_YLE_APPID%22);%0A        bind(String.class).annotatedWith(Names.named(%22yle.api.appKey%22)).toInstance(%22TODO_YLE_APPKEY%22
 );%0A 

add custom deserializer for YleId and placeholder values for API credentials