Re: [Simple-support] Fwd: ElementList that includes null values
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2012-06-27 12:32:06
|
The problem here is whether
<column></column> represents "" or is it null there is noreal way to tell from parsing the XML document? You could do this
class Column {@Textprivate String value;}
Then the XML would be the same, but you should get null.
--- On Mon, 25/6/12, Jorge Cercas <jms...@gm...> wrote:
From: Jorge Cercas <jms...@gm...>
Subject: [Simple-support] Fwd: ElementList that includes null values
To: sim...@li...
Received: Monday, 25 June, 2012, 5:45 PM
Hi,
I am using an @ElementList annotation, but the resulting ArrayList does not include the empty elements found in the XML - I am "loosing" elements (empty elements).
It also seems that I cannot use the @ElementArray since there is no way of telling it that the elements are inline.
The partial XML:
<line id="001">
<column>aaa</column>
<column>bbb</column>
<column></column>
</line>
<line id="002">
<column>111</column>
<column></column>
<column>333</column>
</line>
The partial class:
@Root(name="line")
class Document {
@ElementList(entry="column", inline="true")
private ArrayList<String> columns;
public Document(
@ElementList(entry="column", inline="true") ArrayList<String> columns
) {
this.columns = columns;
}
}
Is there anyway to get the resulting ArrayList to include the empty </column> elements?
Thanks and Kind Regards,
Bokie
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|