2

CIP4 发布的用于处理JDF文件的官方JDFLibJ库 相当过时(尤其是不基于 JAXB)。因此,我尝试自己将 JDF Schema 转换为 Java 代码,以便获得 JAXB 的所有优点。

这是我到目前为止所做的:

  • 从页面 下载 JDF Schema 下载了文件JDF-Schema-1.5-lax-b62.zip
    zip 内容如下所示。 压缩内容
  • 解压它,得到 8 个 .xsd 文件。入口点是JDF.xsd,包括 和 的其他 7 个 .xsdxs:import文件xs:include
  • xjc JDF.xsd

我希望得到:

  • 将生成一个包含数百个 .java 文件(类和枚举)的包。
    其中2 个类 (JDFJMF) 应使用@XmlRootElement.

但实际上什么也没产生,出现了800行错误信息。

parsing a schema...
[ERROR] Base complex type "JMFAbstractResponse_" is derived by restriction, while this complex type "ResponseSetQueueEntryPosition" is derived by extension. This is not currently handled by XJC, but we are seeking input on this issue. Please report this to the JAXB team.
  line 3421 of file:/D:/workspace4.4/de.tfritsch.jdf/JDFMessage.xsd

[ERROR] Base complex type "JDFAbstractNode" is derived by restriction, while this complex type "ContoneCalibration" is derived by extension. This is not currently handled by XJC, but we are seeking input on this issue. Please report this to the JAXB team.
  line 718 of file:/D:/workspace4.4/de.tfritsch.jdf/JDFProcess.xsd

[ERROR] Base complex type "JMFAbstractResponse_" is derived by restriction, while this complex type "ResponseShutDown" is derived by extension. This is not currently handled by XJC, but we are seeking input on this issue. Please report this to the JAXB team.
  line 1993 of file:/D:/workspace4.4/de.tfritsch.jdf/JDFMessage.xsd

...rest of output omitted here...

[ERROR] Property "GenericElements" is already defined. Use <jaxb:property> to resolve this conflict.
  line 1272 of file:/D:/workspace4.4/de.tfritsch.jdf/JDFCore.xsd

[ERROR] The following location is relevant to the above error
  line 1274 of file:/D:/workspace4.4/de.tfritsch.jdf/JDFCore.xsd

Failed to parse a schema.

有没有机会解决这个问题,至少是部分解决方案?

编辑:

似乎其他人已经遇到了与 JDF 模式相同的问题。请参阅关于错误报告 JAXB-745 xjc derivation by extension/restriction 的评论

4

0 回答 0