I am using the Jackson library to map POJO to XML. While serializing the OffsetDateTime
field I am getting the output in multiple tags enclosed within the parent tag.
compile ('com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.0')
When trying to serialize the OffsetDateTime
field, which is given below,
@JacksonXmlProperty(localName = "InvoiceStatusDate")
private OffsetDateTime invoiceStatusDate;
I am getting the parsed XML as
<InvoiceStatusDate>
<offset>
<totalSeconds>19800</totalSeconds>
<id>+05:30</id>
<rules>
<fixedOffset>true</fixedOffset>
<transitions />
<transitionRules />
</rules>
</offset>
<hour>14</hour>
<minute>48</minute>
<second>43</second>
<nano>988195000</nano>
<monthValue>9</monthValue>
<year>2019</year>
<month>SEPTEMBER</month>
<dayOfMonth>4</dayOfMonth>
<dayOfWeek>WEDNESDAY</dayOfWeek>
<dayOfYear>247</dayOfYear>
</InvoiceStatusDate>
But I need something like
<InvoiceStatusDate>2019-09-05T15:08:53.549+05:30</InvoiceStatusDate>