1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.scxml.env.jexl;
19
20 import java.util.Map;
21
22 import org.apache.commons.scxml.Builtin;
23 import org.apache.commons.scxml.Context;
24 import org.apache.commons.scxml.env.SimpleContext;
25
26 /***
27 * JEXL Context implementation for Commons SCXML.
28 *
29 */
30 public class JexlContext extends SimpleContext
31 implements org.apache.commons.jexl.JexlContext {
32
33 /***
34 * Constructor.
35 */
36 public JexlContext() {
37 super();
38 getVars().put("_builtin", new Builtin());
39 }
40
41 /***
42 * Constructor with initial vars.
43 *
44 * @param initialVars The initial set of variables.
45 */
46 public JexlContext(final Map initialVars) {
47 super(initialVars);
48 getVars().put("_builtin", new Builtin());
49 }
50
51 /***
52 * Constructor with parent context.
53 *
54 * @param parent The parent context.
55 */
56 public JexlContext(final Context parent) {
57 super(parent);
58 getVars().put("_builtin", new Builtin());
59 }
60
61 /***
62 * Set the variables map.
63 *
64 * @param vars The new variables map.
65 *
66 * @see org.apache.commons.jexl.JexlContext#setVars(Map)
67 * @see org.apache.commons.scxml.env.SimpleContext#setVars(Map)
68 */
69 public void setVars(final Map vars) {
70 super.setVars(vars);
71 getVars().put("_builtin", new Builtin());
72 }
73
74 /***
75 * Get the variables map.
76 *
77 * @return Map The variables map.
78 *
79 * @see org.apache.commons.jexl.JexlContext#getVars()
80 * @see org.apache.commons.scxml.env.SimpleContext#getVars()
81 */
82 public Map getVars() {
83 return super.getVars();
84 }
85
86 /***
87 * Clear this Context.
88 *
89 * @see org.apache.commons.scxml.Context#reset()
90 */
91 public void reset() {
92 super.reset();
93 getVars().put("_builtin", new Builtin());
94 }
95
96 }
97