1
2
3
4
5
6 package gov.nist.secauto.metaschema.core.model;
7
8 import gov.nist.secauto.metaschema.core.MetaschemaConstants;
9 import gov.nist.secauto.metaschema.core.model.constraint.IFeatureModelConstrained;
10
11 import javax.xml.namespace.QName;
12
13 import edu.umd.cs.findbugs.annotations.Nullable;
14
15 public interface IAssemblyDefinition
16 extends IModelDefinition, IContainerModelAssembly, IAssembly, IFeatureModelConstrained {
17 QName MODEL_QNAME = new QName(MetaschemaConstants.METASCHEMA_NAMESPACE, "model");
18
19
20
21
22
23
24
25 default boolean isRoot() {
26
27 return false;
28 }
29
30
31
32
33
34
35
36 @Nullable
37 default String getRootName() {
38
39 return null;
40 }
41
42
43
44
45
46
47
48
49 @Nullable
50 default Integer getRootIndex() {
51
52 return null;
53 }
54
55
56
57
58
59
60
61 default QName getRootXmlQName() {
62 QName retval = null;
63 String rootName = getRootName();
64 if (rootName != null) {
65 retval = getContainingModule().toModelQName(rootName);
66 }
67 return retval;
68 }
69
70
71
72
73
74
75
76 default String getRootJsonName() {
77 return getRootName();
78 }
79
80 @Override
81 default boolean isInline() {
82
83 return false;
84 }
85
86 @Override
87 default IAssemblyInstance getInlineInstance() {
88
89 return null;
90 }
91
92 @Override
93 default IAssemblyDefinition getOwningDefinition() {
94 return this;
95 }
96
97
98
99
100
101
102 @Override
103 default boolean hasChildren() {
104 return IModelDefinition.super.hasChildren() || IContainerModelAssembly.super.hasChildren();
105 }
106 }