final List<InjectionTask> accumulator = new ArrayList<InjectionTask>();
final Set<Class<? extends Annotation>> decorators = ctx.getDecoratorAnnotations();
for (final Class<? extends Annotation> decorator : decorators) {
if (type.isAnnotationPresent(decorator)) {
accumulator.add(new InjectionTask(injector, type));
}
}
MetaClass visit = type;
do {
for (final MetaField field : visit.getDeclaredFields()) {
if (isInjectionPoint(ctx, field)) {
if (!field.isPublic()) {
final MetaMethod meth = visit.getMethod(ReflectionUtil.getSetter(field.getName()),
field.getType());
if (meth == null) {
final InjectionTask task = new InjectionTask(injector, field);
accumulator.add(task);
}
else {
final InjectionTask task = new InjectionTask(injector, meth);
accumulator.add(task);
}
}
else {
accumulator.add(new InjectionTask(injector, field));
}
}
ElementType[] elTypes;
for (final Class<? extends Annotation> a : decorators) {
elTypes = a.isAnnotationPresent(Target.class) ? a.getAnnotation(Target.class).value()
: new ElementType[]{ElementType.FIELD};
for (final ElementType elType : elTypes) {
switch (elType) {
case FIELD:
if (field.isAnnotationPresent(a)) {
accumulator.add(new DecoratorTask(injector, field, ctx.getDecorator(a)));
}
break;
}
}
}
}
for (final MetaMethod meth : visit.getDeclaredMethods()) {
if (isInjectionPoint(ctx, meth)) {
accumulator.add(new InjectionTask(injector, meth));
}
for (final Class<? extends Annotation> a : decorators) {
final ElementType[] elTypes = a.isAnnotationPresent(Target.class) ? a.getAnnotation(Target.class).value()
: new ElementType[]{ElementType.FIELD};