问题描述
限时送ChatGPT账号..Java 有注释,这很好.然而,一些开发人员认为最好使用 xml 文件用元数据注释代码 - 其他人更喜欢注释,但会使用元数据来覆盖源代码中的注释.
Java has annotations and that is good. However, some developers feel that it is best to annotate code with metadata using xml files - others prefer annotations but would use metadata to override annotations in source code.
我正在编写一个使用注释的 Java 框架.问题是:是否有标准的方法来定义和解析 xml 文件中的元数据.我认为这是每个使用注释的框架都可以从中受益的东西,但我似乎可以在互联网上找到类似的东西.
I am writing a Java framework that uses annotations. The question is: is there a standard way to define and parse metadata from xml files. I think this is something every framework that uses annotations could benefit from but I can seem to find something like this on the Internet.
我必须自己进行 xml 解析/验证还是有人已经做过这样的事情?
Must I roll my own xml parsing/validation or has someone already done something like this?
推荐答案
没有标准的方法,但这里有一些 Java 框架做到了:
There is not a standard way, but here are some Java frameworks who does it:
JPA - 检查 ejb-3_0-fr-spec-持久性.pdfSpring 框架TestNG - 如上所述,尽管我认为它主要关注注释方面而不是他试图实现的实际配置Seam 框架 JPA - check ejb-3_0-fr-spec-persistence.pdf Spring Framework TestNG - as written above, though I think it focuses to much on the annotation side rather than the actual configuration he tries to achieve Seam Framework这篇关于java注释:用xml文件覆盖注释的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论