使用文档生成XML Schema [英] Generate XML Schema with documentation
问题描述
有没有办法从类中的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屋!