Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Latest commit

 

History

History
43 lines (33 loc) · 2.62 KB

README.md

File metadata and controls

43 lines (33 loc) · 2.62 KB

Kotlin Language Script Helper

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).

Keep a Changelog v1.1.0 badge Maven Central license code of conduct Quality Gate Status Coverage

Java runtime version Java build version Apache Maven Fugerit Github Project Conventions

Quickstart

1. Add dependency

<dependency>
    <groupId>org.fugerit.java</groupId>
    <artifactId>kotlin-script-helper</artifactId>
    <version>${kotlin-script-helper-version}</version>
</dependency>

2. Usage

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 );
}