1 package org.simantics.structural2.scl;
3 import org.simantics.db.Resource;
7 * Represents a structural configuration.
8 * Has exactly two subclasses {@link StructuralComponent} and {@link StructuralComposite}.
10 * @author Hannu Niemistö
12 public abstract class StructuralConfiguration<Connection> {
14 * Prevents extending this class outside of this package.
16 public StructuralConfiguration() {
20 * Returns underlying resource of the configuration.
21 * It can be used to obtain information about the configuration
22 * that is not accessible using StructuralComponent or
23 * StructuralComposite. For procedural configurations
24 * this method may return {@code null} or a resource
25 * that represents a template of the configuration.
27 public abstract Resource getResource();
30 * If the configuration is a root composite of a component
31 * type, there are two possible resources that could be
32 * reasonably returned in getResource(). New getResource()
33 * returns the resource that is linked with IsDefinedBy from
34 * the component type and getInstanceResource() returns the
35 * instance of the component type. In all other cases this
36 * method returns the same resource as getResource().
38 public Resource getInstanceResource() {
42 public abstract StructuralComponent<Connection> getContext();