As a MapBinder, it acts as a factory for LinkedBindingBuilders for each of the map's values.
It delegates to a Multibinder of entries (keys to value providers).
As a Module, it installs the binding to the map itself, as well as to a corresponding map whose values are providers.
As a module, this implements equals() and hashcode() in order to trick Guice into executing its configure() method only once. That makes it so that multiple mapbinders can be created for the same target map, but only one is bound. Since the list of bindings is retrieved from the injector itself (and not the mapbinder), each mapbinder has access to all contributions from all equivalent mapbinders.
Rather than binding a single Map.Entry<K, V>, the map binder binds keys and values independently. This allows the values to be properly scoped.
| Modifier and Type | Class and Description |
|---|---|
| private static class | RealMapBinder.
The BindingSelection contains some of the core state and logic for the MapBinder. |
| private static class | RealMapBinder.
Implementation of a provider instance for the map that also exposes details about the MapBinder using the extension SPI, delegating to another provider instance for non-extension (e.g, the actual provider instance info) data. |
| pack-priv static class | |
| pack-priv static class | |
| private abstract static class | RealMapBinder.
A base class for ProviderWithDependencies that need equality based on a specific object. |
| private abstract static class | RealMapBinder.
A base class for ProviderWithDependencies that need equality based on a specific object. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Binder | |
| private final RealMapBinder. | |
| private final RealMultibinder | |
| private static final ImmutableSet |
| Access | Constructor and Description |
|---|---|
| private | RealMapBinder(Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType, Key<Map<K, V>> mapKey, RealMultibinder<Map.
|
| Modifier and Type | Method and Description |
|---|---|
| public LinkedBindingBuilder | |
| public void | configure(Binder binder)
Implements com. binder.
|
| private static <K, V> InternalProvisionException | |
| pack-priv static <K, V> TypeLiteral | |
| pack-priv static <K, V> TypeLiteral | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| pack-priv Key | |
| private static <T> Key | |
| public int | |
| pack-priv static <K, V> TypeLiteral | |
| pack-priv static <K, V> TypeLiteral | |
| pack-priv static <K, V> TypeLiteral | |
| pack-priv static <K, V> TypeLiteral | |
| pack-priv static <K, V> TypeLiteral | |
| pack-priv static <K, V> TypeLiteral | |
| pack-priv static <K, V> TypeLiteral | |
| public static <K, V> RealMapBinder | newMapRealBinder(Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType)
Returns a new mapbinder that collects entries of |
| public static <K, V> RealMapBinder | newRealMapBinder(Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType, Annotation annotation)
Returns a new mapbinder that collects entries of |
| public static <K, V> RealMapBinder | newRealMapBinder(Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType, Class<? extends Annotation> annotationType)
Returns a new mapbinder that collects entries of |
| pack-priv static <K, V> RealMapBinder | |
| private static <K, V> RealMapBinder | newRealMapBinder(Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType, Key<Map<K, V>> mapKey, RealMultibinder<Map.
|
| public void | |
| pack-priv static <K, V> TypeLiteral |