Diego Dias
Diego Dias

Reputation: 22606

Don't show Object Tag, only its attributes with JAXB

If I have 3 objects A, B and C. Where A has B which has C, I don't want to show:

<a>
  <b>
    <c/>
  </b>
</a>

I want to show:

<a>
  <c/>
</a>

Is there any way to do it with JAXB?

Upvotes: 1

Views: 119

Answers (1)

axtavt
axtavt

Reputation: 242686

You can implement XmlAdapter<C, B> to marshal the contained C instead of B

Upvotes: 1

Related Questions