java.lang.Object
org.apache.commons.jexl3.scripting.Main

public class Main extends Object
Test application for JexlScriptEngine (JSR-223 implementation).
Since:
2.0
  • Constructor Details

    • Main

      public Main()
      Default constructor
  • Method Details

    • main

      public static void main(String[] args) throws Exception
      Test application for JexlScriptEngine (JSR-223 implementation).

      If a single argument is present, it is treated as a file name of a JEXL script to be evaluated. Any exceptions terminate the application.

      Otherwise, lines are read from standard input and evaluated. ScriptExceptions are logged, and do not cause the application to exit. This is done so that interactive testing is easier. The line //q! ends the loop.
      Parameters:
      args - (optional) file name to evaluate. Stored in the args variable.
      Throws:
      Exception - Thrown if parsing or IO fail
    • run

      static void run(BufferedReader in, PrintWriter out, Object[] args) throws Exception
      Throws:
      Exception
    • read

      static BufferedReader read(Path path) throws IOException
      Reads an input.
      Parameters:
      path - The file path or null for stdin
      Returns:
      The reader
      Throws:
      IOException - Thrown if anything goes wrong