Values of type File, URL, Integer etc. can naturally be converted to strings. However, the ObjectRecipe currently blows up if one passes such objects into a string-typed property.
Some background on the motivation: The property values are not be provided via an XML configuration, i.e. are not natively represented as strings, but are instead retrieved from some expression evaluator that (reflectively) queries a property value from some other bean. If those expressions deliver a non-string-typed value, they can't be injected into a string-typed field. This is pity given that a mere invocation of toString() does the trick and for instance allows to pass a filesystem path into a String field regardless whether the path happens to be represented by a String or a File object.
Description
Values of type File, URL, Integer etc. can naturally be converted to strings. However, the ObjectRecipe currently blows up if one passes such objects into a string-typed property.
Some background on the motivation: The property values are not be provided via an XML configuration, i.e. are not natively represented as strings, but are instead retrieved from some expression evaluator that (reflectively) queries a property value from some other bean. If those expressions deliver a non-string-typed value, they can't be injected into a string-typed field. This is pity given that a mere invocation of toString() does the trick and for instance allows to pass a filesystem path into a String field regardless whether the path happens to be represented by a String or a File object.