Package com.google.inject.spi
Class ModuleSource
- java.lang.Object
-
- com.google.inject.spi.ModuleSource
-
final class ModuleSource extends java.lang.Object
Associated to amodule
, provides the module class name, the parent modulesource
, and the call stack that ends just before the moduleconfigure(Binder)
method invocation.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
moduleClassName
The class name of module that thisModuleSource
associated to.private ModuleSource
parent
The parentmodule source
.private StackTraceElements.InMemoryStackTraceElement[]
partialCallStack
The chunk of call stack that starts from the parent moduleconfigure(Binder)
call and ends just before the moduleconfigure(Binder)
method invocation.
-
Constructor Summary
Constructors Modifier Constructor Description private
ModuleSource(ModuleSource parent, java.lang.Object module, java.lang.StackTraceElement[] partialCallStack)
Creates a newModuleSource
Object.(package private)
ModuleSource(java.lang.Object module, java.lang.StackTraceElement[] partialCallStack)
Creates a newModuleSource
with a null parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) ModuleSource
createChild(java.lang.Object module, java.lang.StackTraceElement[] partialCallStack)
Creates and returns a childModuleSource
corresponding to themodule
.(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 modulesource
.(package private) java.lang.StackTraceElement[]
getPartialCallStack()
Returns the chunk of call stack that starts from the parent moduleconfigure(Binder)
call and ends just before the moduleconfigure(Binder)
method invocation.(package private) int
getPartialCallStackSize()
Returns the size of partial call stack if stack trace collection is on otherwise zero.(package private) java.lang.StackTraceElement[]
getStackTrace()
Returns the full call stack that ends just before the moduleconfigure(Binder)
method invocation.(package private) int
getStackTraceSize()
Returns the size of call stack that ends just before the moduleconfigure(Binder)
method invocation (seegetStackTrace()
).(package private) int
size()
Returns the size ofModuleSources
chain (all parents) that ends at this object.
-
-
-
Field Detail
-
moduleClassName
private final java.lang.String moduleClassName
The class name of module that thisModuleSource
associated to.
-
parent
private final ModuleSource parent
The parentmodule source
.
-
partialCallStack
private final StackTraceElements.InMemoryStackTraceElement[] partialCallStack
The chunk of call stack that starts from the parent moduleconfigure(Binder)
call and ends just before the moduleconfigure(Binder)
method invocation. For a module without a parent module the chunk starts from the bottom of call stack. The array is non-empty if stack trace collection is on.
-
-
Constructor Detail
-
ModuleSource
ModuleSource(java.lang.Object module, java.lang.StackTraceElement[] partialCallStack)
Creates a newModuleSource
with a null parent.- Parameters:
module
- the corresponding modulepartialCallStack
- the chunk of call stack that starts from the parent moduleconfigure(Binder)
call and ends just before the moduleconfigure(Binder)
method invocation
-
ModuleSource
private ModuleSource(ModuleSource parent, java.lang.Object module, java.lang.StackTraceElement[] partialCallStack)
Creates a newModuleSource
Object.- Parameters:
parent
- the parent modulesource
module
- the corresponding modulepartialCallStack
- the chunk of call stack that starts from the parent moduleconfigure(Binder)
call and ends just before the moduleconfigure(Binder)
method invocation
-
-
Method Detail
-
getModuleClassName
java.lang.String getModuleClassName()
Returns the corresponding module class name.- See Also:
Class.getName()
-
getPartialCallStack
java.lang.StackTraceElement[] getPartialCallStack()
Returns the chunk of call stack that starts from the parent moduleconfigure(Binder)
call and ends just before the moduleconfigure(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(java.lang.Object module, java.lang.StackTraceElement[] partialCallStack)
Creates and returns a childModuleSource
corresponding to themodule
.- Parameters:
module
- the corresponding modulepartialCallStack
- the chunk of call stack that starts from the parent moduleconfigure(Binder)
call and ends just before the moduleconfigure(Binder)
method invocation
-
getParent
ModuleSource getParent()
Returns the parent modulesource
.
-
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 objectgetModuleClassName()
. The second element is filled by the parent'sgetModuleClassName()
and so on.
-
size
int size()
Returns the size ofModuleSources
chain (all parents) that ends at this object.
-
getStackTraceSize
int getStackTraceSize()
Returns the size of call stack that ends just before the moduleconfigure(Binder)
method invocation (seegetStackTrace()
).
-
getStackTrace
java.lang.StackTraceElement[] getStackTrace()
Returns the full call stack that ends just before the moduleconfigure(Binder)
method invocation. The return array is non-empty if stack trace collection on.
-
-