English 中文(简体)
jaxb xsd prestalet
原标题:jaxb xsd prefix package names
  • 时间:2012-01-12 20:11:54
  •  标签:
  • java
  • xsd
  • jaxb

I have a large xsd file (with imports), which can only be generated when the xjc compiler gets to pick package names based on the target attributes specified inside each of the xsd files. If I specify a specific package name, then it tries to place all generated content in that one package and I get a ton of name collisions.

The issue is with the package names. I would like to prefix these package names. Ideally I d like com.othercompany.spec._2.Error to become com.mycompany.productx.data.spec.Error instead. But I can live with com.mycompany.productx.data.com.othercompany.spec._2.Error

The latter would only require "com.mycompany.productx.data." to be prefixed to all the generated package names.

Is this possible at all?

或者,我可以拿Xjc生成的产出,将java文档移入其他一揽子计划,但这一步骤是手工操作的,我喜欢自动建造程序处理,这样,如果其他人不得不将它重新注入6个月,他们就不必考虑。

问题回答

为了获得每个XML扫描仪的独一无二的包裹名称,你可以通过利用XJC的插头档案延期,从XML扫描仪中单独制作课堂。

www.un.org/Depts/DGACM/index_spanish.htm Gene a.xsd到包装类别com.example.a/strong>

xjc -d out -p com.example.a -episode a.episode a.xsd

www.un.org/Depts/DGACM/index_spanish.htm Gene 从b.xsd(进口a.xsd)到包装的类别:com.example.b

xjc -d out -p com.example.b b.xsd -extension -b a.episode

For More Information





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签