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, isConstant
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
acceptScopingVisitor, getKey
acceptVisitor, getSource
public InstanceBindingImpl(Injector injector, Key<T> key, Object source, InternalFactory<? extends T> internalFactory, Set<InjectionPoint> injectionPoints, T instance)
public Provider<T> getProvider()
Binding
getProvider
in interface Binding<T>
getProvider
in class BindingImpl<T>
public <V> V acceptTargetVisitor(BindingTargetVisitor<? super T,V> visitor)
Binding
acceptTargetVisitor
in interface Binding<T>
visitor
- to call back onpublic T getInstance()
InstanceBinding
getInstance
in interface InstanceBinding<T>
public Set<InjectionPoint> getInjectionPoints()
InstanceBinding
getInjectionPoints
in interface InstanceBinding<T>
public Set<Dependency<?>> getDependencies()
HasDependencies
Injector
will be
included in the returned set.getDependencies
in interface HasDependencies
public 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)
Element
public String toString()
toString
in class BindingImpl<T>
Copyright © 2009–2017. All rights reserved.