final class ModuleSource
extends java.lang.Object
module, provides the module class name, the parent module source, and the call stack that ends just before the module configure(Binder) method invocation.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
moduleClassName
The class name of module that this
ModuleSource associated to. |
private ModuleSource |
parent
The parent
module source. |
private BindingSourceRestriction.PermitMap |
permitMap
Permit map created by the binder that installed this module.
|
| Modifier | Constructor and Description |
|---|---|
(package private) |
ModuleSource(java.lang.Class<?> moduleClass,
BindingSourceRestriction.PermitMap permitMap)
Creates a new
ModuleSource with a null parent. |
private |
ModuleSource(ModuleSource parent,
java.lang.Class<?> moduleClass,
BindingSourceRestriction.PermitMap permitMap)
Creates a new
ModuleSource Object. |
| Modifier and Type | Method and Description |
|---|---|
(package private) ModuleSource |
createChild(java.lang.Class<?> moduleClass)
Creates and returns a child
ModuleSource corresponding to the module. |
(package private) java.lang.String |
getModuleClassName()
Returns the corresponding module class name.
|
(package private) java.util.List<java.lang.String> |
getModuleClassNames()
Returns the class names of modules in this module source.
|
(package private) ModuleSource |
getParent()
Returns the parent module
source. |
(package private) BindingSourceRestriction.PermitMap |
getPermitMap()
Returns the permit map created by the binder that installed this module.
|
(package private) int |
size()
Returns the size of
ModuleSources chain (all parents) that ends at this
object. |
private final java.lang.String moduleClassName
ModuleSource associated to.private final ModuleSource parent
module source.private final BindingSourceRestriction.PermitMap permitMap
The permit map is a binder-scoped object, but it's saved here because these maps have to outlive the binders that created them in order to be used at injector creation, and there isn't a 'BinderSource' object.
ModuleSource(java.lang.Class<?> moduleClass,
BindingSourceRestriction.PermitMap permitMap)
ModuleSource with a null parent.moduleClass - the corresponding moduleprivate ModuleSource(@Nullable
ModuleSource parent,
java.lang.Class<?> moduleClass,
BindingSourceRestriction.PermitMap permitMap)
ModuleSource Object.parent - the parent module sourcemoduleClass - the corresponding modulepartialCallStack - the chunk of call stack that starts from the parent module configure(Binder) call and ends just before the module configure(Binder) method invocationjava.lang.String getModuleClassName()
Class.getName()ModuleSource createChild(java.lang.Class<?> moduleClass)
ModuleSource corresponding to the module.moduleClass - the corresponding moduleModuleSource getParent()
source.java.util.List<java.lang.String> getModuleClassNames()
getModuleClassName(). The second element is filled by the parent's
getModuleClassName() and so on.int size()
ModuleSources chain (all parents) that ends at this
object.BindingSourceRestriction.PermitMap getPermitMap()