JAXB binding to annotate all strings in all schemas under /schema with a custom annotation

567 views Asked by At

I have a dir /schemas that has many .xsd files, and I want to annotate every field of type String with a custom annotation I created.

I'm using this plugin: "org.jvnet.jaxb2_commons:jaxb2-basics-annotate:0.6.4".

I think creating a jaxb binding config would be my ideal solution. I tried this:

<jaxb:bindings>
    <jaxb:bindings node="xs:element[@type='xs:string']">
        <annox:annotateClass>@com.myapp.model.CustomAnnotation</annox:annotateClass>
    </jaxb:bindings>
</jaxb:bindings>

But in vain. Can you help? Thank you

0

There are 0 answers