开发者

Ignoring some elements/classes in JAXB binding

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜