Documenting use of EJB3 annotations within a code base
We have a large code base and I want to generate specific reports on the usage of EJB3 annotations within the code base. The simplest use case is to generate a HTML/PDF report with details of all classes/methods that use the EJB3 security annotations. The goal of this document is to allow non developers to simply review which interfaces in the product have what roles so gaps can be plugged. I'd see similar reports for use of persistence and session based annotations. And the uber-report of all annotations.
@RolesAllowed({"Administrator", "UserAlarmsRO", "NetworkAlarmsRO", "DeviceAlarmsRO","ServiceAlarmsRO","UserAlarmsRW", "NetworkAlarmsRW开发者_JS百科",
"DeviceAlarmsRW", "ServiceAlarmsRW","UserGraphsRO","NetworkGraphsRO","DeviceGraphsRO","ServiceGraphsRO","SLMRO","SLMRW","SLMTemplatesRW"})
public class VisualisationMgrBean
Is it best to use the existing javadoc tool or is there a set of 3rd party doclets that i could reuse.
Google for "Annotation Processing" an you will find lots of stuff on how do analyze annotations in java code. For example this link Annotations. Shouldn't be to hard to find some code that you can modify to generate the reports that you want (I have done html and Excel reports myself and it is very easy).
精彩评论