Class ModuleSource

java.lang.Object
com.google.inject.spi.ModuleSource

final class ModuleSource extends 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 Details

  • Constructor Details

  • Method Details

    • getModuleClassName

      String getModuleClassName()
      Returns the corresponding module class name.
      See Also:
    • getPartialCallStack

      StackTraceElement[] getPartialCallStack()
      Returns the chunk of call stack that starts from the parent module configure(Binder) call and ends just before the module configure(Binder) method invocation. The return array is non-empty only if stack trace collection is on.
    • getPartialCallStackSize

      int getPartialCallStackSize()
      Returns the size of partial call stack if stack trace collection is on otherwise zero.
    • createChild

      ModuleSource createChild(Class<?> moduleClass, StackTraceElement[] partialCallStack)
      Creates and returns a child ModuleSource corresponding to the module.
      Parameters:
      moduleClass - the corresponding module
      partialCallStack - the chunk of call stack that starts from the parent module configure(Binder) call and ends just before the module configure(Binder) method invocation
    • getParent

      ModuleSource getParent()
      Returns the parent module source.
    • getModuleClassNames

      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.
    • size

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

      int getStackTraceSize()
      Returns the size of call stack that ends just before the module configure(Binder) method invocation (see getStackTrace()).
    • getStackTrace

      StackTraceElement[] getStackTrace()
      Returns the full call stack that ends just before the module configure(Binder) method invocation. The return array is non-empty if stack trace collection on.