@Override public MutablePicoContainer addComponent(final Object key, final Object implOrInstance, final Parameter... parameters) throws PicoCompositionException { return DefaultPicoContainer.this.addComponent(key, implOrInstance, properties, new ConstructorParameters(parameters), null, null); }
@Override public String toString() { return "ConstructorParameters Parameters = " + Arrays.deepToString(this.getParams()); }
@Override public Object run(final Object inst) { final Constructor constructor = getGreediestSatisfiableConstructor(guardedContainer).getConstructor(); final Class[] parameterTypes = constructor.getParameterTypes(); final ConstructorParameters constructorParameters = (ConstructorParameters) (parameters != null && parameters.length > 0 ? parameters[0] : new ConstructorParameters()); final Parameter[] currentParameters = constructorParameters.getParams() != null ? constructorParameters.getParams() : createDefaultParameters(parameterTypes.length); for (int i = 0; i < currentParameters.length; i++) { currentParameters[i].verify(container, ConstructorInjector.this, box(parameterTypes[i]), new ParameterNameBinding(getParanamer(), constructor, i), useNames(), getBindings(constructor.getParameterAnnotations())[i]); } return null; } };
@Override public Object run(final Object inst) { final Constructor constructor = getGreediestSatisfiableConstructor(guardedContainer).getConstructor(); final Class[] parameterTypes = constructor.getParameterTypes(); final ConstructorParameters constructorParameters = (ConstructorParameters) (parameters != null && parameters.length > 0 ? parameters[0] : new ConstructorParameters()); final Parameter[] currentParameters = constructorParameters.getParams() != null ? constructorParameters.getParams() : createDefaultParameters(parameterTypes.length); for (int i = 0; i < currentParameters.length; i++) { currentParameters[i].verify(container, ConstructorInjector.this, box(parameterTypes[i]), new ParameterNameBinding(getParanamer(), constructor, i), useNames(), getBindings(constructor.getParameterAnnotations())[i]); } return null; } };
Annotation[] bindings = getBindings(sortedMatchingConstructor.getParameterAnnotations()); final ConstructorParameters constructorParameters = (ConstructorParameters) (parameters != null && parameters.length > 0 ? parameters[0] : new ConstructorParameters()); final Parameter[] currentParameters = constructorParameters.getParams() != null ? constructorParameters.getParams() : createDefaultParameters(parameterTypes.length);
@Override public MutablePicoContainer addComponent(final Object key, final Object implOrInstance, final Parameter... parameters) throws PicoCompositionException { return DefaultPicoContainer.this.addComponent(key, implOrInstance, properties, new ConstructorParameters(parameters), null, null); }
@Override public String toString() { return "ConstructorParameters Parameters = " + Arrays.deepToString(this.getParams()); }
Annotation[] bindings = getBindings(sortedMatchingConstructor.getParameterAnnotations()); final ConstructorParameters constructorParameters = (ConstructorParameters) (parameters != null && parameters.length > 0 ? parameters[0] : new ConstructorParameters()); final Parameter[] currentParameters = constructorParameters.getParams() != null ? constructorParameters.getParams() : createDefaultParameters(parameterTypes.length);
/*** * Convenience method that allows creation of a constructor injector with specific, optional parameters. * @param key * @param impl * @param params */ public ConstructorInjector(final Object key, final Class<T> impl, final Parameter... params) { this(key, impl, (params == null || params.length == 0) ? (ConstructorParameters)null : new ConstructorParameters(params)); }
final MethodParameters[] methodParameters) { Parameter[] tweakedParameters = (constructorParameters != null) ? constructorParameters.getParams() : null; key, (Class<?>) implOrInstance, new ConstructorParameters(tweakedParameters), fieldParameters, methodParameters); removeGenericPropertiesThatWeDontCareAbout(tmpProperties); throwIfPropertiesLeft(tmpProperties);
/*** * Convenience method that allows creation of a constructor injector with specific, optional parameters. * @param key * @param impl * @param params */ public ConstructorInjector(final Object key, final Class<T> impl, final Parameter... params) { this(key, impl, (params == null || params.length == 0) ? (ConstructorParameters)null : new ConstructorParameters(params)); }
final MethodParameters[] methodParameters) { Parameter[] tweakedParameters = (constructorParameters != null) ? constructorParameters.getParams() : null; key, (Class<?>) implOrInstance, new ConstructorParameters(tweakedParameters), fieldParameters, methodParameters); removeGenericPropertiesThatWeDontCareAbout(tmpProperties); throwIfPropertiesLeft(tmpProperties);
/** * Constructor injector that uses no monitor and no lifecycle adapter. This is a more * convenient constructor for use when instantiating a constructor injector directly. * * @param key the search key for this implementation * @param impl the concrete implementation * @param parameters the parameters used for initialization * @return */ public static <T> ComponentAdapter<T> constructor(final Object key, final Class<T> impl, final Parameter... parameters) { return new ConstructorInjection.ConstructorInjector<T>(key, impl, new ConstructorParameters(parameters)); }
/** * Constructor injector that uses no monitor and no lifecycle adapter. This is a more * convenient constructor for use when instantiating a constructor injector directly. * * @param key the search key for this implementation * @param impl the concrete implementation * @param parameters the parameters used for initialization * @return */ public static <T> ComponentAdapter<T> constructor(final Object key, final Class<T> impl, final Parameter... parameters) { return new ConstructorInjection.ConstructorInjector<T>(key, impl, new ConstructorParameters(parameters)); }
/** * Creates a ConstructorInjector * * @param key the search key for this implementation * @param impl the concrete implementation * @param monitor the component monitor used by this addAdapter * @param useNames use argument names when looking up dependencies * @param parameters the parameters to use for the initialization * @throws com.picocontainer.injectors.AbstractInjector.NotConcreteRegistrationException * if the implementation is not a concrete class. * @throws NullPointerException if one of the parameters is <code>null</code> * @return */ public static <T> ComponentAdapter<T> constructor(final Object key, final Class<T> impl, final ComponentMonitor monitor, final boolean useNames, final Parameter... parameters) { return new ConstructorInjection.ConstructorInjector<T>(monitor, useNames, key, impl, new ConstructorParameters(parameters)); }
/** * Creates a ConstructorInjector * * @param key the search key for this implementation * @param impl the concrete implementation * @param monitor the component monitor used by this addAdapter * @param useNames use argument names when looking up dependencies * @param parameters the parameters to use for the initialization * @throws com.picocontainer.injectors.AbstractInjector.NotConcreteRegistrationException * if the implementation is not a concrete class. * @throws NullPointerException if one of the parameters is <code>null</code> * @return */ public static <T> ComponentAdapter<T> constructor(final Object key, final Class<T> impl, final ComponentMonitor monitor, final boolean useNames, final Parameter... parameters) { return new ConstructorInjection.ConstructorInjector<T>(monitor, useNames, key, impl, new ConstructorParameters(parameters)); }
/** * Creates a ConstructorInjector * * @param key the search key for this implementation * @param impl the concrete implementation * @param monitor the component monitor used by this addAdapter * @param useNames use argument names when looking up dependencies * @param rememberChosenCtor remember the chosen constructor (to speed up second/subsequent calls) * @param parameters the parameters to use for the initialization * @throws com.picocontainer.injectors.AbstractInjector.NotConcreteRegistrationException * if the implementation is not a concrete class. * @throws NullPointerException if one of the parameters is <code>null</code> * @return */ public static <T> ComponentAdapter<T> constructor(final Object key, final Class<T> impl, final ComponentMonitor monitor, final boolean useNames, final boolean rememberChosenCtor, final Parameter... parameters) { return new ConstructorInjection.ConstructorInjector<T>(monitor, useNames, rememberChosenCtor, key, impl, new ConstructorParameters(parameters) ); }
/** * Creates a ConstructorInjector * * @param key the search key for this implementation * @param impl the concrete implementation * @param monitor the component monitor used by this addAdapter * @param useNames use argument names when looking up dependencies * @param rememberChosenCtor remember the chosen constructor (to speed up second/subsequent calls) * @param parameters the parameters to use for the initialization * @throws com.picocontainer.injectors.AbstractInjector.NotConcreteRegistrationException * if the implementation is not a concrete class. * @throws NullPointerException if one of the parameters is <code>null</code> * @return */ public static <T> ComponentAdapter<T> constructor(final Object key, final Class<T> impl, final ComponentMonitor monitor, final boolean useNames, final boolean rememberChosenCtor, final Parameter... parameters) { return new ConstructorInjection.ConstructorInjector<T>(monitor, useNames, rememberChosenCtor, key, impl, new ConstructorParameters(parameters) ); }
public MutablePicoContainer addComponent(final Object key, final Object implOrInstance, final ConstructorParameters constructorParams, final FieldParameters[] fieldParameters, final MethodParameters[] methodParams) { return this.addComponent(key, implOrInstance, containerProperties, constructorParams, fieldParameters, methodParams); }
public MutablePicoContainer addComponent(final Object key, final Object implOrInstance, final ConstructorParameters constructorParams, final FieldParameters[] fieldParameters, final MethodParameters[] methodParams) { return this.addComponent(key, implOrInstance, containerProperties, constructorParams, fieldParameters, methodParams); }