Statistics
| Revision:

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 @ 468

History | View | Annotate | Download (2.06 KB)

1
package org.gvsig.scripting;
2

    
3

    
4
/**
5
 * <p> Interface that represents a single script without window dialog.</p>
6
 * 
7
 * @see ScriptingUnit
8
 * @see ScriptingBaseScript
9
 */
10
public interface ScriptingScript extends ScriptingBaseScript {
11

    
12
        /**
13
         * Returns the languange in which the ScriptingScript is written.
14
         * 
15
         * @return a String containing the name of the language
16
         */
17
        public String getLangName();
18

    
19
        /**
20
         * Returns the ScriptingScript's code.
21
         * 
22
         * @return a String with the code of the script.
23
         */
24
        public String getCode();
25

    
26
        /**
27
         * Sets a the code associated with a ScriptingScript.
28
         *
29
         * @param code
30
         *            String that contains the new code.
31
         */
32
        public void setCode(String code);
33

    
34
        /**
35
         * Returns the name of the main function in the ScriptingScript's code
36
         * 
37
         * @return a String with main function (default main name is 'main').
38
         */
39
        public String getMainName();
40

    
41
        /**
42
         * Stablishes a new main main function in the ScriptingScript's code.
43
         *
44
         * @param mainName
45
         *            String that contains the new main function name.
46
         */
47
        public void setMainName(String mainName);
48

    
49
        /**
50
         * Persists the current status of a ScriptingScript with the content associated.
51
         */
52
        public void save();
53
        
54
        /**
55
         * Executes a method from the Script's code
56
         * 
57
         * @param obj this Object represents the script's code
58
         * @param name method's name to execute
59
         * @param args input parameters of the method 
60
         * 
61
         * @return An Object that represents the execution
62
         * 
63
         * @throws NoSuchMethodException If there isn't a main function to begin the execution
64
         */
65
        public Object invokeMethod(Object obj, String name, Object[] args) throws NoSuchMethodException;
66
        
67
        /**
68
         * Executes a function from the Script's code
69
         * 
70
         * @param name method's name to execute
71
         * @param args input parameters of the method 
72
         * 
73
         * @return An Object that represents the execution
74
         * 
75
         * @throws NoSuchMethodException If there isn't a main function to begin the execution
76
         */
77
        public Object invokeFunction(String name, Object[] args) throws NoSuchMethodException;
78
        
79
        public String getMimeType();
80
}