}
public void testBindingWithErrorsAndCustomEditors() throws Exception {
TestBean rod = new TestBean();
DataBinder binder = new DataBinder(rod, "person");
binder.registerCustomEditor(String.class, "touchy", new PropertyEditorSupport() {
public void setAsText(String text) throws IllegalArgumentException {
setValue("prefix_" + text);
}
public String getAsText() {
return getValue().toString().substring(7);
}
});
binder.registerCustomEditor(TestBean.class, "spouse", new PropertyEditorSupport() {
public void setAsText(String text) throws IllegalArgumentException {
setValue(new TestBean(text, 0));
}
public String getAsText() {
return ((TestBean) getValue()).getName();