Class Scriptlet

java.lang.Object
org.apache.ofbiz.base.util.Scriptlet

public final class Scriptlet extends Object
Contains a simple script (scriptlet).

A scriptlet is a small script that is commonly found in a scripting XML file. The scriptlet is composed of two parts: the prefix - which is the script language followed by a colon (":"), and the script. Example: groovy:return foo.bar();.

  • Constructor Details

    • Scriptlet

      public Scriptlet(String script)
  • Method Details

    • executeScript

      public Object executeScript(Map<String,Object> context) throws Exception
      Executes the scriptlet and returns the result.
      Parameters:
      context - The script bindings
      Returns:
      The scriptlet result
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object