【发布时间】:2015-04-01 17:58:00
【问题描述】:
我有一个类似于以下的 Scala 对象:
object MyConfig {
@PropertyManagerSources(Array("my.properties"))
trait MyConfigOwner extends PropertyManagerConfig {
@Key("my.key")
def getSomething(): Boolean
}
这是使用 Owner 来管理属性。
我正在尝试访问这样的 java 类中的特征:
import com.bah.cr.common.config.MyConfig.MyConfigOwner;
public class MyJavaClass{
MyConfigOwner config = PropertyManagerConfig Factory.create(MyConfigOwner.class);
}
但是,我收到 MyConfig 不存在的错误。
提前致谢。
【问题讨论】:
标签: java scala object traits owner