2009/3/31 Martin Gilday <[email protected]>:
> I'd like to have a converter which uses a Spring @service to do lookups.
> According to the docs "If a converter requires configuration you can
> plug in an Injector interface to the DefaultTypeConverter which can
> construct and inject converter objects via Spring or Guice."
>
> I'm unsure what it means by working with the DefaultTypeConverter. Are
> there any examples which show how to do this?
You could try something like this
public class MyServiceConverter implements ApplicationContextAware {
ApplicationContext context;
@Converter
public MyType convert(String name) {
return context.getbean(name, MyType.class);
}
}
letting spring do whatever dependency injection you require on the
converter object
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/