]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.modeling/src/org/simantics/modeling/IComponentTypeScriptEnvironmentFactory.java
Layer0Utils.addL0Identifier to prevent possible differentiation of code
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / IComponentTypeScriptEnvironmentFactory.java
1 package org.simantics.modeling;
2
3 import java.util.Set;
4
5 import org.simantics.db.ReadGraph;
6 import org.simantics.db.Resource;
7 import org.simantics.db.exception.DatabaseException;
8 import org.simantics.scl.compiler.environment.LocalEnvironment;
9 import org.simantics.scl.compiler.environment.specification.EnvironmentSpecification;
10
11 public interface IComponentTypeScriptEnvironmentFactory {
12
13     /**
14      * Return the EnvironmentSpecification used to initialize the runtime environment for this script
15      * 
16      * @param graph
17      * @param componentType
18      * @return the runtime enviroment
19      * @throws DatabaseException
20      */
21     public EnvironmentSpecification getRuntimeEnvironmentSpecification(ReadGraph graph, Resource componentType) throws DatabaseException;
22     
23     /**
24      * Return a local environment for this script if one is needed
25      * 
26      * @param graph
27      * @param componentType
28      * @return the local environment or null
29      * @throws DatabaseException
30      */
31     public LocalEnvironment getLocalEnvironment(ReadGraph graph, Resource componentType) throws DatabaseException;
32     
33     /**
34      * Get the set of all modules the local environment returned by getLocalEnvironment reads from
35      * 
36      * @param environment
37      * @return a set of module names or null
38      */
39     public Set<String> getModuleReads(LocalEnvironment environment);
40     
41     /**
42      * Get the set of all modules the local environment returned by getLocalEnvironment writes to
43      * 
44      * @param environment
45      * @return a set of module names or null
46      */
47     public Set<String> getModuleWrites(LocalEnvironment environment);
48     
49 }