Jan 17th, 2011, 03:42 AM
Type converters registered for a parameter type
I'm using Spring 2.5.6
I have a class which is used as a wrapper for values of different types. This wrapper is often returned from methods or other properties during Spring configuration and during runtime. In particular, it is often used to initiate job parameters for Spring Batch jobs.
The problem is in how I want to use it. When the value expression of property value element returns this wrapper class, but the type of the property to which it is applied is different, I want Spring to automatically extract the value from the wrapper and try to use that instead. Most of the times this will succeed because the wrapper wraps a value of exactly the type to be set.
I've read about Spring type conversion implemented in this release. It seems to be based on property editor support of Java beans. Property editors apply to a property of a particular type, while in my case I need a converter which applies to a value of a particular type.
Is there any way this can be implemented in a transparent way?