KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > modules > scriptrunner > ScriptRunner


1 /*
2 Copyright (c) 2003 eInnovation Inc. All rights reserved
3
4 This library is free software; you can redistribute it and/or modify it under the terms
5 of the GNU Lesser General Public License as published by the Free Software Foundation;
6 either version 2.1 of the License, or (at your option) any later version.
7
8 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the GNU Lesser General Public License for more details.
11 */

12
13 package com.openedit.modules.scriptrunner;
14
15 import com.openedit.OpenEditException;
16
17
18 /**
19  * DOCUMENT ME!
20  *
21  * @author Eric and Matt
22  */

23 public interface ScriptRunner
24 {
25     /**
26      * DOCUMENT ME!
27      *
28      * @param inScript
29      */

30     public void setScript(Script inScript);
31
32     /**
33      * DOCUMENT ME!
34      *
35      * @return
36      */

37     public Script getScript();
38
39     /**
40      * DOCUMENT ME!
41      *
42      * @param name
43      * @param bean
44      *
45      * @throws ScriptException
46      */

47     public void declareBean(String JavaDoc name, Object JavaDoc bean) throws OpenEditException;
48
49     /**
50      * Run the function in the form's script with the given name, if it exists. If the function
51      * returns an array or another Java-esque type, the implementation should marshal this into a
52      * corresponding Java type.
53      *
54      * @param inFunctionName The function to attempt to run
55      *
56      * @return The return value of the function, or <code>null</code> if the function does not
57      * exist or did not return anything
58      */

59     public Object JavaDoc execFunction(String JavaDoc inFunctionName) throws OpenEditException;
60
61     /**
62      * Run the function in the form's script with the given name and parameters, if the function
63      * exists. If the function returns an array or another Java-esque type, the implementation
64      * should marshal this into a corresponding Java type.
65      *
66      * @param inFunctionName The function to attempt to run
67      * @param inParameters The parameters to pass to the function
68      *
69      * @return The return value of the function, or <code>null</code> if the function does not
70      * exist or did not return anything
71      */

72     public Object JavaDoc execFunction(String JavaDoc inFunctionName, Object JavaDoc[] inParameters)
73         throws OpenEditException;
74
75     /**
76      * DOCUMENT ME!
77      *
78      * @throws ScriptException
79      */

80     public void init() throws OpenEditException;
81
82     /**
83          *
84          */

85     public void terminate();
86 }
87
Popular Tags