开发者

Ignoring some elements/classes in JAXB binding

开发者 https://www.devze.com 2023-03-16 23:43 出处:网络
I use Hyperjaxb to generate some classes with JPA annotations from XML schemas. I\'d like to specify which elements from given schema xjc should generate. I can\'t change xsd file. I can modify only b

I use Hyperjaxb to generate some classes with JPA annotations from XML schemas. I'd like to specify which elements from given schema xjc should generate. I can't change xsd file. I can modify only bindings.开发者_开发问答xjb. I tried to use hj:ignored, but without success.


Well, hj:ignored is the answer. It allows you to make Hyperjaxb ignore certain classes.

Here's an example:

    <jaxb:bindings
        node="xsd:complexType[@name='issue121Type']//xsd:element[@name='simpleCollection']">
        <hj:ignored/>
    </jaxb:bindings>

Customizations work in schema as well as via xjb files.

See this project for instance.

How does "without success" reveal itself?

0

精彩评论

暂无评论...
验证码 换一张
取 消