/** * {@inheritDoc} */ @Override public <T> ComponentAdapter<T> createComponentAdapter(final ComponentMonitor monitor, final LifecycleStrategy lifecycle, final Properties componentProps, final Object key, final Class<T> impl, final ConstructorParameters constructorParams, final FieldParameters[] fieldParams, final MethodParameters[] methodParams) throws PicoCompositionException { boolean useNames = AbstractBehavior.arePropertiesPresent(componentProps, Characteristics.USE_NAMES, true); boolean requireConsumptionOfAllParameters = !(AbstractBehavior.arePropertiesPresent(componentProps, Characteristics.ALLOW_UNUSED_PARAMETERS, false)); ComponentAdapter<T> result = null; boolean noStatic = removePropertiesIfPresent(componentProps, Characteristics.NO_STATIC_INJECTION); //NO_STATIC_INJECTION takes precedence if (removePropertiesIfPresent(componentProps, Characteristics.STATIC_INJECTION) && !noStatic) { result = monitor.changedBehavior(new StaticInjection<T>(referenceSet, super.createComponentAdapter(monitor, lifecycle, componentProps, key, impl, constructorParams, fieldParams, methodParams) , useNames, requireConsumptionOfAllParameters, fieldParams, methodParams)); } if (result == null) { //static injection wasn't specified result = super.createComponentAdapter(monitor, lifecycle, componentProps, key, impl, constructorParams, fieldParams, methodParams); } return result; }
/** * {@inheritDoc} */ @Override public <T> ComponentAdapter<T> createComponentAdapter(final ComponentMonitor monitor, final LifecycleStrategy lifecycle, final Properties componentProps, final Object key, final Class<T> impl, final ConstructorParameters constructorParams, final FieldParameters[] fieldParams, final MethodParameters[] methodParams) throws PicoCompositionException { boolean useNames = AbstractBehavior.arePropertiesPresent(componentProps, Characteristics.USE_NAMES, true); boolean requireConsumptionOfAllParameters = !(AbstractBehavior.arePropertiesPresent(componentProps, Characteristics.ALLOW_UNUSED_PARAMETERS, false)); ComponentAdapter<T> result = null; boolean noStatic = removePropertiesIfPresent(componentProps, Characteristics.NO_STATIC_INJECTION); //NO_STATIC_INJECTION takes precedence if (removePropertiesIfPresent(componentProps, Characteristics.STATIC_INJECTION) && !noStatic) { result = monitor.changedBehavior(new StaticInjection<T>(referenceSet, super.createComponentAdapter(monitor, lifecycle, componentProps, key, impl, constructorParams, fieldParams, methodParams) , useNames, requireConsumptionOfAllParameters, fieldParams, methodParams)); } if (result == null) { //static injection wasn't specified result = super.createComponentAdapter(monitor, lifecycle, componentProps, key, impl, constructorParams, fieldParams, methodParams); } return result; }