public class ConstructorInjector<T> extends SingleMemberInjector<T>
| Modifier and Type | Class and Description |
|---|---|
protected class |
ConstructorInjector.CtorAndAdapters<TYPE> |
SingleMemberInjector.ParameterCannotBeNullExceptionAbstractInjector.AmbiguousComponentResolutionException, AbstractInjector.CyclicDependencyException, AbstractInjector.NotConcreteRegistrationException, AbstractInjector.UnsatisfiableDependenciesExceptionComponentAdapter.NOTHINGparameters, verifyingGuard| Constructor and Description |
|---|
ConstructorInjector(Object componentKey,
Class<?> componentImplementation,
Parameter... parameters)
Constructor injector that uses no monitor and no lifecycle adapter.
|
ConstructorInjector(Object componentKey,
Class componentImplementation,
Parameter[] parameters,
ComponentMonitor monitor,
boolean useNames)
Creates a ConstructorInjector
|
ConstructorInjector(Object componentKey,
Class componentImplementation,
Parameter[] parameters,
ComponentMonitor monitor,
boolean useNames,
boolean rememberChosenCtor)
Creates a ConstructorInjector
|
| Modifier and Type | Method and Description |
|---|---|
void |
enableEmjection(boolean enableEmjection) |
T |
getComponentInstance(PicoContainer container,
Type into)
Retrieve the component instance.
|
String |
getDescriptor()
Get a string key descriptor of the component adapter for use in toString()
|
protected ConstructorInjector.CtorAndAdapters<T> |
getGreediestSatisfiableConstructor(PicoContainer container) |
void |
verify(PicoContainer container)
Verify that all dependencies for this adapter can be satisfied.
|
ConstructorInjector<T> |
withNonPublicConstructors() |
boxParameters, getBindings, getMemberArguments, getParameter, getParanamer, isNullParamAllowed, nullCheckaccept, box, caughtIllegalAccessException, caughtIllegalAccessException, caughtInstantiationException, caughtInvocationTargetException, createDefaultParameters, decorateComponentInstance, getComponentInstance, newInstance, useNameschangeMonitor, checkTypeCompatibility, currentMonitor, findAdapterOfType, getComponentImplementation, getComponentKey, getDelegate, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindAdapterOfType, getComponentImplementation, getComponentKey, getDelegatepublic ConstructorInjector(Object componentKey, Class<?> componentImplementation, Parameter... parameters)
componentKey - the search key for this implementationcomponentImplementation - the concrete implementationparameters - the parameters used for initializationpublic ConstructorInjector(Object componentKey, Class componentImplementation, Parameter[] parameters, ComponentMonitor monitor, boolean useNames) throws AbstractInjector.NotConcreteRegistrationException
componentKey - the search key for this implementationcomponentImplementation - the concrete implementationparameters - the parameters to use for the initializationmonitor - the component monitor used by this addAdapteruseNames - use argument names when looking up dependenciesAbstractInjector.NotConcreteRegistrationException - if the implementation is not a concrete class.NullPointerException - if one of the parameters is nullpublic ConstructorInjector(Object componentKey, Class componentImplementation, Parameter[] parameters, ComponentMonitor monitor, boolean useNames, boolean rememberChosenCtor) throws AbstractInjector.NotConcreteRegistrationException
componentKey - the search key for this implementationcomponentImplementation - the concrete implementationparameters - the parameters to use for the initializationmonitor - the component monitor used by this addAdapteruseNames - use argument names when looking up dependenciesrememberChosenCtor - remember the chosen constructor (to speed up second/subsequent calls)AbstractInjector.NotConcreteRegistrationException - if the implementation is not a concrete class.NullPointerException - if one of the parameters is nullprotected ConstructorInjector.CtorAndAdapters<T> getGreediestSatisfiableConstructor(PicoContainer container) throws PicoCompositionException
PicoCompositionExceptionpublic void enableEmjection(boolean enableEmjection)
public ConstructorInjector<T> withNonPublicConstructors()
public T getComponentInstance(PicoContainer container, Type into) throws PicoCompositionException
ComponentAdapterCached will always return the
same instance.getComponentInstance in interface ComponentAdapter<T>getComponentInstance in class AbstractInjector<T>container - the PicoContainer, that is used to resolve any possible dependencies of the instance.into - the class that is about to be injected into. Use ComponentAdapter.NOTHING.class if this is not important to you.PicoCompositionException - if the component has dependencies which could not be resolved, or
instantiation of the component lead to an ambiguous situation within the
container.public void verify(PicoContainer container) throws PicoCompositionException
ComponentAdapterverify in interface ComponentAdapter<T>verify in class AbstractInjector<T>container - the PicoContainer, that is used to resolve any possible dependencies of the instance.PicoCompositionException - if one or more dependencies cannot be resolved.public String getDescriptor()
ComponentAdaptergetDescriptor in interface ComponentAdapter<T>getDescriptor in class AbstractInjector<T>Copyright © 2003-2014 Codehaus. All Rights Reserved.