protected void bind(Object source, Object targetValue) { DataBinder binder = new DataBinder(source); binder.bind( new MutablePropertyValues(Collections.singletonMap(change.getPropertyName(), targetValue))); if (binder.getBindingResult().hasErrors()) { throw new StudyCalendarSystemException( "Unable to update property value", new BindException(binder.getBindingResult())); } }
public void revert(Changeable target) { bind(target, getAssignableValue(change.getOldValue())); }
public void apply(Changeable source) { bind(source, getAssignableValue(change.getNewValue())); }