public class InstanceBindingImpl<T> extends BindingImpl<T> implements InstanceBinding<T>
| Constructor and Description |
|---|
InstanceBindingImpl(Injector injector,
Key<T> key,
Object source,
InternalFactory<? extends T> internalFactory,
Set<InjectionPoint> injectionPoints,
T instance) |
InstanceBindingImpl(Object source,
Key<T> key,
Scoping scoping,
Set<InjectionPoint> injectionPoints,
T instance) |
| Modifier and Type | Method and Description |
|---|---|
<V> V |
acceptTargetVisitor(BindingTargetVisitor<? super T,V> visitor)
Accepts a target visitor.
|
void |
applyTo(Binder binder)
Writes this module element to the given binder (optional operation).
|
Set<Dependency<?>> |
getDependencies()
Returns the known dependencies for this type.
|
Set<InjectionPoint> |
getInjectionPoints()
Returns the field and method injection points of the instance, injected at injector-creation
time only.
|
T |
getInstance()
Returns the user-supplied instance.
|
Provider<T> |
getProvider()
Returns the scoped provider guice uses to fulfill requests for this
binding.
|
String |
toString() |
BindingImpl<T> |
withKey(Key<T> key) |
BindingImpl<T> |
withScoping(Scoping scoping) |
acceptScopingVisitor, acceptVisitor, getInjector, getInternalFactory, getKey, getScoping, getSource, isConstantclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptScopingVisitor, getKeyacceptVisitor, getSourcepublic InstanceBindingImpl(Injector injector, Key<T> key, Object source, InternalFactory<? extends T> internalFactory, Set<InjectionPoint> injectionPoints, T instance)
public Provider<T> getProvider()
BindinggetProvider in interface Binding<T>getProvider in class BindingImpl<T>public <V> V acceptTargetVisitor(BindingTargetVisitor<? super T,V> visitor)
BindingacceptTargetVisitor in interface Binding<T>visitor - to call back onpublic T getInstance()
InstanceBindinggetInstance in interface InstanceBinding<T>public Set<InjectionPoint> getInjectionPoints()
InstanceBindinggetInjectionPoints in interface InstanceBinding<T>public Set<Dependency<?>> getDependencies()
HasDependenciesInjector will be
included in the returned set.getDependencies in interface HasDependenciespublic BindingImpl<T> withScoping(Scoping scoping)
withScoping in class BindingImpl<T>public BindingImpl<T> withKey(Key<T> key)
withKey in class BindingImpl<T>public void applyTo(Binder binder)
Elementpublic String toString()
toString in class BindingImpl<T>Copyright © 2009–2017. All rights reserved.