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 InjectionPointprivate final ConstructorBindingImpl.Factory<T> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConstructorBindingImpl(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> VacceptTargetVisitor(BindingTargetVisitor<? super T, V> visitor) Accepts a target visitor.voidWrites 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 failIfNotExplicit) booleanGets 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) InjectionPointReturns 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.private static booleanhasAtInject(Constructor cxtor) Returns true if the inject annotation is on the constructor.inthashCode()voidinitialize(InjectorImpl injector, Errors errors) Initializes this binding, throwing any errors if necessary.(package private) booleanTrue 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, isConstantMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.inject.Binding
acceptScopingVisitor, getKey, getProviderMethods 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 failIfNotExplicit) throws ErrorsException - Parameters:
constructorInjector- the constructor to use, ornullto use the default.failIfNotLinked- true if this ConstructorBindingImpl's InternalFactory should only succeed if retrieved from a linked binding- Throws:
ErrorsException
-
hasAtInject
Returns true if the inject annotation is on the constructor. -
initialize
Description copied from interface:DelayedInitializeInitializes this binding, throwing any errors if necessary.- Specified by:
initializein 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:BindingAccepts a target visitor. Invokes the visitor method specific to this binding's target.- Specified by:
acceptTargetVisitorin interfaceBinding<T>- Parameters:
visitor- to call back on
-
getConstructor
Description copied from interface:ConstructorBindingGets the constructor this binding injects.- Specified by:
getConstructorin interfaceConstructorBinding<T>
-
getInjectableMembers
Description copied from interface:ConstructorBindingReturns all instance method and field injection points ontype.- Specified by:
getInjectableMembersin 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.
-
getDependencies
Description copied from interface:HasDependenciesReturns the known dependencies for this type. If this has dependencies whose values are not known statically, a dependency for theInjectorwill be included in the returned set.- Specified by:
getDependenciesin interfaceHasDependencies- Returns:
- a possibly empty set
-
withScoping
- Overrides:
withScopingin classBindingImpl<T>
-
withKey
- Overrides:
withKeyin classBindingImpl<T>
-
applyTo
Description copied from interface:ElementWrites this module element to the given binder (optional operation). -
toString
- Overrides:
toStringin classBindingImpl<T>
-
equals
-
hashCode
public int hashCode()
-