Issue Details (XML | Word | Printable)

Key: XBEAN-112
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Benjamin Bentmann
Votes: 0
Watchers: 0
Available Workflow Actions

Begin RTC Review
Operations

If you were logged in you would be able to see more operations.
XBean

Allow conversion from File, URL, Number etc. to String

Created: 14/Oct/08 11:15 AM   Updated: 14/Oct/08 11:16 AM
Return to search
Component/s: reflect
Affects Version/s: 3.4.2
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works XBEAN-112.patch 2008-10-14 11:16 AM Benjamin Bentmann 13 kB


 Description  « Hide
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.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Benjamin Bentmann added a comment - 14/Oct/08 11:16 AM
Proposed patch.