CEL4J Artifact

A library that provides a ScriptEngine implementation called Artifact, that evaluates a super-set of Java source code.

E-Mail GitHub Javadocs LGPL-3.0

Summary

CEL4J Artifact is a library that provides a ScriptEngine implementation called Artifact, that evaluates a super-set of Java source code.

The library includes an interactive scripting tool that can be run as a CLI- or GUI program. You can use it to execute scripts in any scripting language supported by your ScriptEngineManager.

Features

Full Java-compatibility. You can use any Java source code that can be executed from within a Java method.
CEL4J Artifact includes an interactive scripting tool that can be run as a CLI- or GUI program.
A bunch of packages from the standard Java library are imported by default.
You don't have to catch an Exception thrown by a method. A catch-clause exists by default.
You can return anything you want from the script, but are not required to.
You can evaluate Java source code as part of the script itself, using the eval(String) method.
A simpler syntax for List creation, such as $[1, "Hello, World!", new Rectangle()].
A simpler syntax for Map creation, such as $["a" => 1, 2.0D => \'c\'].
Support for pragmas or pre-processor directives. They all start with #.
One pragma is for importing. Use it like this #import javax.swing.*;.
One pragma is for redefining the package for the class. Use it like this #package com.company;.
You can set a variable to the ScriptContext using the set(String, Object) method.
You can get a variable from the ScriptContext using the get(String) method.
Variables starting with $ are treated in a special way. They are substituted with a variable from the ScriptContext.
If a script starts with uri: followed by a URI, the resource found by that URI will be loaded and evaluated.

Dependencies

CIT Java A library that extends the default Java APIs.
Java 8 + tools.jar The Java 8 runtime with tools.jar included.