Package com.google.inject.internal
Class ConstructorBindingImpl<T>
java.lang.Object
com.google.inject.internal.BindingImpl<T>
com.google.inject.internal.ConstructorBindingImpl<T>
- All Implemented Interfaces:
Binding<T>
,DelayedInitialize
,ConstructorBinding<T>
,Element
,HasDependencies
final class ConstructorBindingImpl<T>
extends BindingImpl<T>
implements ConstructorBinding<T>, DelayedInitialize
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InjectionPoint
private final ConstructorBindingImpl.Factory<T>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ConstructorBindingImpl
(InjectorImpl injector, Key<T> key, Object source, InternalFactory<? extends T> scopedFactory, Scoping scoping, ConstructorBindingImpl.Factory<T> factory, InjectionPoint constructorInjectionPoint) ConstructorBindingImpl
(Key<T> key, Object source, Scoping scoping, InjectionPoint constructorInjectionPoint, Set<InjectionPoint> injectionPoints) -
Method Summary
Modifier and TypeMethodDescription<V> V
acceptTargetVisitor
(BindingTargetVisitor<? super T, V> visitor) Accepts a target visitor.void
Writes this module element to the given binder (optional operation).(package private) static <T> ConstructorBindingImpl<T>
create
(InjectorImpl injector, Key<T> key, InjectionPoint constructorInjector, Object source, Scoping scoping, Errors errors, boolean failIfNotLinked, boolean atInjectRequired) boolean
Gets the constructor this binding injects.Set<Dependency<?>>
Returns the known dependencies for this type.Returns all instance method and field injection points ontype
.(package private) InjectionPoint
Returns an injection point that can be used to clean up the constructor store.(package private) Set<Dependency<?>>
Returns a set of dependencies that can be iterated over to clean up stray JIT bindings.Returns the interceptors applied to each method, in the order that they will be applied.int
hashCode()
void
initialize
(InjectorImpl injector, Errors errors) Initializes this binding, throwing any errors if necessary.(package private) boolean
True if this binding has been initialized and is ready for use.toString()
protected BindingImpl<T>
protected BindingImpl<T>
withScoping
(Scoping scoping) Methods inherited from class com.google.inject.internal.BindingImpl
acceptScopingVisitor, acceptVisitor, getInjector, getInternalFactory, getKey, getProvider, getScoping, getSource, isConstant
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.inject.Binding
acceptScopingVisitor, getKey, getProvider
Methods inherited from interface com.google.inject.spi.Element
acceptVisitor, getSource
-
Field Details
-
factory
-
constructorInjectionPoint
-
-
Constructor Details
-
ConstructorBindingImpl
private ConstructorBindingImpl(InjectorImpl injector, Key<T> key, Object source, InternalFactory<? extends T> scopedFactory, Scoping scoping, ConstructorBindingImpl.Factory<T> factory, InjectionPoint constructorInjectionPoint) -
ConstructorBindingImpl
public ConstructorBindingImpl(Key<T> key, Object source, Scoping scoping, InjectionPoint constructorInjectionPoint, Set<InjectionPoint> injectionPoints)
-
-
Method Details
-
create
static <T> ConstructorBindingImpl<T> create(InjectorImpl injector, Key<T> key, InjectionPoint constructorInjector, Object source, Scoping scoping, Errors errors, boolean failIfNotLinked, boolean atInjectRequired) throws ErrorsException - Parameters:
constructorInjector
- the constructor to use, ornull
to use the default.failIfNotLinked
- true if this ConstructorBindingImpl's InternalFactory should only succeed if retrieved from a linked binding- Throws:
ErrorsException
-
initialize
Description copied from interface:DelayedInitialize
Initializes this binding, throwing any errors if necessary.- Specified by:
initialize
in interfaceDelayedInitialize
- Throws:
ErrorsException
-
isInitialized
boolean isInitialized()True if this binding has been initialized and is ready for use. -
getInternalConstructor
InjectionPoint getInternalConstructor()Returns an injection point that can be used to clean up the constructor store. -
getInternalDependencies
Set<Dependency<?>> getInternalDependencies()Returns a set of dependencies that can be iterated over to clean up stray JIT bindings. -
acceptTargetVisitor
Description copied from interface:Binding
Accepts a target visitor. Invokes the visitor method specific to this binding's target.- Specified by:
acceptTargetVisitor
in interfaceBinding<T>
- Parameters:
visitor
- to call back on
-
getConstructor
Description copied from interface:ConstructorBinding
Gets the constructor this binding injects.- Specified by:
getConstructor
in interfaceConstructorBinding<T>
-
getInjectableMembers
Description copied from interface:ConstructorBinding
Returns all instance method and field injection points ontype
.- Specified by:
getInjectableMembers
in interfaceConstructorBinding<T>
- Returns:
- a possibly empty set of injection points. The set has a specified iteration order. All fields are returned and then all methods. Within the fields, supertype fields are returned before subtype fields. Similarly, supertype methods are returned before subtype methods.
-
getMethodInterceptors
Description copied from interface:ConstructorBinding
Returns the interceptors applied to each method, in the order that they will be applied.- Specified by:
getMethodInterceptors
in interfaceConstructorBinding<T>
- Returns:
- a possibly empty map
-
getDependencies
Description copied from interface:HasDependencies
Returns the known dependencies for this type. If this has dependencies whose values are not known statically, a dependency for theInjector
will be included in the returned set.- Specified by:
getDependencies
in interfaceHasDependencies
- Returns:
- a possibly empty set
-
withScoping
- Overrides:
withScoping
in classBindingImpl<T>
-
withKey
- Overrides:
withKey
in classBindingImpl<T>
-
applyTo
Description copied from interface:Element
Writes this module element to the given binder (optional operation). -
toString
- Overrides:
toString
in classBindingImpl<T>
-
equals
-
hashCode
public int hashCode()
-