Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 973
pawb4r Avatar asked Jul 04 '11 14:07

pawb4r


1 Answers

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?

like image 186
lexicore Avatar answered Oct 05 '22 03:10

lexicore