Top Description Fields Constructors Methods
com.google.inject.spi

pack-priv final Class ModuleSource

extends Object
Class Inheritance
Imports
com.google.common.base.Preconditions, com.google.common.collect.ImmutableList, com.google.inject.Module, java.util.List, javax.annotation.Nullable

Associated to a module, provides the module class name, the parent module source, and the call stack that ends just before the module configure(Binder) method invocation.

Field Summary

Modifier and TypeField and Description
private final String
moduleClassName

The class name of module that this ModuleSource associated to.

private final ModuleSource
parent

The parent module source.

private final BindingSourceRestriction.PermitMap
permitMap

Permit map created by the binder that installed this module.

Constructor Summary

AccessConstructor and Description
pack-priv
ModuleSource(Class<?>
the corresponding module
moduleClass
,
BindingSourceRestriction.PermitMap permitMap)

Creates a new ModuleSource with a null parent.

private
ModuleSource(ModuleSource
the parent module source
parent
,
Class<?>
the corresponding module
moduleClass
,
BindingSourceRestriction.PermitMap
the chunk of call stack that starts from the parent module configure(Binder) call and ends just before the module configure(Binder) method invocation
permitMap
)

Creates a new ModuleSource Object.

Method Summary

Modifier and TypeMethod and Description
pack-priv ModuleSource
createChild(Class<?>
the corresponding module
moduleClass
)

Creates and returns a child ModuleSource corresponding to the module.

pack-priv String
getModuleClassName()

Returns the corresponding module class name.

pack-priv List<String>
getModuleClassNames()

Returns the class names of modules in this module source.

pack-priv ModuleSource
getParent()

Returns the parent module source.

pack-priv BindingSourceRestriction.PermitMap
getPermitMap()

Returns the permit map created by the binder that installed this module.

pack-priv int
size()

Returns the size of ModuleSources chain (all parents) that ends at this object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

moduleClassNameback to summary
private final String moduleClassName

The class name of module that this ModuleSource associated to.

parentback to summary
private final ModuleSource parent

The parent module source.

permitMapback to summary
private final BindingSourceRestriction.PermitMap permitMap

Permit map created by the binder that installed this module.

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.

Constructor Detail

ModuleSourceback to summary
pack-priv ModuleSource(Class<?> moduleClass, BindingSourceRestriction.PermitMap permitMap)

Creates a new ModuleSource with a null parent.

Parameters
moduleClass:Class<?>

the corresponding module

ModuleSourceback to summary
private ModuleSource(ModuleSource parent, Class<?> moduleClass, BindingSourceRestriction.PermitMap permitMap)

Creates a new ModuleSource Object.

Parameters
parent:ModuleSource

the parent module source

moduleClass:Class<?>

the corresponding module

permitMap:BindingSourceRestriction.PermitMap

the chunk of call stack that starts from the parent module configure(Binder) call and ends just before the module configure(Binder) method invocation

Method Detail

createChildback to summary
pack-priv ModuleSource createChild(Class<?> moduleClass)

Creates and returns a child ModuleSource corresponding to the module.

Parameters
moduleClass:Class<?>

the corresponding module

getModuleClassNameback to summary
pack-priv String getModuleClassName()

Returns the corresponding module class name.

See Also
Class#getName()
getModuleClassNamesback to summary
pack-priv List<String> getModuleClassNames()

Returns the class names of modules in this module source. The first element (index 0) is filled by this object getModuleClassName(). The second element is filled by the parent's getModuleClassName() and so on.

getParentback to summary
pack-priv ModuleSource getParent()

Returns the parent module source.

getPermitMapback to summary
pack-priv BindingSourceRestriction.PermitMap getPermitMap()

Returns the permit map created by the binder that installed this module.

sizeback to summary
pack-priv int size()

Returns the size of ModuleSources chain (all parents) that ends at this object.