use of javax.script.ScriptException in project jgnash by ccavanaugh.
the class ImportFilter method getDescription.
public String getDescription() {
try (final Reader reader = getReader()) {
engine.eval(reader);
final Invocable invocable = (Invocable) engine;
final Object result = invocable.invokeFunction("getDescription", Locale.getDefault());
return result.toString();
} catch (final ScriptException | IOException | NoSuchMethodException e) {
logger.log(Level.SEVERE, e.getLocalizedMessage(), e);
}
return "";
}
use of javax.script.ScriptException in project jgnash by ccavanaugh.
the class ImportFilter method processMemo.
public String processMemo(final String memo) {
try (final Reader reader = getReader()) {
engine.eval(reader);
final Invocable invocable = (Invocable) engine;
final Object result = invocable.invokeFunction("processMemo", memo);
return result.toString();
} catch (final ScriptException | IOException | NoSuchMethodException e) {
logger.log(Level.SEVERE, e.getLocalizedMessage(), e);
}
return memo;
}
use of javax.script.ScriptException in project jgnash by ccavanaugh.
the class ImportFilter method processPayee.
public String processPayee(final String payee) {
try (final Reader reader = getReader()) {
engine.eval(reader);
final Invocable invocable = (Invocable) engine;
final Object result = invocable.invokeFunction("processPayee", payee);
return result.toString();
} catch (final ScriptException | IOException | NoSuchMethodException e) {
logger.log(Level.SEVERE, e.getLocalizedMessage(), e);
}
return payee;
}
Aggregations