原文地址:https://code.google.com/p/google-guice/wiki/BuiltInBindings
Built-in Bindings(内建的绑定):即时在injector内的绑定。例如Loggers等。
贴代码:
import com.google.inject.Guice; import com.google.inject.Injector; public class Test { public static void main(String[] args) { Injector injector = Guice.createInjector(); System.out.println(injector); } }
执行结果:
Injector{bindings=[InstanceBinding{key=Key[type=com.google.inject.Stage, annotation=[none]], source=[unknown source], instance=DEVELOPMENT}, ProviderInstanceBinding{key=Key[type=com.google.inject.Injector, annotation=[none]], source=[unknown source], scope=Scopes.NO_SCOPE, provider=Provider