element was bound.
The declaring source refers to a location in source code that
defines the Guice element. For example, if the element is created from a method
annotated by @Provides, the declaring source of element would be the method itself.
The sequence of class names of modules involved in the
element creation can be retrieved by getModuleClassNames(). The order of the module
class names is reverse chronological. The first module (index 0) is the module that installs the
element. The last module is the root module.
In order to support the cases where a Guice element is created from another
Guice element (original) (e.g., by Element#applyTo), it also provides a
reference to the original element source (getOriginalElementSource()).
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Object | declaringSource
Refers to a single location in source code that causes the element creation. |
| pack-priv final ModuleSource | moduleSource
The |
| pack-priv final ElementSource | originalElementSource
The |
| pack-priv final ModuleAnnotatedMethodScanner | scanner
The scanner that created this binding (if it was created by a scanner). |
| pack-priv final boolean | trustedOriginalElementSource
Wheather the originalElementSource was set externaly (untrusted) or by Guice internals (trusted). |
| Access | Constructor and Description |
|---|---|
| pack-priv | ElementSource(ElementSource
The source of element that this element was created from (if there is
any), otherwise originalSource, boolean trustedOriginalSource, Object null.the source (in)directly declared the element. declaringSource, ModuleSource the moduleSource when the element is bound moduleSource, ModuleAnnotatedMethodScanner scanner)Creates a new {@ElementSource } from the given parameters. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public List | |
| public ElementSource | |
| public String |
| declaringSource | back to summary |
|---|---|
| pack-priv final Object declaringSource Refers to a single location in source code that causes the element creation. It can be any
object such as | |
| moduleSource | back to summary |
|---|---|
| pack-priv final ModuleSource moduleSource The | |
| originalElementSource | back to summary |
|---|---|
| pack-priv final ElementSource originalElementSource The | |
| scanner | back to summary |
|---|---|
| pack-priv final ModuleAnnotatedMethodScanner scanner The scanner that created this binding (if it was created by a scanner). | |
| trustedOriginalElementSource | back to summary |
|---|---|
| pack-priv final boolean trustedOriginalElementSource Wheather the originalElementSource was set externaly (untrusted) or by Guice internals (trusted). External code can set the originalElementSource to an arbitrary ElementSource via Binder.withSource(ElementSource), thereby spoofing the element origin. | |
| ElementSource | back to summary |
|---|---|
| pack-priv ElementSource(ElementSource originalSource, boolean trustedOriginalSource, Object declaringSource, ModuleSource moduleSource, ModuleAnnotatedMethodScanner scanner) Creates a new {@ElementSource } from the given parameters.
| |
| getDeclaringSource | back to summary |
|---|---|
| public Object getDeclaringSource() Returns a single location in source code that defines the element. It can be any object such as
| |
| getModuleClassNames | back to summary |
|---|---|
| public List Returns the class names of modules involved in creating this | |
| getOriginalElementSource | back to summary |
|---|---|
| public ElementSource getOriginalElementSource() Returns the | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns
| |