Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java annotations: library to override annotations with xml files

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.

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.

Must I roll my own xml parsing/validation or has someone already done something like this?

like image 810
flybywire Avatar asked Sep 24 '09 08:09

flybywire


1 Answers

There is not a standard way, but here are some Java frameworks who does it:

  • 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
like image 153
David Rabinowitz Avatar answered Oct 20 '22 09:10

David Rabinowitz