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 | 164 | jobacas | package org.gvsig.scripting; |
---|---|---|---|
2 | |||
3 | 630 | jjdelcerro | import org.gvsig.tools.script.Script; |
4 | 164 | jobacas | |
5 | 630 | jjdelcerro | |
6 | 164 | jobacas | /**
|
7 | * <p> Interface that represents a single script without window dialog.</p>
|
||
8 | *
|
||
9 | * @see ScriptingUnit
|
||
10 | * @see ScriptingBaseScript
|
||
11 | */
|
||
12 | 630 | jjdelcerro | public interface ScriptingScript extends ScriptingBaseScript, Script { |
13 | 164 | jobacas | |
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 | 814 | jjdelcerro | @Override
|
27 | 164 | jobacas | 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 | 172 | jobacas | * Stablishes a new main main function in the ScriptingScript's code.
|
46 | 164 | jobacas | *
|
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 | 172 | jobacas | /**
|
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 | 164 | jobacas | public Object invokeMethod(Object obj, String name, Object[] args) throws NoSuchMethodException; |
69 | |||
70 | 172 | jobacas | /**
|
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 | 630 | jjdelcerro | @Override
|
81 | 164 | jobacas | public Object invokeFunction(String name, Object[] args) throws NoSuchMethodException; |
82 | |||
83 | 468 | jjdelcerro | public String getMimeType(); |
84 | 1084 | jjdelcerro | |
85 | public void registerDataFolder(String id); |
||
86 | 164 | jobacas | } |