1 package org.simantics.structural2.scl;
\r
3 import org.simantics.db.Resource;
\r
7 * Represents a structural configuration.
\r
8 * Has exactly two subclasses {@link StructuralComponent} and {@link StructuralComposite}.
\r
10 * @author Hannu Niemistö
\r
12 public abstract class StructuralConfiguration<Connection> {
\r
14 * Prevents extending this class outside of this package.
\r
16 public StructuralConfiguration() {
\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
27 public abstract Resource getResource();
\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
38 public Resource getInstanceResource() {
\r
39 return getResource();
\r
42 public abstract StructuralComponent<Connection> getContext();
\r