@Override public InjectionResolver<?> compute(SystemInjecteeImpl key) { return perLocatorUtilities.getInjectionResolver(getMe(), key); }
@Override public InjectionResolver<?> compute(SystemInjecteeImpl key) { return perLocatorUtilities.getInjectionResolver(getMe(), key); }
@Override public InjectionResolver<?> compute(SystemInjecteeImpl key) { return perLocatorUtilities.getInjectionResolver(getMe(), key); }
@Override public InjectionResolver<?> compute(SystemInjecteeImpl key) { return perLocatorUtilities.getInjectionResolver(getMe(), key); }
/** * Returns an injection resolver for this AnnotatedElement. The method cannot be used for constructors * or methods. * * @param locator The locator to use when finding the resolver * @param annotatedGuy The annotated class or producer method * @return The scope of this class or producer method. If no scope is * found will return the dependent scope * @throws IllegalStateException If we could not find a valid resolver */ /* package */ InjectionResolver<?> getInjectionResolver( ServiceLocatorImpl locator, AnnotatedElement annotatedGuy) throws IllegalStateException { if (annotatedGuy instanceof Method || annotatedGuy instanceof Constructor<?>) { throw new IllegalArgumentException("Annotated element '" + annotatedGuy + "' can be neither a Method nor a Constructor."); } return getInjectionResolver(locator, annotatedGuy, -1); }
/** * Returns an injection resolver for this AnnotatedElement. The method cannot be used for constructors * or methods. * * @param locator The locator to use when finding the resolver * @param annotatedGuy The annotated class or producer method * @return The scope of this class or producer method. If no scope is * found will return the dependent scope * @throws IllegalStateException If we could not find a valid resolver */ /* package */ InjectionResolver<?> getInjectionResolver( ServiceLocatorImpl locator, AnnotatedElement annotatedGuy) throws IllegalStateException { if (annotatedGuy instanceof Method || annotatedGuy instanceof Constructor<?>) { throw new IllegalArgumentException("Annotated element '" + annotatedGuy + "' can be neither a Method nor a Constructor."); } return getInjectionResolver(locator, annotatedGuy, -1); }
/** * Returns an injection resolver for this AnnotatedElement. The method cannot be used for constructors * or methods. * * @param locator The locator to use when finding the resolver * @param annotatedGuy The annotated class or producer method * @return The scope of this class or producer method. If no scope is * found will return the dependent scope * @throws IllegalStateException If we could not find a valid resolver */ /* package */ InjectionResolver<?> getInjectionResolver( ServiceLocatorImpl locator, AnnotatedElement annotatedGuy) throws IllegalStateException { if (annotatedGuy instanceof Method || annotatedGuy instanceof Constructor<?>) { throw new IllegalArgumentException("Annotated element '" + annotatedGuy + "' can be neither a Method nor a Constructor."); } return getInjectionResolver(locator, annotatedGuy, -1); }
/** * Returns an injection resolver for this AnnotatedElement. The method cannot be used for constructors * or methods. * * @param locator The locator to use when finding the resolver * @param annotatedGuy The annotated class or producer method * @return The scope of this class or producer method. If no scope is * found will return the dependent scope * @throws IllegalStateException If we could not find a valid resolver */ /* package */ InjectionResolver<?> getInjectionResolver( ServiceLocatorImpl locator, AnnotatedElement annotatedGuy) throws IllegalStateException { if (annotatedGuy instanceof Method || annotatedGuy instanceof Constructor<?>) { throw new IllegalArgumentException("Annotated element '" + annotatedGuy + "' can be neither a Method nor a Constructor."); } return getInjectionResolver(locator, annotatedGuy, -1); }
/** * Returns an injection resolver for the injectee * * @param locator The locator to use when finding the resolver * @param injectee Injectee from which the annotation should be extracted * @return Injection resolver used to resolve the injection for the injectee * @throws IllegalStateException If we could not find a valid resolver */ public InjectionResolver<?> getInjectionResolver( ServiceLocatorImpl locator, SystemInjecteeImpl injectee) throws IllegalStateException { return getInjectionResolver(locator, injectee.getParent(), injectee.getPosition()); }
/** * Returns an injection resolver for the injectee * * @param locator The locator to use when finding the resolver * @param injectee Injectee from which the annotation should be extracted * @return Injection resolver used to resolve the injection for the injectee * @throws IllegalStateException If we could not find a valid resolver */ public InjectionResolver<?> getInjectionResolver( ServiceLocatorImpl locator, SystemInjecteeImpl injectee) throws IllegalStateException { return getInjectionResolver(locator, injectee.getParent(), injectee.getPosition()); }
/** * Returns an injection resolver for the injectee * * @param locator The locator to use when finding the resolver * @param injectee Injectee from which the annotation should be extracted * @return Injection resolver used to resolve the injection for the injectee * @throws IllegalStateException If we could not find a valid resolver */ public InjectionResolver<?> getInjectionResolver( ServiceLocatorImpl locator, Injectee injectee) throws IllegalStateException { return getInjectionResolver(locator, injectee.getParent(), injectee.getPosition()); }
/** * Returns an injection resolver for the injectee * * @param locator The locator to use when finding the resolver * @param injectee Injectee from which the annotation should be extracted * @return Injection resolver used to resolve the injection for the injectee * @throws IllegalStateException If we could not find a valid resolver */ public InjectionResolver<?> getInjectionResolver( ServiceLocatorImpl locator, SystemInjecteeImpl injectee) throws IllegalStateException { return getInjectionResolver(locator, injectee.getParent(), injectee.getPosition()); }
InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, field); InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null);
InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, field); InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null);
InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, field); InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null);
InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, field); InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null);
/** * Just creates the thing, doesn't try to do anything else * @param createMe The thing to create * @param locator The locator to find the injection points with * @param strategy The strategy to use for analyzing the class * @return The constructed thing, no further injection is performed */ @SuppressWarnings("unchecked") public static <T> T justCreate(Class<T> createMe, ServiceLocatorImpl locator, String strategy) { if (createMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); Constructor<?> c = getConstructor(createMe, analyzer, collector); collector.throwIfErrors(); List<SystemInjecteeImpl> injectees = getConstructorInjectees(c, null); validateSelfInjectees(null, injectees, collector); collector.throwIfErrors(); Object args[] = new Object[injectees.size()]; for (SystemInjecteeImpl injectee : injectees) { InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null); } try { return (T) ReflectionHelper.makeMe(c, args, locator.getNeutralContextClassLoader()); } catch (Throwable th) { throw new MultiException(th); } }
/** * Just creates the thing, doesn't try to do anything else * @param createMe The thing to create * @param locator The locator to find the injection points with * @param strategy The strategy to use for analyzing the class * @return The constructed thing, no further injection is performed */ @SuppressWarnings("unchecked") public static <T> T justCreate(Class<T> createMe, ServiceLocatorImpl locator, String strategy) { if (createMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); Constructor<?> c = getConstructor(createMe, analyzer, collector); collector.throwIfErrors(); List<SystemInjecteeImpl> injectees = getConstructorInjectees(c, null); validateSelfInjectees(null, injectees, collector); collector.throwIfErrors(); Object args[] = new Object[injectees.size()]; for (SystemInjecteeImpl injectee : injectees) { InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null); } try { return (T) ReflectionHelper.makeMe(c, args, locator.getNeutralContextClassLoader()); } catch (Throwable th) { throw new MultiException(th); } }
/** * Just creates the thing, doesn't try to do anything else * @param createMe The thing to create * @param locator The locator to find the injection points with * @param strategy The strategy to use for analyzing the class * @return The constructed thing, no further injection is performed */ @SuppressWarnings("unchecked") public static <T> T justCreate(Class<T> createMe, ServiceLocatorImpl locator, String strategy) { if (createMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); Constructor<?> c = getConstructor(createMe, analyzer, collector); collector.throwIfErrors(); List<SystemInjecteeImpl> injectees = getConstructorInjectees(c, null); validateSelfInjectees(null, injectees, collector); collector.throwIfErrors(); Object args[] = new Object[injectees.size()]; for (SystemInjecteeImpl injectee : injectees) { InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null); } try { return (T) ReflectionHelper.makeMe(c, args, locator.getNeutralContextClassLoader()); } catch (Throwable th) { throw new MultiException(th); } }
/** * Just creates the thing, doesn't try to do anything else * @param createMe The thing to create * @param locator The locator to find the injection points with * @param strategy The strategy to use for analyzing the class * @return The constructed thing, no further injection is performed */ @SuppressWarnings("unchecked") public static <T> T justCreate(Class<T> createMe, ServiceLocatorImpl locator, String strategy) { if (createMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); Constructor<?> c = getConstructor(createMe, analyzer, collector); collector.throwIfErrors(); List<SystemInjecteeImpl> injectees = getConstructorInjectees(c, null); validateSelfInjectees(null, injectees, collector); collector.throwIfErrors(); Object args[] = new Object[injectees.size()]; for (SystemInjecteeImpl injectee : injectees) { InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null); } try { return (T) ReflectionHelper.makeMe(c, args, locator.getNeutralContextClassLoader()); } catch (Throwable th) { throw new MultiException(th); } }