Class Main
- java.lang.Object
-
- org.apache.commons.jexl3.scripting.Main
-
public class Main extends java.lang.ObjectTest application for JexlScriptEngine (JSR-223 implementation).- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description Main()Default constructor
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)Test application for JexlScriptEngine (JSR-223 implementation).(package private) static java.io.BufferedReaderread(java.nio.file.Path path)Reads an input.(package private) static voidrun(java.io.BufferedReader in, java.io.PrintWriter out, java.lang.Object[] args)
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.ExceptionTest 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:
java.lang.Exception- if parsing or IO fail
-
run
static void run(java.io.BufferedReader in, java.io.PrintWriter out, java.lang.Object[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
read
static java.io.BufferedReader read(java.nio.file.Path path) throws java.io.IOExceptionReads an input.- Parameters:
path- the file path or null for stdin- Returns:
- the reader
- Throws:
java.io.IOException- if anything goes wrong
-
-