public PicoBuilder withMethodInjection() { addInjector(new MethodInjection()); return this; }
public PicoBuilder withMethodInjection() { addInjector(new MethodInjection()); return this; }
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)); } }
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)); }
public AdaptingInjection() { constructorInjection = new Jsr330ConstructorInjection(); methodInjection = new MethodInjection(); setterInjection = new SetterInjection(); annotatedMethodInjection = new AnnotatedMethodInjection(); annotatedFieldInjection = new AnnotatedFieldInjection(); }
/** * 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))); }
public AdaptingInjection() { constructorInjection = new Jsr330ConstructorInjection(); methodInjection = new MethodInjection(); setterInjection = new SetterInjection(); annotatedMethodInjection = new AnnotatedMethodInjection(); annotatedFieldInjection = new AnnotatedFieldInjection(); }
/** * 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))); }