use of org.springframework.tests.sample.beans.BeanWithObjectProperty in project spring-framework by spring-projects.
the class DataBinderTests method testBindingWithCustomEditorOnObjectField.
@Test
public void testBindingWithCustomEditorOnObjectField() {
BeanWithObjectProperty tb = new BeanWithObjectProperty();
DataBinder binder = new DataBinder(tb);
binder.registerCustomEditor(Integer.class, "object", new CustomNumberEditor(Integer.class, true));
MutablePropertyValues pvs = new MutablePropertyValues();
pvs.add("object", "1");
binder.bind(pvs);
assertEquals(new Integer(1), tb.getObject());
}
Aggregations