}
if (match == 0) {
throw new UnmarshallException("bean has no matches");
}
ObjectMatch m = null, tmp;
i = jso.keys();
while (i.hasNext()) {
String field = (String) i.next();
Method setMethod = bd.writableProps.get(field);
if (setMethod != null) {
try {
Class[] param = setMethod.getParameterTypes();
if (param.length != 1) {
throw new UnmarshallException("bean " + clazz.getName() + " method "
+ setMethod.getName() + " does not have one arg");
}
tmp = ser.tryUnmarshall(state, param[0], jso.get(field));
if (m == null) {
m = tmp;
} else {
m = m.max(tmp);
}
} catch (UnmarshallException e) {
throw new UnmarshallException("bean " + clazz.getName() + " " + e.getMessage());
}
} else {
mismatch++;
}
}
return m.max(new ObjectMatch(mismatch));
}