]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.structural2/src/org/simantics/structural2/scl/StructuralConfiguration.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.structural2 / src / org / simantics / structural2 / scl / StructuralConfiguration.java
1 package org.simantics.structural2.scl;\r
2 \r
3 import org.simantics.db.Resource;\r
4 \r
5 \r
6 /**\r
7  * Represents a structural configuration.\r
8  * Has exactly two subclasses {@link StructuralComponent} and {@link StructuralComposite}.\r
9  * \r
10  * @author Hannu Niemistö\r
11  */\r
12 public abstract class StructuralConfiguration<Connection> {\r
13     /*\r
14      * Prevents extending this class outside of this package. \r
15      */\r
16     public StructuralConfiguration() {\r
17     }\r
18     \r
19     /**\r
20      * Returns underlying resource of the configuration.\r
21      * It can be used to obtain information about the configuration\r
22      * that is not accessible using StructuralComponent or\r
23      * StructuralComposite. For procedural configurations\r
24      * this method may return {@code null} or a resource\r
25      * that represents a template of the configuration.\r
26      */\r
27     public abstract Resource getResource();\r
28     \r
29     /**\r
30      * If the configuration is a root composite of a component\r
31      * type, there are two possible resources that could be\r
32      * reasonably returned in getResource(). New getResource()\r
33      * returns the resource that is linked with IsDefinedBy from\r
34      * the component type and getInstanceResource() returns the\r
35      * instance of the component type. In all other cases this\r
36      * method returns the same resource as getResource().\r
37      */\r
38     public Resource getInstanceResource() {\r
39         return getResource();\r
40     }\r
41     \r
42     public abstract StructuralComponent<Connection> getContext();\r
43 }\r