XJC - 它是可扩展的吗? [英] XJC - is it extensible?

查看:92
本文介绍了XJC - 它是可扩展的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题与 JAXB2类型限制不起作用?有关。我想扩展XJC以支持类型限制。它就像重写超类'字段定义一样简单。

This question is related to JAXB2 type restriction not working?. I want to extend XJC to support type restrictions. It would be as simple as overriding super class' field definitions.

有没有办法正确地做到这一点?有钩子吗?任何类似的工具?

Is there any way to do that properly? Any hooks? Any similar tools?

推荐答案

,XJC 是可扩展的插件:


什么插件可以吗?

JAXB RI插件参与模式的代码生成。
可以定义用户可以用来控制它的自己的自定义,
可以访问JAXB RI生成的代码,并且它可以生成
其他类/方法/字段/注释/评论。

A JAXB RI plugin participates in the code generation from a schema. It can define its own customizations that users can use to control it, it can access the code that the JAXB RI generates, and it can generate additional classes/methods/fields/annotations/comments.

插件也可以选择完全接管XJC的代码生成
流程。只有一个插件可以在任何给定时间执行此操作,但
这允许插件从
架构生成完全不同的代码。

A plugin can also choose to take over the XJC's code generation process completely. Only one plugin can do this at any given time, but this allows a plugin to generate radically different code from a schema.

另见这个答案:


CodeOutline / JClass / CClass在CodeModel中的作用是什么?

但没有,我认为这不是解决问题的正确方法你遇到的问题

But no, I don't think this is the right way to address the problem that you have.

尝试找出绑定或修补架构。

Try to figure out the bindings or patch the schema.

这篇关于XJC - 它是可扩展的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆