使用文档生成XML Schema [英] Generate XML Schema with documentation

查看:157
本文介绍了使用文档生成XML Schema的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从类中的javadoc注释生成带有文档(< xsd:annotation> /< xsd:documentation> )的XML Schema(xsd)?
我知道反向是可能的(即带有注释的xsd带有javadoc注释的生成类)。

Is there a way to generate XML Schema(xsd) with documentation(<xsd:annotation> / <xsd:documentation>) from javadoc comments in classes? I know the reverse is possible (i.e generation classes with javadoc comments from xsd with comments).

请建议。

推荐答案

使用 JAXBContext.generateSchema(SchemaOutputResolver) API不能将Javadoc注释包含在< xsd:documentation>部分中。原因是没有任何API可用于内省Java类/字段/属性以获取评论中的信息。

Using the JAXBContext.generateSchema(SchemaOutputResolver) API it is not possible for Javadoc comments to be included in <xsd:documentation> sections. The reason for this is that there isn't any API available to introspect the Java class/field/property to get the information in the comments.

这篇关于使用文档生成XML Schema的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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