match = true;
final Iterator<Value> valuesIterator = arguments.iterator();
final Iterator<ConstructorParameter> parametersIterator = constructorParameters.iterator();
while (valuesIterator.hasNext()) {
final ConstructorParameter parameter = parametersIterator.next();
final Value value0 = valuesIterator.next();
if (false == value0.isCompatibleWith(parameter.getType())) {
match = false;
}
}
}
}
if (match) {
matchingConstructors.add(constructor);
context.debug("" + constructor);
}
return false;
}
};
final Type beanType = bean.getType();
visitor.start(beanType);
if (matchingConstructors.size() == 0) {
this.throwUnableToFindConstructor(bean);
}
if (matchingConstructors.size() > 1) {
this.throwTooManyConstructors(bean, matchingConstructors);
}
context.unbranch();
final Constructor constructor = (Constructor) matchingConstructors.get(0);
body.setBean(constructor);
final Iterator<ConstructorParameter> constructorParameters = constructor.getParameters().iterator();
final Iterator<Value> valuesIterator = arguments.iterator();
while (constructorParameters.hasNext()) {
final ConstructorParameter constructorParameter = constructorParameters.next();
final Value value = valuesIterator.next();
value.setPropertyType(constructorParameter.getType());
this.prepareValue(value);
}
if (context.isDebugEnabled()) {