是否可以记录该方法带注释返回的结果?
或特定的异常,是由方法抛出的?
使用此调用找不到方法 m
或类似内容的返回值:
for (Method m : Class.forName("AnnotatedBean").getMethods()) {
...
}
AnnotatedBean
是类,其方法由自定义注解注释。
最佳答案
Is it possible to log result,that method returned with annotation? or specific Exceptions,that was thrown by method?
这似乎是关注点分离的教科书示例。看看AspectJ;在这种情况下,生产方面可以很好地发挥作用。
Can't find return value for method m or something like that ,using this call:
现在我很困惑。返回值怎么会“找不到”?
关于java - 注释 Java 方法以记录其结果和异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7729260/