Class<?> interfaceType = JavaIntrospectionHelper.getBaseType(element.getType(), element.getGenericType());
if (element.getAnchor() instanceof Field) {
Field field = (Field)element.getAnchor();
if (field.getType().isArray()) {
return new FieldInjector(field, new ArrayMultiplicityObjectFactory(interfaceType, factories));
} else {
return new FieldInjector(field, new ListMultiplicityObjectFactory(factories));
}
} else if (element.getAnchor() instanceof Method) {
Method method = (Method)element.getAnchor();
if (method.getParameterTypes()[0].isArray()) {
return new MethodInjector(method, new ArrayMultiplicityObjectFactory(interfaceType, factories));