1
2
3
4
5
6 package gov.nist.secauto.metaschema.core.model;
7
8 import gov.nist.secauto.metaschema.core.model.util.ModuleUtils;
9 import gov.nist.secauto.metaschema.core.util.ObjectUtils;
10
11 import edu.umd.cs.findbugs.annotations.NonNull;
12
13
14
15
16
17
18
19
20
21 public abstract class AbstractNamedModelInstance<
22 PARENT extends IContainerModel,
23 PARENT_DEFINITION extends IAssemblyDefinition>
24 extends AbstractNamedInstance<PARENT>
25 implements INamedModelInstance {
26
27
28
29
30
31
32
33 protected AbstractNamedModelInstance(@NonNull PARENT parent) {
34 super(parent, name -> ModuleUtils.parseModelName(parent.getOwningDefinition().getContainingModule(), name));
35 }
36
37 @Override
38 public final PARENT_DEFINITION getContainingDefinition() {
39
40
41
42
43 return ObjectUtils.asType(getParentContainer().getOwningDefinition());
44 }
45
46 @Override
47 public IModule getContainingModule() {
48 return getContainingDefinition().getContainingModule();
49 }
50 }