Пример #1
0
 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()));
   }
 }
Пример #2
0
 public void revert(Changeable target) {
   bind(target, getAssignableValue(change.getOldValue()));
 }
Пример #3
0
 public void apply(Changeable source) {
   bind(source, getAssignableValue(change.getNewValue()));
 }