use of org.openksavi.sponge.kb.KnowledgeBaseInterpreter in project sponge by softelnet.
the class DefaultInteractiveMode method getScriptKnowledgeBaseInterpreter.
protected ScriptKnowledgeBaseInterpreter getScriptKnowledgeBaseInterpreter() {
KnowledgeBase knowledgeBase = kbName != null ? engine.getKnowledgeBaseManager().getKnowledgeBase(kbName) : engine.getKnowledgeBaseManager().getMainKnowledgeBase();
KnowledgeBaseInterpreter interpreter = knowledgeBase.getInterpreter();
if (!(interpreter instanceof ScriptKnowledgeBaseInterpreter)) {
throw new SpongeException("Knowledge base '" + kbName + "' is not script-based.");
}
return (ScriptKnowledgeBaseInterpreter) interpreter;
}
Aggregations