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

后端 未结 6 1838
谎友^
谎友^ 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 09:55

    Replace your JAX-B implementation with MOXy and you can do anything you want. It has a ton of extensions that go above and beyond normal JAX-B, one of which will allow you to ignore inherited properties, etc. It also supports moving JAX-B annotations to an XML mapping file so you can keep multiple sets of mappings.

提交回复
热议问题