1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package net.sf.sail.core.activity.model;
24
25 import javax.script.ScriptContext;
26 import javax.script.ScriptEngine;
27 import javax.script.ScriptException;
28
29 /***
30 * @author eburke
31 *
32 * The Script interface defines the methods for manipulating the script text.
33 * It is responsible for keeping track of the ScriptEngine and related data.
34 * It also provides an evaluate method to which containing classes can delegate.
35 */
36 public interface IScript
37 {
38 /***
39 * evaluate - evaluates the script text relative to the script engine
40 * assigned at creation time. Will compile the script if the engine
41 * is Compilable.
42 * @return
43 * @throws ScriptException
44 */
45 public Object evaluate()
46 throws ScriptException;
47
48 /***
49 * getText
50 * @return - the script text
51 */
52 public String getText();
53
54 /***
55 * setText - set the script text string
56 * @param text - the script text
57 */
58 public void setText(String text);
59
60 /***
61 * getScriptEngine
62 * @return - the ScriptEngine for this script, provided at Script creation
63 */
64 public ScriptEngine getScriptEngine();
65
66 /***
67 * getScriptContext
68 * @return - the ScriptContext for this script. Determined by the
69 * ScriptEngine provided when the Script was created.
70 */
71 public ScriptContext getScriptContext();
72 }