如何通过反射阅读 Javadoc 注释? [英] How to read Javadoc comments by reflection?

查看:34
本文介绍了如何通过反射阅读 Javadoc 注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道如何在运行时阅读 Javadoc 注释(可能通过反射?)

I need to know how to read Javadoc comments at run-time (probably by reflection?)

假设我有以下功能:

/**
*  function that do some thing
*/
public void myFunc()
{

    //...
}

在运行时,我可以通过反射获得有关此函数的很多信息..但无法阅读评论.所以问题是,如何在运行时阅读这个 javadoc 注释.

At runtime, I can get much information about this function by reflection.. But cannot read the comments. So the question is, How to read this javadoc comments at runtime.

推荐答案

考虑使用注解代替 Javadoc 并编写注解处理器.

Consider to use annotations instead of Javadoc and write an annotation processor.

这篇关于如何通过反射阅读 Javadoc 注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆