jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • XStream
  • XSTR-405

Collections & Maps with named parts and no class attribute

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Core
  • Labels:
    None

Description

This could be considered as two or three different changes, but they are all similar and related. The goal is to exercise greater control over the generated XML in the common cases of Collection and Map types.

Instead of having to choose between:

<parts class="linked-list">
<string>foo</string>
<string>bar</string>
</parts>

and making the collection implicit (allowing named elements):

<part>foo</part>
<part>bar</part>

I would like to have:
<parts>
<part>foo</part>
<part>bar</part>
</parts>

And deserialize into whatever type of collection is found in the class – I don't need/want the strong type checking.

I happen to like annotations, so I am thinking something like:

@XStreamAliasCollection(name="parts", omitClass="true", itemFieldName="part")

And something similar for Map types:

@XStreamAliasMap(name="parts", omitClass="true", entryFieldName="part", keyFieldName="partno", valueFieldName="partname")

to produce:

<parts>
<part>
<partno>1</partno>
<partname>foo</partname>
</part>
<part>
<partno>2</partno>
<partname>bar</partname>
</part>
</parts>

And also something like:

@XStreamAliasMap(name="parts", omitClass="true", entryFieldName="part", keyFieldName="partno", keyAsAttribute="true", valueImplicit="true"):

to produce:

<parts>
<part partno="1">foo</part>
<part partno="2">bar</part>
</parts>

Issue Links

is duplicated by

Improvement - An improvement or enhancement to an existing feature or task. XSTR-468 Aliasing explicit list type

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • History
  • Activity
There are no comments yet on this issue.

People

  • Assignee:
    Joerg Schaible
    Reporter:
    John Redford
Vote (2)
Watch (2)

Dates

  • Created:
    07/Jun/07 11:33 AM
    Updated:
    22/Jan/08 12:43 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.