我正在做一个需要定制生成类的项目。 我可以生成类并应用全局定制。现在,我需要通过一个抽象类A扩展每个类。所有生成的类以及A类都在同一包中。 我通过创建自定义xsd文件并在pom.xml中进行配置来进行了全局自定义。 这是自定义xsd文件:
<schema prefer-inline="true" show-schema="false" import-docs="true" use-inner="true"
names="spdx-schema.xsd"/>
这是我在pom.xml中配置它的方式:
<configuration>
<schemaBindingDirectory>src/main/source-code</schemaBindingDirectory>
<load>true</load>
<validate>true</validate>
<!--<verbose>true</verbose>-->
<verify>true</verify>
<schemaLocation>src/main/config</schemaLocation>
<customizations>
<customization>src/main/custom/global-customization.xsd</customization>
</customizations>
<includeSchemas>
<includeSchema>spdx-schema.xsd</includeSchema>
</includeSchemas>
<options>
<package>org.spdx.library.model</package>
</options>
</configuration>
我应该如何创建定制文件以按A类扩展每个生成的类? 我参考了以下页面:http://jibx.sourceforge.net/fromschema/codegen-extends.html,但是我没有太多帮助。