factories.add(createWireFactory(wire));
}
if (member instanceof Field) {
Field field = (Field) member;
if (field.getType().isArray()) {
return new FieldInjector<Object>(field, new ArrayMultiplicityObjectFactory(interfaceType, factories));
} else {
return new FieldInjector<Object>(field, new ListMultiplicityObjectFactory(factories));
}
} else if (member instanceof Method) {
Method method = (Method) member;
if (method.getParameterTypes()[0].isArray()) {
return new MethodInjector<Object>(method, new ArrayMultiplicityObjectFactory(interfaceType, factories));
} else {
return new MethodInjector<Object>(method, new ListMultiplicityObjectFactory(factories));
}
} else {
InvalidAccessorException e = new InvalidAccessorException("Member must be a field or method");