}
// update existing fields if needed
subviews = view.getSubviews();
for (int i = 0; i < subviews.length; i++) {
final View subview = subviews[i];
final ObjectAssociation field = ((FieldContent) subview.getContent()).getField();
final ObjectAdapter value = field.get(object);
if (field.isOneToManyAssociation()) {
subview.update(value);
} else if (field.isOneToOneAssociation()) {
final ObjectAdapter existing = subview.getContent().getAdapter();
// if the field is parseable then it may have been modified; we
// need to replace what was
// typed in with the actual title.
if (!field.getSpecification().isParseable()) {
final boolean changedValue = value != existing;
final boolean isDestroyed = existing != null && existing.isDestroyed();
if (changedValue || isDestroyed) {
View fieldView;
fieldView = createFieldView(view, axes, object, i, field);
if (fieldView != null) {
view.replaceView(subview, decorateSubview(axes, fieldView));
} else {
view.addView(new FieldErrorView("No field for " + value));
}
}
} else {
if (AdapterUtils.exists(value) && !AdapterUtils.wrappedEqual(value, existing)) {
final View fieldView = createFieldView(view, axes, object, i, field);
view.replaceView(subview, decorateSubview(axes, fieldView));
} else {
subview.refresh();
}
}