protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { binder.registerCustomEditor(Country.class, new CountryEditor(this.userManager)); binder.registerCustomEditor(Colour.class, new PropertyEditorSupport() { public void setAsText(String string) throws IllegalArgumentException { Short code = new Short(string); StaticLabeledEnumResolver resolver = new StaticLabeledEnumResolver(); setValue(resolver.getLabeledEnumByCode(Colour.class, code)); } }); }
public Object build( DefaultApplicationServices applicationServices ) { logger.info( "Creating default service impl: LabeledEnumResolver" ); return new StaticLabeledEnumResolver(); }