[Simple-support] flattening structure xml support
Brought to you by:
niallg
|
From: jo d. <jd...@gm...> - 2011-05-03 11:38:07
|
Hi,
I need to marshal/unmarsal a structure in a "flattened way", a simplified
example stating the concept is below.
The exact structure can be slightly different, the critical point is that
all nested objects should become on the global level.
Can anyone tell me if and how this is possible ?
thx in advance,
Jo
public class Example {
private String name;
private List<SubItem> items;
}
public class SubItem {
private integer id;
}
all subitems should be on the root level, so this should be represented as :
<root>
<example id="1">
<name>Test</name>
</example>
<subItem id="1">
<id>2</id>
<parent ref="1" type="example"/>
</subItem>
<subItem id="2">
<id>4</id>
<parent ref="1" type="example"/>
</subItem>
</root>
|