@Test public void testExposing() { Injector injector = Guice.createInjector(Bindings.exposing(Key.get(String.class), new AbstractModule() { @Override protected void configure() { bind(String.class).toInstance("jake"); bind(Integer.class).toInstance(42); } })); assertTrue(injector.getBindings().containsKey(Key.get(String.class))); assertEquals("jake", injector.getInstance(String.class)); assertFalse(injector.getBindings().containsKey(Key.get(Integer.class))); }
public static Module exposing(Key<?> key, Module module) { return exposing(ImmutableList.of(key), module); }
Bindings { public static Module exposing(Key<?> key, Module module) { return exposing(ImmutableList.of(key), module); } }
Bindings { public static Module exposing(Key<?> key, Module module) { return exposing(ImmutableList.of(key), module); } private  Bindings(); }
Bindings { public static Module exposing(Key<?> key, Module module) { return exposing(ImmutableList.of(key), module); } private  Bindings(); static void requireBinding(Binder binder, Class<?> required); static void requireBinding(Binder binder, final Key<?> required); static Module exposing(Key<?> key, Module module); static Module exposing(final Iterable<? extends Key<?>> keys, final Module module); static Class<T> checkBindingAnnotation(Class<T> annotationType); static KeyFactory annotatedKeyFactory(final Class<? extends Annotation> annotationType); }
Bindings { public static Module exposing(Key<?> key, Module module) { return exposing(ImmutableList.of(key), module); } private  Bindings(); static void requireBinding(Binder binder, Class<?> required); static void requireBinding(Binder binder, final Key<?> required); static Module exposing(Key<?> key, Module module); static Module exposing(final Iterable<? extends Key<?>> keys, final Module module); static Class<T> checkBindingAnnotation(Class<T> annotationType); static KeyFactory annotatedKeyFactory(final Class<? extends Annotation> annotationType);  }