private static Collection<Binding> wire(BoundLocation bound, BindingContext context, Field field) throws IntrospectionException {
String target = bound.to();
final ObjectFieldMethod setter = context.findSetter(target);
final ObjectFieldMethod getter = context.findGetter(target);
if (setter == null || getter == null) {
throw new IllegalArgumentException("could not finder setter/getter for @BoundLocation: " + field);
}
final BindableModel model1 = context.getFieldObject(setter.getField(), BindableModel.class);
final BindableModel model2 = context.getFieldObject(getter.getField(), BindableModel.class);
assert model1 == model2;
if (Component.class.isAssignableFrom(field.getType())) {
final Component comp = context.getFieldObject(field, Component.class);
return bindComponent(bound, context, comp, setter, getter, model1);
} else {
throw new IllegalArgumentException("don't know how to wire up @BoundLocation field: " + field.getName());
}
}