Class GraalScript

  • All Implemented Interfaces:
    com.rapiddweller.format.script.Script

    public class GraalScript
    extends java.lang.Object
    implements com.rapiddweller.format.script.Script
    Provides Script functionality based on GraalVM: Scripting for the Java platform.

    Created at 30.12.2020

    Since:
    1.1.0
    Author:
    Alexander Kell
    • Constructor Summary

      Constructors 
      Constructor Description
      GraalScript​(java.lang.String text, org.graalvm.polyglot.Engine scriptEngine, java.lang.String languageId)
      Instantiates a new Graal script.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object evaluate​(com.rapiddweller.common.Context context)  
      void execute​(com.rapiddweller.common.Context context, java.io.Writer out)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GraalScript

        public GraalScript​(java.lang.String text,
                           org.graalvm.polyglot.Engine scriptEngine,
                           java.lang.String languageId)
        Instantiates a new Graal script.
        Parameters:
        text - the text
        scriptEngine - the script engine
        languageId - the language id
    • Method Detail

      • evaluate

        public java.lang.Object evaluate​(com.rapiddweller.common.Context context)
                                  throws com.rapiddweller.format.script.ScriptException
        Specified by:
        evaluate in interface com.rapiddweller.format.script.Script
        Throws:
        com.rapiddweller.format.script.ScriptException
      • execute

        public void execute​(com.rapiddweller.common.Context context,
                            java.io.Writer out)
                     throws com.rapiddweller.format.script.ScriptException,
                            java.io.IOException
        Specified by:
        execute in interface com.rapiddweller.format.script.Script
        Throws:
        com.rapiddweller.format.script.ScriptException
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object