Class ModuleSource


  • final class ModuleSource
    extends java.lang.Object
    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 Detail

      • moduleClassName

        private final java.lang.String moduleClassName
        The class name of module that this ModuleSource associated to.
      • permitMap

        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.

    • Method Detail

      • getModuleClassName

        java.lang.String getModuleClassName()
        Returns the corresponding module class name.
        See Also:
        Class.getName()
      • createChild

        ModuleSource createChild​(java.lang.Class<?> moduleClass)
        Creates and returns a child ModuleSource corresponding to the module.
        Parameters:
        moduleClass - the corresponding module
      • getModuleClassNames

        java.util.List<java.lang.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.
      • size

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