1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.scxml.test;
19
20 import org.apache.commons.scxml.Evaluator;
21 import org.apache.commons.scxml.env.jsp.ELEvaluator;
22
23 /***
24 * Standalone SCXML interpreter, useful for command-line testing and
25 * debugging, where expressions are JSP 2.0 EL expressions.
26 *
27 * <p>USAGE:</p>
28 * <p><code>java org.apache.commons.scxml.test.StandaloneElExpressions
29 * url</code></p>
30 * <p>or</p>
31 * <p><code>java org.apache.commons.scxml.test.StandaloneElExpressions
32 * filename</code>
33 * </p>
34 *
35 * <p>RUNNING:</p>
36 * <ul>
37 * <li>Enter a space-separated list of "events"</li>
38 * <li>To quit, enter "quit"</li>
39 * <li>To populate a variable in the current context,
40 * type "name=value"</li>
41 * <li>To reset state machine, enter "reset"</li>
42 * </ul>
43 *
44 */
45 public final class StandaloneElExpressions {
46
47 /***
48 * Launcher.
49 * @param args The arguments, one expected, the URI or filename of the
50 * SCXML document
51 */
52 public static void main(final String[] args) {
53 if (args.length < 1) {
54 System.out.println("USAGE: java "
55 + StandaloneElExpressions.class.getName()
56 + "<url|filename>");
57 System.exit(-1);
58 }
59 Evaluator evaluator = new ELEvaluator();
60 StandaloneUtils.execute(args[0], evaluator);
61 }
62
63 /***
64 * Discourage instantiation since this is a utility class.
65 */
66 private StandaloneElExpressions() {
67 super();
68 }
69
70 }
71