gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.lib / org.gvsig.scripting.lib.api / src / main / java / org / gvsig / scripting / ScriptingScript.java @ 1084
History | View | Annotate | Download (2.2 KB)
1 |
package org.gvsig.scripting; |
---|---|
2 |
|
3 |
import org.gvsig.tools.script.Script; |
4 |
|
5 |
|
6 |
/**
|
7 |
* <p> Interface that represents a single script without window dialog.</p>
|
8 |
*
|
9 |
* @see ScriptingUnit
|
10 |
* @see ScriptingBaseScript
|
11 |
*/
|
12 |
public interface ScriptingScript extends ScriptingBaseScript, Script { |
13 |
|
14 |
/**
|
15 |
* Returns the languange in which the ScriptingScript is written.
|
16 |
*
|
17 |
* @return a String containing the name of the language
|
18 |
*/
|
19 |
public String getLangName(); |
20 |
|
21 |
/**
|
22 |
* Returns the ScriptingScript's code.
|
23 |
*
|
24 |
* @return a String with the code of the script.
|
25 |
*/
|
26 |
@Override
|
27 |
public String getCode(); |
28 |
|
29 |
/**
|
30 |
* Sets a the code associated with a ScriptingScript.
|
31 |
*
|
32 |
* @param code
|
33 |
* String that contains the new code.
|
34 |
*/
|
35 |
public void setCode(String code); |
36 |
|
37 |
/**
|
38 |
* Returns the name of the main function in the ScriptingScript's code
|
39 |
*
|
40 |
* @return a String with main function (default main name is 'main').
|
41 |
*/
|
42 |
public String getMainName(); |
43 |
|
44 |
/**
|
45 |
* Stablishes a new main main function in the ScriptingScript's code.
|
46 |
*
|
47 |
* @param mainName
|
48 |
* String that contains the new main function name.
|
49 |
*/
|
50 |
public void setMainName(String mainName); |
51 |
|
52 |
/**
|
53 |
* Persists the current status of a ScriptingScript with the content associated.
|
54 |
*/
|
55 |
public void save(); |
56 |
|
57 |
/**
|
58 |
* Executes a method from the Script's code
|
59 |
*
|
60 |
* @param obj this Object represents the script's code
|
61 |
* @param name method's name to execute
|
62 |
* @param args input parameters of the method
|
63 |
*
|
64 |
* @return An Object that represents the execution
|
65 |
*
|
66 |
* @throws NoSuchMethodException If there isn't a main function to begin the execution
|
67 |
*/
|
68 |
public Object invokeMethod(Object obj, String name, Object[] args) throws NoSuchMethodException; |
69 |
|
70 |
/**
|
71 |
* Executes a function from the Script's code
|
72 |
*
|
73 |
* @param name method's name to execute
|
74 |
* @param args input parameters of the method
|
75 |
*
|
76 |
* @return An Object that represents the execution
|
77 |
*
|
78 |
* @throws NoSuchMethodException If there isn't a main function to begin the execution
|
79 |
*/
|
80 |
@Override
|
81 |
public Object invokeFunction(String name, Object[] args) throws NoSuchMethodException; |
82 |
|
83 |
public String getMimeType(); |
84 |
|
85 |
public void registerDataFolder(String id); |
86 |
} |