/** * Reinjecting into a method. * @param key the component-key from the parent set of components to inject into * @param implementation the implementation of the component that is going to result. * @param instance the object that has the provider method to be invoked * @param reinjectionType the InjectionFactory to use for reinjection. * @return the result of the reinjection-method invocation. */ public Object reinject(final Class<?> key, final Class<?> implementation, final Object instance, final InjectionType reinjectionType) { return reinject(key, implementation, instance, NO_PROPERTIES, reinjectionType); }
/** * Reinjecting into a method. * @param key the component-key from the parent set of components to inject into * @param implementation the implementation of the component that is going to result. * @param instance the object that has the provider method to be invoked * @param reinjectionType the InjectionFactory to use for reinjection. * @return the result of the reinjection-method invocation. */ public Object reinject(final Class<?> key, final Class<?> implementation, final Object instance, final InjectionType reinjectionType) { return reinject(key, implementation, instance, NO_PROPERTIES, reinjectionType); }
/** * Reinjecting into a method. * @param key the component-key from the parent set of components to inject into * @param impl the implementation of the component that is going to result. * @param reinjectionType the InjectionFactory to use for reinjection. * @return */ public Object reinject(final Class<?> key, final Class<?> impl, final InjectionType reinjectionType) { return reinject(key, impl, parent.getComponentInto(key, ComponentAdapter.NOTHING.class), NO_PROPERTIES, reinjectionType); }
/** * Reinjecting into a method. * @param key the component-key from the parent set of components to inject into * @param impl the implementation of the component that is going to result. * @param reinjectionType the InjectionFactory to use for reinjection. * @return */ public Object reinject(final Class<?> key, final Class<?> impl, final InjectionType reinjectionType) { return reinject(key, impl, parent.getComponentInto(key, ComponentAdapter.NOTHING.class), NO_PROPERTIES, reinjectionType); }
/** * Reinjecting into a method. * @param key the component-key from the parent set of components to inject into (key and impl are the same) * @param reinjectionType the InjectionFactory to use for reinjection. * @return the result of the reinjection-method invocation. */ public Object reinject(final Class<?> key, final InjectionType reinjectionType) { Object o = reinject(key, key, parent.getComponentInto(Generic.get( key), ComponentAdapter.NOTHING.class), NO_PROPERTIES, reinjectionType); return o; }
public Object getComponentInstance(final PicoContainer container, final Type into) throws PicoCompositionException { if (provideMethod == AT_INJECT_GET) { try { return provideMethod.invoke(provider); } catch (Exception e) { throw new PicoCompositionException("Error invoking provider " + provider + " to inject into " + into, e); } // return provider; } else { return new Reinjector(container).reinject(key, provider.getClass(), provider, properties, new MethodInjection(provideMethod)); } }
/** * Reinjecting into a method. * @param key the component-key from the parent set of components to inject into (key and impl are the same) * @param reinjectionType the InjectionFactory to use for reinjection. * @return the result of the reinjection-method invocation. */ public Object reinject(final Class<?> key, final InjectionType reinjectionType) { Object o = reinject(key, key, parent.getComponentInto(Generic.get( key), ComponentAdapter.NOTHING.class), NO_PROPERTIES, reinjectionType); return o; }
public Object getComponentInstance(final PicoContainer container, final Type into) throws PicoCompositionException { if (provideMethod == AT_INJECT_GET) { try { return provideMethod.invoke(provider); } catch (Exception e) { throw new PicoCompositionException("Error invoking provider " + provider + " to inject into " + into, e); } // return provider; } else { return new Reinjector(container).reinject(key, provider.getClass(), provider, properties, new MethodInjection(provideMethod)); } }
/** * Reinjecting into a method. * @param key the component-key from the parent set of components to inject into * @param reinjectionMethod the reflection method to use for injection. * @return the result of the reinjection-method invocation. */ public Object reinject(final Class<?> key, final Method reinjectionMethod) { return reinject(key, key, parent.getComponentInto(Generic.get(key), ComponentAdapter.NOTHING.class), NO_PROPERTIES, new MethodInjection(reinjectionMethod)); }
/** * Reinjecting into a method. * @param key the component-key from the parent set of components to inject into * @param reinjectionMethod the reflection method to use for injection. * @return the result of the reinjection-method invocation. */ public Object reinject(final Class<?> key, final Method reinjectionMethod) { return reinject(key, key, parent.getComponentInto(Generic.get(key), ComponentAdapter.NOTHING.class), NO_PROPERTIES, new MethodInjection(reinjectionMethod)); }
/** * Reinjecting into a method. * @param key the component-key from the parent set of components to inject into * @param reinjectionMethodEnum the enum for the reflection method to use for injection. * @return the result of the reinjection-method invocation. */ public Object reinject(final Class<?> key, final Enum reinjectionMethodEnum) { return reinject(key, key, parent.getComponentInto(Generic.get(key), ComponentAdapter.NOTHING.class), NO_PROPERTIES, new MethodInjection(toMethod(reinjectionMethodEnum))); }
/** * Reinjecting into a method. * @param key the component-key from the parent set of components to inject into * @param reinjectionMethodEnum the enum for the reflection method to use for injection. * @return the result of the reinjection-method invocation. */ public Object reinject(final Class<?> key, final Enum reinjectionMethodEnum) { return reinject(key, key, parent.getComponentInto(Generic.get(key), ComponentAdapter.NOTHING.class), NO_PROPERTIES, new MethodInjection(toMethod(reinjectionMethodEnum))); }