Re: [Simple-support] null variables and suppressing empty tags
Brought to you by:
niallg
|
From: James O. <Jam...@ip...> - 2011-09-20 15:52:25
|
Set required = false for the To element
From: Erez Lirov [mailto:er...@es...]
Sent: Tuesday, September 20, 2011 7:25 AM
To: sim...@li...
Subject: [Simple-support] null variables and suppressing empty tags
I have an annotated class that has a null field like this:
@Root(name = "ContinuityOfCareRecord")
class Test1 {
@Element(name = "ActorID", required = false)
@Path("Patient")
protected String patientId;
}
generating the XML gives:
<ContinuityOfCareRecord>
<To/>
</ContinuityOfCareRecord>
Is there any way to automatically suppress the <To/> tag since there are no values under it?
Thanks!
|