简单规则:无法解析aNewRulesEngine()

时间:2017-08-28 13:18:07

标签: java

由于“无法找到符号”,无法编译以下代码   符号:class aNewRulesEngine   location:class org.jeasy.rules.core.RulesEngineBuilder'

但是,根据本教程https://github.com/j-easy/easy-rules/wiki/fizz-buzz来判断它应该没问题。

任何想法为什么会变质?

import org.jeasy.rules.api.RulesEngine;
import org.jeasy.rules.core.RulesEngineBuilder;

public class Main {

    public static void main(String[] args) {
        RulesEngine rulesEngine = new RulesEngineBuilder.aNewRulesEngine();
    }
}

1 个答案:

答案 0 :(得分:1)

aNewRulesEngine是RulesEngineBuilder中的静态方法(根据文档:https://github.com/j-easy/easy-rules/blob/master/easy-rules-core/src/main/java/org/jeasy/rules/core/RulesEngineBuilder.java) - 但在您的代码示例中,您还尝试为RulesEngineBuilder实例化一个实例。

也许这段代码会更好用:

for(int i=0;i<days.length;i++){ if(i==0)days[i].select();else days[i].unselect();}