static final class BindingSourceRestriction.PermitMapConstruction
extends java.lang.Object
Bindings refer to the module that created them via a ModuleSource
. The map built
here maps a module's ModuleSource
to all the RestrictedBindingSource.Permit
annotations found on the path from the root of the module hierarchy to it. This path contains
all the modules that transitively install the module (including the module itself). This path
is also known as the module stack.
The map is built by piggybacking on the depth-first traversal of the module hierarchy during Binder configuration.
Modifier and Type | Class and Description |
---|---|
private static class |
BindingSourceRestriction.PermitMapConstruction.PermitMapImpl |
Modifier and Type | Field and Description |
---|---|
(package private) com.google.common.collect.ImmutableSet<java.lang.Class<? extends java.lang.annotation.Annotation>> |
currentModulePermits |
(package private) java.util.Map<ModuleSource,com.google.common.collect.ImmutableSet<java.lang.Class<? extends java.lang.annotation.Annotation>>> |
modulePermits |
(package private) java.util.Deque<com.google.common.collect.ImmutableSet<java.lang.Class<? extends java.lang.annotation.Annotation>>> |
modulePermitsStack |
(package private) BindingSourceRestriction.PermitMapConstruction.PermitMapImpl |
permitMap |
Constructor and Description |
---|
PermitMapConstruction() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
finish()
Finishes the
BindingSourceRestriction.PermitMap . |
(package private) BindingSourceRestriction.PermitMap |
getPermitMap()
Returns a possibly unfinished map.
|
(package private) static boolean |
isElementSourceCleared(ElementSource elementSource) |
(package private) void |
popModule()
Called by the Binder when it exits a module's configure method.
|
(package private) void |
pushModule(java.lang.Class<?> module,
ModuleSource moduleSource)
Called by the Binder prior to entering a module's configure method.
|
(package private) void |
restoreCurrentModulePermits(ModuleSource moduleSource)
Sets the permits on the current module installation path to the permits on the given module
source so that subsequently installed modules may inherit them.
|
final java.util.Map<ModuleSource,com.google.common.collect.ImmutableSet<java.lang.Class<? extends java.lang.annotation.Annotation>>> modulePermits
com.google.common.collect.ImmutableSet<java.lang.Class<? extends java.lang.annotation.Annotation>> currentModulePermits
final java.util.Deque<com.google.common.collect.ImmutableSet<java.lang.Class<? extends java.lang.annotation.Annotation>>> modulePermitsStack
final BindingSourceRestriction.PermitMapConstruction.PermitMapImpl permitMap
BindingSourceRestriction.PermitMap getPermitMap()
void restoreCurrentModulePermits(ModuleSource moduleSource)
void pushModule(java.lang.Class<?> module, ModuleSource moduleSource)
void popModule()
void finish()
BindingSourceRestriction.PermitMap
. Called by the Binder when all modules are installed.static boolean isElementSourceCleared(ElementSource elementSource)