How do I prevent JAXB from binding superclass methods of the @XmlRootElement when marshalling?

后端 未结 6 1855
谎友^
谎友^ 2020-12-30 09:10

I have a class that is annotated as the @XmlRootElement with @XmlAccessorType(XmlAccessType.NONE). The problem that I am having is that the superc

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-30 10:12

    I'm facing the exact same problem. My superclass does not handle any JAXB annotations (it doesn't have to) and I would like my subclass not to include superclass properties while marshalling.

    Adding the XmlAccesorType on superclass cannot be the solution as I have no way to modify the superclass.

    Is there any other solution?

提交回复
热议问题