protected ScriptEngine engine;
@Override
public void init(Map<String, Object> settings) throws SettingsException {
if (settings == null) {
throw new SettingsException("'settings' section is not defined for preprocessor " + name);
}
script = XContentMapValues.nodeStringValue(settings.get(CFG_SCRIPT_FIELD), null);
validateConfigurationStringNotEmpty(script, CFG_SCRIPT_FIELD);
scriptEngineName = XContentMapValues.nodeStringValue(settings.get(CFG_SCRIPT_ENGINE_NAME_FIELD), "JavaScript");
validateConfigurationStringNotEmpty(scriptEngineName, CFG_SCRIPT_ENGINE_NAME_FIELD);
engine = factory.getEngineByName(scriptEngineName);
if (engine == null) {
throw new SettingsException("No scripting engine is available for name " + scriptEngineName
+ " for preprocessor " + name);
}
}