|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.picocontainer.injectors.Injector
public class Injector
convenience class providing static methods to conveniently create injectors ( like org.junit.Assert )
Constructor Summary | |
---|---|
Injector()
|
Method Summary | |
---|---|
static ComponentAdapter |
annotatedField(Object key,
Class<?> impl,
Parameter[] parameters,
ComponentMonitor componentMonitor,
Class<? extends Annotation> injectionAnnotation,
boolean useNames)
Convenience method to create annotated field injector |
static ComponentAdapter |
annotatedMethod(Object key,
Class<?> impl,
Parameter[] parameters,
ComponentMonitor monitor,
Class<? extends Annotation> injectionAnnotation,
boolean useNames)
convenience method to create annotated method injector |
static ComponentAdapter |
composite(Object componentKey,
Class<?> componentImplementation,
Parameter[] parameters,
ComponentMonitor monitor,
boolean useNames,
Injector... injectors)
creates composite injector |
static ComponentAdapter |
constructor(Object componentKey,
Class<?> componentImplementation,
Parameter... parameters)
Constructor injector that uses no monitor and no lifecycle adapter. |
static ComponentAdapter |
constructor(Object componentKey,
Class componentImplementation,
Parameter[] parameters,
ComponentMonitor monitor,
boolean useNames)
Creates a ConstructorInjector |
static ComponentAdapter |
constructor(Object componentKey,
Class componentImplementation,
Parameter[] parameters,
ComponentMonitor monitor,
boolean useNames,
boolean rememberChosenCtor)
Creates a ConstructorInjector |
static ComponentAdapter |
method(Object componentKey,
Class componentImplementation,
Parameter[] parameters,
ComponentMonitor monitor,
String methodName,
boolean useNames)
convenience method to create method injector |
static ComponentAdapter |
multi(Object componentKey,
Class componentImplementation,
Parameter[] parameters,
ComponentMonitor componentMonitor,
String setterPrefix,
boolean useNames)
convenience method to create multi component adapter |
static ComponentAdapter |
namedField(Object key,
Class<?> impl,
Parameter[] parameters,
ComponentMonitor componentMonitor,
String fieldNames)
convenience method to create named field injector |
static ComponentAdapter |
setter(Object componentKey,
Class componentImplementation,
Parameter[] parameters,
ComponentMonitor monitor,
String prefix,
boolean useNames)
convenience method to create setter injector |
static ComponentAdapter |
typedField(Object key,
Class<?> impl,
Parameter[] parameters,
ComponentMonitor componentMonitor,
String classNames)
conveniently create typed field injector |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Injector()
Method Detail |
---|
public static ComponentAdapter constructor(Object componentKey, Class<?> componentImplementation, Parameter... parameters)
componentKey
- the search key for this implementationcomponentImplementation
- the concrete implementationparameters
- the parameters used for initializationpublic static ComponentAdapter constructor(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 dependencies
AbstractInjector.NotConcreteRegistrationException
- if the implementation is not a concrete class.
NullPointerException
- if one of the parameters is null
public static ComponentAdapter constructor(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 null
public static ComponentAdapter annotatedField(Object key, Class<?> impl, Parameter[] parameters, ComponentMonitor componentMonitor, Class<? extends Annotation> injectionAnnotation, boolean useNames)
key
- impl
- parameters
- componentMonitor
- injectionAnnotation
- useNames
-
public static ComponentAdapter annotatedMethod(Object key, Class<?> impl, Parameter[] parameters, ComponentMonitor monitor, Class<? extends Annotation> injectionAnnotation, boolean useNames)
key
- impl
- parameters
- monitor
- injectionAnnotation
- useNames
-
public static ComponentAdapter composite(Object componentKey, Class<?> componentImplementation, Parameter[] parameters, ComponentMonitor monitor, boolean useNames, Injector... injectors)
componentKey
- componentImplementation
- parameters
- monitor
- useNames
- injectors
-
public static ComponentAdapter method(Object componentKey, Class componentImplementation, Parameter[] parameters, ComponentMonitor monitor, String methodName, boolean useNames) throws AbstractInjector.NotConcreteRegistrationException
componentKey
- componentImplementation
- parameters
- monitor
- methodName
- useNames
-
AbstractInjector.NotConcreteRegistrationException
public static ComponentAdapter multi(Object componentKey, Class componentImplementation, Parameter[] parameters, ComponentMonitor componentMonitor, String setterPrefix, boolean useNames)
componentKey
- componentImplementation
- parameters
- componentMonitor
- setterPrefix
- useNames
-
public static ComponentAdapter namedField(Object key, Class<?> impl, Parameter[] parameters, ComponentMonitor componentMonitor, String fieldNames)
key
- impl
- parameters
- componentMonitor
- fieldNames
-
public static ComponentAdapter setter(Object componentKey, Class componentImplementation, Parameter[] parameters, ComponentMonitor monitor, String prefix, boolean useNames) throws AbstractInjector.NotConcreteRegistrationException
componentKey
- componentImplementation
- parameters
- monitor
- prefix
- useNames
-
AbstractInjector.NotConcreteRegistrationException
public static ComponentAdapter typedField(Object key, Class<?> impl, Parameter[] parameters, ComponentMonitor componentMonitor, String classNames)
key
- impl
- parameters
- componentMonitor
- classNames
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |