java注释:用xml文件覆盖注释的库

编程入门 行业动态 更新时间:2024-10-11 23:26:50
本文介绍了java注释:用xml文件覆盖注释的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-20 22:47:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/990542.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:注释   文件   java   xml

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!