class Foo {
@SomeAnnotation
var bar: String = _
}
@SomeAnnotation 是一个 Java 注释(因此它在运行时保留),具有运行时保留和方法目标。代码可以编译,但在运行时,编译器生成的 bar() 和 bar_=() 方法没有注释。
假设这不是一个错误,是否有一种干净的方法来注释生成的 getter 方法,而无需显式定义该方法?
此邮件列表帖子可能有用:http://old.nabble.com/-scala--field-annotations,-getters-setters-and-BeanProperty-td24970781.html http://old.nabble.com/-scala--field-annotations,-getters-setters-and-BeanProperty-td24970781.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)