private DynamicBeanIntroductor introductor = new DynamicBeanIntroductor();
private MemoryRepository store;
protected Object formBackingObject(HttpServletRequest request) throws Exception {
IOffice office = store.getOffice(request.getParameter("officeId"));
OfficeView view = null;
if (office != null) {
IntroductorSet set = new IntroductorSet(office.getEmployees(), new Class[]{EmployeeView.class}, new Class[]{IEmployee.class}, this.introductor);
view = (OfficeView) this.introductor.introduceInterfaces(office, new Class[]{OfficeView.class}, new Class[]{IOffice.class});
view.setSelectableEmployees(set);
} else {
throw new RuntimeException("No office.");
}
return view;
}