NOTE: This repository is being archived as the more generic https://github.com/fugerit-org/fj-script-helper/ has been created
This project provides just a convenient interface for evaluating kotlin script. (Actually it can be used for any kind of script).
<dependency>
<groupId>org.fugerit.java</groupId>
<artifactId>kotlin-script-helper</artifactId>
<version>${kotlin-script-helper-version}</version>
</dependency>
Sample code :
EvalKts evalKts = new EvalKtsWithJsonDataModel();
try (Reader reader = [reader on kotlin script]) {
Map<String, Object> dataModel = new HashMap<>();
dataModel.put( "docTitle", "My custom title" );
Object result = evalKts.evalKts( reader, dataModel );
log.info( "my result : {}", result );
}