com.google.inject.spi
Class DependencyAndSource
java.lang.Object
com.google.inject.spi.DependencyAndSource
public final class DependencyAndSource
- extends Object
A combination of a Dependency and the source where the dependency was bound.
- Author:
- sameb@google.com (Sam Berlin)
DependencyAndSource
public DependencyAndSource(Dependency<?> dependency,
Object source)
getDependency
public Dependency<?> getDependency()
- Returns the Dependency, if one exists. For anything that can be referenced
by
Injector.getBinding(com.google.inject.Key), a dependency exists. A dependency will not
exist (and this will return null) for types initialized with
Binder.requestInjection(com.google.inject.TypeLiteral, T) or Injector.injectMembers(Object),
nor will it exist for objects injected into Providers bound with
LinkedBindingBuilder#toProvider(Provider).
getBindingSource
public String getBindingSource()
- Returns a string describing where this dependency was bound. If the binding
was just-in-time, there is no valid binding source, so this describes the
class in question.
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2006-2013 Google, Inc.. All Rights Reserved.