1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 package ca.uhn.hl7v2.parser;
28
29 import java.util.Collections;
30 import java.util.List;
31 import java.util.Set;
32
33
34
35
36
37
38
39
40 public class NonStandardStructureDefinition implements IStructureDefinition {
41
42 private final String myName;
43 private final IStructureDefinition myParent;
44 private final int myPosition;
45 private final IStructureDefinition myPreviousSibling;
46
47
48
49
50 public NonStandardStructureDefinition(IStructureDefinitionuhn/hl7v2/parser/IStructureDefinition.html#IStructureDefinition">IStructureDefinition theParent, IStructureDefinition thePreviousSibling, String theName, int thePosition) {
51 if (theName == null || theName.length() == 0) {
52 throw new IllegalArgumentException("theName is missing");
53 }
54
55 myParent = theParent;
56 myName = theName;
57 myPreviousSibling = thePreviousSibling;
58 myPosition = thePosition;
59 }
60
61
62
63
64 @Override
65 public Set<String> getAllChildNames() {
66 return Collections.emptySet();
67 }
68
69
70
71
72 @Override
73 public Set<String> getAllPossibleFirstChildren() {
74 return Collections.emptySet();
75 }
76
77
78
79
80 @Override
81 public List<StructureDefinition> getChildren() {
82 return Collections.emptyList();
83 }
84
85
86
87
88 @Override
89 public IStructureDefinition getFirstChild() {
90 return null;
91 }
92
93
94
95
96 @Override
97 public IStructureDefinition getFirstSibling() {
98 return null;
99 }
100
101
102
103
104 public String getName() {
105 return myName;
106 }
107
108
109
110
111 @Override
112 public String getNameAsItAppearsInParent() {
113 return getName();
114 }
115
116
117
118
119 @Override
120 public Set<String> getNamesOfAllPossibleFollowingLeaves() {
121 return myPreviousSibling.getNamesOfAllPossibleFollowingLeaves();
122 }
123
124
125
126
127 @Override
128 public IStructureDefinition getNextLeaf() {
129 return myPreviousSibling.getNextLeaf();
130 }
131
132
133
134
135 @Override
136 public IStructureDefinition getNextSibling() {
137 return myPreviousSibling.getNextSibling();
138 }
139
140
141
142
143 @Override
144 public IStructureDefinition getParent() {
145 return myParent;
146 }
147
148
149
150
151 @Override
152 public int getPosition() {
153 return myPosition;
154 }
155
156
157
158
159 @Override
160 public boolean hasChildren() {
161 return false;
162 }
163
164
165
166
167 @Override
168 public boolean isFinalChildOfParent() {
169 return myPreviousSibling.isFinalChildOfParent();
170 }
171
172
173
174
175 @Override
176 public boolean isRepeating() {
177 return true;
178 }
179
180
181
182
183 @Override
184 public boolean isRequired() {
185 return false;
186 }
187
188
189
190
191 @Override
192 public boolean isSegment() {
193 return true;
194 }
195
196
197
198
199 @Override
200 public boolean isChoiceElement() {
201 return false;
202 }
203
204 }