Package com.google.inject.grapher
Class TransitiveDependencyVisitor
- java.lang.Object
-
- com.google.inject.spi.DefaultBindingTargetVisitor<Object,Collection<Key<?>>>
-
- com.google.inject.grapher.TransitiveDependencyVisitor
-
- All Implemented Interfaces:
BindingTargetVisitor<Object,Collection<Key<?>>>
public class TransitiveDependencyVisitor extends DefaultBindingTargetVisitor<Object,Collection<Key<?>>>
BindingTargetVisitor
that returns aCollection
of theKey
s of eachBinding
's dependencies. Used byInjectorGrapher
to walk the dependency graph from a starting set ofBinding
s.
-
-
Constructor Summary
Constructors Constructor Description TransitiveDependencyVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Key<?>>
visit(ConstructorBinding<?> binding)
Visit a constructor binding.Collection<Key<?>>
visit(ConvertedConstantBinding<?> binding)
Visit a binding created from converting a bound instance to a new type.Collection<Key<?>>
visit(InstanceBinding<?> binding)
Visit a instance binding.Collection<Key<?>>
visit(LinkedKeyBinding<?> binding)
Visit a linked key binding.Collection<Key<?>>
visit(ProviderBinding<?> binding)
Visit a binding to aProvider
that delegates to the binding for the provided type.Collection<Key<?>>
visit(ProviderInstanceBinding<?> binding)
Visit a provider instance binding.Collection<Key<?>>
visit(ProviderKeyBinding<?> binding)
Visit a provider key binding.Collection<Key<?>>
visitOther(Binding<?> binding)
Default visit implementation.-
Methods inherited from class com.google.inject.spi.DefaultBindingTargetVisitor
visit, visit
-
-
-
-
Method Detail
-
visit
public Collection<Key<?>> visit(ConstructorBinding<?> binding)
Description copied from interface:BindingTargetVisitor
Visit a constructor binding. To resolve injections, an instance is instantiated by invokingconstructor
. This target is found only on injector bindings.- Specified by:
visit
in interfaceBindingTargetVisitor<Object,Collection<Key<?>>>
- Overrides:
visit
in classDefaultBindingTargetVisitor<Object,Collection<Key<?>>>
-
visit
public Collection<Key<?>> visit(ConvertedConstantBinding<?> binding)
Description copied from interface:BindingTargetVisitor
Visit a binding created from converting a bound instance to a new type. The source binding has the same binding annotation but a different type. This target is found only on injector bindings.- Specified by:
visit
in interfaceBindingTargetVisitor<Object,Collection<Key<?>>>
- Overrides:
visit
in classDefaultBindingTargetVisitor<Object,Collection<Key<?>>>
-
visit
public Collection<Key<?>> visit(InstanceBinding<?> binding)
Description copied from interface:BindingTargetVisitor
Visit a instance binding. The same instance is returned for every injection. This target is found in both module and injector bindings.- Specified by:
visit
in interfaceBindingTargetVisitor<Object,Collection<Key<?>>>
- Overrides:
visit
in classDefaultBindingTargetVisitor<Object,Collection<Key<?>>>
-
visit
public Collection<Key<?>> visit(LinkedKeyBinding<?> binding)
Description copied from interface:BindingTargetVisitor
Visit a linked key binding. The other key's binding is used to resolve injections. This target is found in both module and injector bindings.- Specified by:
visit
in interfaceBindingTargetVisitor<Object,Collection<Key<?>>>
- Overrides:
visit
in classDefaultBindingTargetVisitor<Object,Collection<Key<?>>>
-
visit
public Collection<Key<?>> visit(ProviderBinding<?> binding)
Description copied from interface:BindingTargetVisitor
Visit a binding to aProvider
that delegates to the binding for the provided type. This target is found only on injector bindings.- Specified by:
visit
in interfaceBindingTargetVisitor<Object,Collection<Key<?>>>
- Overrides:
visit
in classDefaultBindingTargetVisitor<Object,Collection<Key<?>>>
-
visit
public Collection<Key<?>> visit(ProviderInstanceBinding<?> binding)
Description copied from interface:BindingTargetVisitor
Visit a provider instance binding. The provider'sget
method is invoked to resolve injections. This target is found in both module and injector bindings.- Specified by:
visit
in interfaceBindingTargetVisitor<Object,Collection<Key<?>>>
- Overrides:
visit
in classDefaultBindingTargetVisitor<Object,Collection<Key<?>>>
-
visit
public Collection<Key<?>> visit(ProviderKeyBinding<?> binding)
Description copied from interface:BindingTargetVisitor
Visit a provider key binding. To resolve injections, the provider key is first resolved, then that provider'sget
method is invoked. This target is found in both module and injector bindings.- Specified by:
visit
in interfaceBindingTargetVisitor<Object,Collection<Key<?>>>
- Overrides:
visit
in classDefaultBindingTargetVisitor<Object,Collection<Key<?>>>
-
visitOther
public Collection<Key<?>> visitOther(Binding<?> binding)
Description copied from class:DefaultBindingTargetVisitor
Default visit implementation. Returnsnull
.- Overrides:
visitOther
in classDefaultBindingTargetVisitor<Object,Collection<Key<?>>>
- Since:
- 4.0
-
-