Map<Method, Injectable<?>> singletons = new HashMap<Method, Injectable<?>>();
Map<Method, Injectable<?>> perRequest = new HashMap<Method, Injectable<?>>();
AccessibleObjectContext aoc = new AccessibleObjectContext();
for (AbstractSetterMethod sm : setterMethods) {
Parameter p = sm.getParameters().get(0);
aoc.setAccesibleObject(sm.getMethod(), p.getAnnotations());
if (p.getAnnotation() == null) continue;
if (s == ComponentScope.PerRequest) {
// Find a per request injectable with Parameter
Injectable i = ipc.getInjectable(
p.getAnnotation().annotationType(),
aoc,
p.getAnnotation(),
p,
ComponentScope.PerRequest);
if (i != null) {
perRequest.put(sm.getMethod(), i);
} else {
i = ipc.getInjectable(
p.getAnnotation().annotationType(),
aoc,
p.getAnnotation(),
p.getParameterType(),
ComponentScope.PERREQUEST_UNDEFINED
);
if (i != null) {
perRequest.put(sm.getMethod(), i);
} else {
i = ipc.getInjectable(
p.getAnnotation().annotationType(),
aoc,
p.getAnnotation(),
p.getParameterType(),
ComponentScope.Singleton
);
if (i != null) {
singletons.put(sm.getMethod(), i);
}
}
}
} else {
Injectable i = ipc.getInjectable(
p.getAnnotation().annotationType(),
aoc,
p.getAnnotation(),
p.getParameterType(),
ComponentScope.UNDEFINED_SINGLETON
);
if (i != null) {
singletons.put(sm.getMethod(), i);
}