final class ConstructorBindingImpl<T> extends BindingImpl<T> implements ConstructorBinding<T>, DelayedInitialize
Modifier and Type | Class and Description |
---|---|
private static class |
ConstructorBindingImpl.Factory<T> |
Modifier and Type | Field and Description |
---|---|
private InjectionPoint |
constructorInjectionPoint |
private ConstructorBindingImpl.Factory<T> |
factory |
Modifier | Constructor and Description |
---|---|
private |
ConstructorBindingImpl(InjectorImpl injector,
Key<T> key,
java.lang.Object source,
InternalFactory<? extends T> scopedFactory,
Scoping scoping,
ConstructorBindingImpl.Factory<T> factory,
InjectionPoint constructorInjectionPoint) |
|
ConstructorBindingImpl(Key<T> key,
java.lang.Object source,
Scoping scoping,
InjectionPoint constructorInjectionPoint,
java.util.Set<InjectionPoint> injectionPoints) |
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).
|
(package private) static <T> ConstructorBindingImpl<T> |
create(InjectorImpl injector,
Key<T> key,
InjectionPoint constructorInjector,
java.lang.Object source,
Scoping scoping,
Errors errors,
boolean failIfNotLinked,
boolean failIfNotExplicit) |
boolean |
equals(java.lang.Object obj) |
InjectionPoint |
getConstructor()
Gets the constructor this binding injects.
|
java.util.Set<Dependency<?>> |
getDependencies()
Returns the known dependencies for this type.
|
java.util.Set<InjectionPoint> |
getInjectableMembers()
Returns all instance method and field injection points on
type . |
(package private) InjectionPoint |
getInternalConstructor()
Returns an injection point that can be used to clean up the constructor store.
|
(package private) java.util.Set<Dependency<?>> |
getInternalDependencies()
Returns a set of dependencies that can be iterated over to clean up stray JIT bindings.
|
java.util.Map<java.lang.reflect.Method,java.util.List<org.aopalliance.intercept.MethodInterceptor>> |
getMethodInterceptors()
Returns the interceptors applied to each method, in the order that they will be applied.
|
private static boolean |
hasAtInject(java.lang.reflect.Constructor cxtor)
Returns true if the inject annotation is on the constructor.
|
int |
hashCode() |
void |
initialize(InjectorImpl injector,
Errors errors)
Initializes this binding, throwing any errors if necessary.
|
(package private) boolean |
isInitialized()
True if this binding has been initialized and is ready for use.
|
java.lang.String |
toString() |
protected BindingImpl<T> |
withKey(Key<T> key) |
protected BindingImpl<T> |
withScoping(Scoping scoping) |
acceptScopingVisitor, acceptVisitor, getInjector, getInternalFactory, getKey, getProvider, getScoping, getSource, isConstant
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
acceptScopingVisitor, getKey, getProvider
acceptVisitor, getSource
private final ConstructorBindingImpl.Factory<T> factory
private final InjectionPoint constructorInjectionPoint
private ConstructorBindingImpl(InjectorImpl injector, Key<T> key, java.lang.Object source, InternalFactory<? extends T> scopedFactory, Scoping scoping, ConstructorBindingImpl.Factory<T> factory, InjectionPoint constructorInjectionPoint)
public ConstructorBindingImpl(Key<T> key, java.lang.Object source, Scoping scoping, InjectionPoint constructorInjectionPoint, java.util.Set<InjectionPoint> injectionPoints)
static <T> ConstructorBindingImpl<T> create(InjectorImpl injector, Key<T> key, InjectionPoint constructorInjector, java.lang.Object source, Scoping scoping, Errors errors, boolean failIfNotLinked, boolean failIfNotExplicit) throws ErrorsException
constructorInjector
- the constructor to use, or null
to use the default.failIfNotLinked
- true if this ConstructorBindingImpl's InternalFactory should
only succeed if retrieved from a linked bindingErrorsException
private static boolean hasAtInject(java.lang.reflect.Constructor cxtor)
public void initialize(InjectorImpl injector, Errors errors) throws ErrorsException
DelayedInitialize
initialize
in interface DelayedInitialize
ErrorsException
boolean isInitialized()
InjectionPoint getInternalConstructor()
java.util.Set<Dependency<?>> getInternalDependencies()
public <V> V acceptTargetVisitor(BindingTargetVisitor<? super T,V> visitor)
Binding
acceptTargetVisitor
in interface Binding<T>
visitor
- to call back onpublic InjectionPoint getConstructor()
ConstructorBinding
getConstructor
in interface ConstructorBinding<T>
public java.util.Set<InjectionPoint> getInjectableMembers()
ConstructorBinding
type
.getInjectableMembers
in interface ConstructorBinding<T>
public java.util.Map<java.lang.reflect.Method,java.util.List<org.aopalliance.intercept.MethodInterceptor>> getMethodInterceptors()
ConstructorBinding
getMethodInterceptors
in interface ConstructorBinding<T>
public java.util.Set<Dependency<?>> getDependencies()
HasDependencies
Injector
will be
included in the returned set.getDependencies
in interface HasDependencies
protected BindingImpl<T> withScoping(Scoping scoping)
withScoping
in class BindingImpl<T>
protected BindingImpl<T> withKey(Key<T> key)
withKey
in class BindingImpl<T>
public void applyTo(Binder binder)
Element
public java.lang.String toString()
toString
in class BindingImpl<T>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object