开发者

globalBindings super class

I have problem with supperClass for globalBindings.

My jaxb configuration:

<jxb:bindings version="开发者_StackOverflow中文版1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
  jxb:extensionBindingPrefixes="xjc"  
  xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd ">

  <jxb:globalBindings>
    <xjc:superClass name="package.Superclass"/>
  </jxb:globalBindings>

  <jxb:bindings schemaLocation="xlink.xsd" node="/xs:schema">
    <jxb:schemaBindings>
      <jxb:package name="org.w3.xlink" />
    </jxb:schemaBindings>
  </jxb:bindings>

  <jxb:bindings schemaLocation="something.xsd" node="/xs:schema">
    <jxb:schemaBindings>
      <jxb:package name="package1" />
    </jxb:schemaBindings>
  </jxb:bindings>

  <jxb:bindings schemaLocation="something2.xsd" node="/xs:schema">
    <jxb:schemaBindings>
      <jxb:package name="package2" />
    </jxb:schemaBindings>
  </jxb:bindings>
</jxb:bindings>

And now Superclass extends all my generated class. How i can prevent this binding to only to package1? And for package2 maybe diffrent Superclass2 type ?


You could leverage episode files to separate the compilation of your XML schemas. In this way each schema could have it's own bindings file:

  • http://weblogs.java.net/blog/kohsuke/archive/2006/09/separate_compil.html
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜