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