Issue Details (XML | Word | Printable)

Key: XSTR-85
Type: New Feature New Feature
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Marty Lamb
Votes: 0
Watchers: 1
Operations

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

contextual aliases

Created: 07/Jun/04 05:23 PM   Updated: 03/Mar/06 03:40 PM
Component/s: None
Affects Version/s: None
Fix Version/s: Upcoming

Issue Links:
Related
 


 Description  « Hide
Rather than globally mapping a class to an alias, it would be nice to make a mapping contextual; that is, to make a mapping conditional upon parent nodes.

For example, if my class has a list of, say, usernames, the generated (and expected) XML for it might look like:

...
<users>
<string>Tom</string>
<string>Dick</string>
<string>Harry</string>
</users>
...

In this case, it would be nice to alias java.lang.String as "user" when contained by "users", resulting in:

...
<users>
<user>Tom</user>
...

Globally aliasing java.lang.String has some obvious drawbacks.

I looked through the code and it looks like this would be a rather large undertaking, but thought I'd toss the idea out.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.