blob: b6c2f7cc2df52ce5243a575d01fc8f3b489985a6 [file] [log] [blame]
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +05303 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yangutils.datamodel;
18
19import java.util.Stack;
Bharat saraswald9822e92016-04-05 15:13:44 +053020
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053021import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
22
23/**
Bharat saraswald9822e92016-04-05 15:13:44 +053024 * Represents resolution object which will be resolved by linker.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053025 */
26public class YangResolutionInfo<T> {
27
28 // Prefix associated with the linking.
29 private String prefix;
30
31 // Parsable node for which resolution is to be performed.
32 private T entityToResolve;
33
34 // Holder of the YANG construct for which resolution has to be carried out.
35 private YangNode holderOfEntityToResolve;
36
37 // Error Line number.
38 private int lineNumber;
39
40 // Error character position.
41 private int charPosition;
42
43 // Status of resolution.
44 private boolean isResolved;
45
46 /*
Bharat saraswald9822e92016-04-05 15:13:44 +053047 * Stack for type/uses is maintained for hierarchical references, this is
48 * used during resolution.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053049 */
50 private Stack<T> partialResolvedStack;
51
52 // Flag to indicate whether more references are detected.
53 private boolean isMoreReferenceDetected;
54
55 // Module/Sub-module prefix.
56 private String resolutionInfoRootNodePrefix;
57
58 /**
59 * Create a resolution information object.
60 */
61 private YangResolutionInfo() {
62
63 }
64
65 /**
66 * Creates a resolution information object with all the inputs.
67 *
68 * @param dataNode current parsable data node
69 * @param resolutionType type of resolution whether grouping/typedef
70 * @param holderNode parent YANG node
71 * @param prefix imported module prefix
72 * @param lineNumber error line number
73 * @param charPositionInLine error character position in line
74 */
75 public YangResolutionInfo(T dataNode, ResolutionType resolutionType,
Bharat saraswald9822e92016-04-05 15:13:44 +053076 YangNode holderNode, String prefix, int lineNumber,
77 int charPositionInLine) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053078 this.setHolderOfEntityToResolve(holderNode);
79 this.setEntityToResolve(dataNode);
80 this.setPrefix(prefix);
81 this.setLineNumber(lineNumber);
82 this.setCharPosition(charPositionInLine);
83 setPartialResolvedStack(new Stack<T>());
84 }
85
86 /**
87 * Creates a resolution information object with all the inputs except prefix.
88 *
89 * @param dataNode current parsable data node
90 * @param resolutionType type of resolution whether grouping/typedef
91 * @param holderNode parent YANG node
92 * @param lineNumber error line number
93 * @param charPositionInLine error character position in line
94 */
95 public YangResolutionInfo(T dataNode, ResolutionType resolutionType,
Bharat saraswald9822e92016-04-05 15:13:44 +053096 YangNode holderNode, int lineNumber,
97 int charPositionInLine) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053098 this.setHolderOfEntityToResolve(holderNode);
99 this.setEntityToResolve(dataNode);
100 this.setLineNumber(lineNumber);
101 this.setCharPosition(charPositionInLine);
102 }
103
104 /**
105 * Resolve linking with all the ancestors node for a resolution info.
106 *
107 * @param resolutionInfoNodePrefix module/sub-module prefix
108 * @throws DataModelException DataModelException a violation of data model rules
109 */
Bharat saraswald9822e92016-04-05 15:13:44 +0530110 public void resolveLinkingForResolutionInfo(String resolutionInfoNodePrefix) throws DataModelException {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530111
112 this.resolutionInfoRootNodePrefix = resolutionInfoNodePrefix;
113
114 // Current node to resolve, it can be a YANG type or YANG uses.
115 T entityToResolve = getEntityToResolve();
116
117 // Check if linking is already done
118 if (entityToResolve instanceof Resolvable) {
119 Resolvable resolvable = (Resolvable) entityToResolve;
120 if (resolvable.getResolvableStatus() == ResolvableStatus.RESOLVED ||
121 resolvable.getResolvableStatus() == ResolvableStatus.PARTIALLY_RESOLVED) {
122 return;
123 }
124 } else {
125 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
126 }
127
128 // Push the initial YANG type to the stack.
129 getPartialResolvedStack().push(entityToResolve);
130
131 // Get holder of entity to resolve
132 YangNode curNode = getHolderOfEntityToResolve();
133
134 resolveLinkingWithAncestors(curNode);
135 }
136
137 /**
138 * Resolves linking with ancestors.
139 *
140 * @param curNode current node for which ancestors to be checked
141 * @throws DataModelException a violation of data model rules
142 */
143 private void resolveLinkingWithAncestors(YangNode curNode) throws DataModelException {
144
145 while (curNode != null) {
146 YangNode node = curNode.getChild();
147 if (resolveLinkingForNodesChildAndSibling(node, curNode)) {
148 return;
149 }
150 curNode = curNode.getParent();
151 }
152
153 // If curNode is null, it indicates an error condition in YANG file.
154 DataModelException dataModelException = new DataModelException("YANG file error: Unable to find base " +
155 "typedef/grouping for given type/uses");
156 dataModelException.setLine(getLineNumber());
157 dataModelException.setCharPosition(getCharPosition());
158 throw dataModelException;
159 }
160
161 /**
162 * Resolves linking for a node child and siblings.
163 *
164 * @param node current node
165 * @param parentNode parent node of current node
166 * @return flag to indicate whether resolution is done
167 * @throws DataModelException
168 */
169 private boolean resolveLinkingForNodesChildAndSibling(YangNode node, YangNode parentNode)
170 throws DataModelException {
171 while ((node != null)) {
172 isMoreReferenceDetected = false;
173 // Check if node is of type, typedef or grouping
174 if (isNodeOfResolveType(node)) {
175 if (resolveLinkingForNode(node, parentNode)) {
176 return true;
177 }
178 }
179 if (isMoreReferenceDetected) {
180 /*
Bharat saraswald9822e92016-04-05 15:13:44 +0530181 * If more reference are present, tree traversal must start from
182 * first child again, to check the availability of
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530183 * typedef/grouping.
184 */
185 node = parentNode.getChild();
186 } else {
187 node = node.getNextSibling();
188 }
189 }
190 return false;
191 }
192
193 /**
194 * Resolves linking for a node.
195 *
196 * @param node current node
197 * @param parentNode parent node of current node
198 * @return flag to indicate whether resolution is done
199 * @throws DataModelException a violation of data model rules
200 */
Bharat saraswald9822e92016-04-05 15:13:44 +0530201 private boolean resolveLinkingForNode(YangNode node, YangNode parentNode) throws DataModelException {
202
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530203 /*
Bharat saraswald9822e92016-04-05 15:13:44 +0530204 * Check if name of node name matches with the entity name under
205 * resolution.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530206 */
207 if (isNodeNameSameAsResolutionInfoName(node)) {
Bharat saraswald9822e92016-04-05 15:13:44 +0530208 // Adds reference of entity to the node under resolution.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530209 addReferredEntityLink(node);
210 // Check if referred entity has further reference to uses/type.
211 if (!(isMoreReferencePresent(node))) {
212 // Resolve all the entities in stack.
213 resolveStackAndAddToStack(node);
214 return true;
215 } else {
Bharat saraswald9822e92016-04-05 15:13:44 +0530216 // Adds referred type/uses to the stack.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530217 addToPartialResolvedStack(node);
218 /*
219 * Check whether referred type is resolved, partially resolved
220 * or unresolved.
221 */
222 if (isReferenceFullyResolved()) {
223 // Resolve the stack which is complete.
224 resolveCompleteStack();
225 return true;
226 } else if (isReferencePartiallyResolved()) {
227 /*
228 * Update the resolution type to partially resolved for all
229 * type/uses in stack
230 */
231 updateResolutionTypeToPartial();
232 return true;
233 } else {
Bharat saraswald9822e92016-04-05 15:13:44 +0530234 /*
235 * Check if prefix is present to find that the derived
236 * reference is for intra file or inter file, if it's
237 * inter-file return and stop further processing.
238 */
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530239 if (isExternalPrefixPresent(node)) {
240 /*
Bharat saraswald9822e92016-04-05 15:13:44 +0530241 * Update the resolution type to partially resolved for
242 * all type/uses in stack
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530243 */
244 updateResolutionTypeToPartial();
245 return true;
246 } else {
Bharat saraswald9822e92016-04-05 15:13:44 +0530247 /*
248 * If prefix is not present it indicates intra-file
249 * dependency in this case set the node back to first
250 * child, as referred entity may appear in any order and
251 * continue with the resolution.
252 */
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530253 isMoreReferenceDetected = true;
254 return false;
255 }
256 }
257 }
258 }
259 return false;
260 }
261
262 /**
263 * Update resolution type to partial for all type/uses in stack.
264 *
265 * @throws DataModelException a violation of data model rules
266 */
267 private void updateResolutionTypeToPartial() throws DataModelException {
268 // For all entries in stack calls for the resolution in type/uses.
Bharat saraswald9822e92016-04-05 15:13:44 +0530269 for (T entity : getPartialResolvedStack()) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530270 if (!(entity instanceof Resolvable)) {
271 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
272 }
273 if (((Resolvable) entity).getResolvableStatus() == ResolvableStatus.UNRESOLVED) {
Bharat saraswald9822e92016-04-05 15:13:44 +0530274 // Sets the resolution status in inside the type/uses.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530275 ((Resolvable) entity).setResolvableStatus(ResolvableStatus.PARTIALLY_RESOLVED);
276 }
277 }
278 }
279
280 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530281 * Adds referred type/uses to the stack and resolve the stack.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530282 *
283 * @param node typedef/grouping node
284 * @throws DataModelException a violation of data model rules
285 */
286 private void resolveStackAndAddToStack(YangNode node) throws DataModelException {
287 if (getEntityToResolve() instanceof YangType) {
Bharat saraswald9822e92016-04-05 15:13:44 +0530288 // Adds to the stack only for YANG typedef.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530289 getPartialResolvedStack().push((T) ((YangTypeDef) node).getDataType());
290 }
291 // Don't add to stack in case of YANG grouping.
292
293 // Resolve the complete stack.
294 resolveCompleteStack();
295 }
296
297 /**
298 * Check if the referred type/uses is partially resolved.
299 *
300 * @return true if reference is partially resolved, otherwise false
301 */
302 private boolean isReferencePartiallyResolved() {
303 if (getPartialResolvedStack().peek() instanceof YangType) {
304 /*
305 * Checks if type is partially resolved.
306 */
Bharat saraswald9822e92016-04-05 15:13:44 +0530307 if (((YangType) getPartialResolvedStack().peek())
308 .getResolvableStatus() == ResolvableStatus.PARTIALLY_RESOLVED) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530309 return true;
310 }
311 } else if (getPartialResolvedStack().peek() instanceof YangUses) {
Bharat saraswald9822e92016-04-05 15:13:44 +0530312 if (((YangUses) getPartialResolvedStack().peek())
313 .getResolvableStatus() == ResolvableStatus.PARTIALLY_RESOLVED) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530314 return true;
315 }
316 }
317 return false;
318 }
319
320 /**
321 * Check if the referred type/uses is resolved.
322 *
323 * @return true if reference is resolved, otherwise false
324 */
325 private boolean isReferenceFullyResolved() {
326 if (getPartialResolvedStack().peek() instanceof YangType) {
327 /*
328 * Checks if type is partially resolved.
329 */
Bharat saraswald9822e92016-04-05 15:13:44 +0530330 if (((YangType) getPartialResolvedStack().peek()).getResolvableStatus() == ResolvableStatus.RESOLVED) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530331 return true;
332 }
333 } else if (getPartialResolvedStack().peek() instanceof YangUses) {
Bharat saraswald9822e92016-04-05 15:13:44 +0530334 if (((YangUses) getPartialResolvedStack().peek()).getResolvableStatus() == ResolvableStatus.RESOLVED) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530335 return true;
336 }
337 }
338 return false;
339 }
340
341 /**
342 * Check if node is of resolve type i.e. of type typedef or grouping.
343 *
344 * @param node typedef/grouping node
345 * @return true if node is of resolve type otherwise false
346 * @throws DataModelException a violation of data model rules
347 */
348 private boolean isNodeOfResolveType(YangNode node) throws DataModelException {
349 if (getPartialResolvedStack().peek() instanceof YangType && entityToResolve instanceof YangType) {
350 if (node instanceof YangTypeDef) {
351 return true;
352 }
353 } else if (getPartialResolvedStack().peek() instanceof YangUses && entityToResolve instanceof YangUses) {
354 if (node instanceof YangGrouping) {
355 return true;
356 }
357 } else {
358 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
359 }
360 return false;
361 }
362
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530363 /**
364 * Check if node name is same as name in resolution info, i.e. name of
365 * typedef/grouping is same as name of type/uses.
366 *
367 * @param node typedef/grouping node
368 * @return true if node name is same as name in resolution info, otherwise
369 * false
370 * @throws DataModelException a violation of data model rules
371 */
372 private boolean isNodeNameSameAsResolutionInfoName(YangNode node) throws DataModelException {
373 if (getPartialResolvedStack().peek() instanceof YangType) {
374 if (node.getName().equals(((YangType<?>) getPartialResolvedStack().peek()).getDataTypeName())) {
375 return true;
376 }
377 } else if (getPartialResolvedStack().peek() instanceof YangUses) {
378 if (node.getName().equals(((YangUses) getPartialResolvedStack().peek()).getName())) {
379 return true;
380 }
381 } else {
382 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
383 }
384 return false;
385 }
386
387 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530388 * Adds reference of grouping/typedef in uses/type.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530389 *
390 * @param node grouping/typedef node
391 * @throws DataModelException a violation of data model rules
392 */
393 private void addReferredEntityLink(YangNode node) throws DataModelException {
394 if (getPartialResolvedStack().peek() instanceof YangType) {
395 YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) ((YangType<?>) getPartialResolvedStack().peek())
396 .getDataTypeExtendedInfo();
397 derivedInfo.setReferredTypeDef((YangTypeDef) node);
398 } else if (getPartialResolvedStack().peek() instanceof YangUses) {
399 ((YangUses) getPartialResolvedStack().peek()).setRefGroup((YangGrouping) node);
400 } else {
401 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
402 }
403 }
404
405 /**
406 * Checks if typedef/grouping has further reference to type/typedef.
407 *
408 * @param node grouping/typedef node
409 * @return true if referred entity is resolved, otherwise false
410 * @throws DataModelException a violation of data model rules
411 */
412 private boolean isMoreReferencePresent(YangNode node) throws DataModelException {
413 if (getEntityToResolve() instanceof YangType) {
414 /*
415 * Checks if typedef type is built-in type
416 */
417 if ((((YangTypeDef) node).getDataType().getDataType() != YangDataTypes.DERIVED)) {
418 return false;
419 }
420 } else if (getEntityToResolve() instanceof YangUses) {
421 /*
422 * Search if the grouping has any uses child, if so return false,
423 * else return true.
424 */
425 if (getUsesInGrouping(node) == null) {
426 return false;
427 }
428 } else {
429 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
430 }
431 return true;
432 }
433
434 /**
435 * Return if there is any uses in grouping.
436 *
437 * @param node grouping/typedef node
438 * @return if there is any uses in grouping, otherwise return null
439 */
440 private YangUses getUsesInGrouping(YangNode node) {
441 YangNode curNode = ((YangGrouping) node).getChild();
442 while (curNode != null) {
443 if (curNode instanceof YangUses) {
444 break;
445 }
446 curNode = curNode.getNextSibling();
447 }
448 return (YangUses) curNode;
449 }
450
451 /**
452 * Resolve the complete stack.
453 *
454 * @throws DataModelException a violation of data model rules
455 */
456 private void resolveCompleteStack() throws DataModelException {
457 // For all entries in stack calls for the resolution in type/uses.
Bharat saraswald9822e92016-04-05 15:13:44 +0530458 for (T entity : getPartialResolvedStack()) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530459 if (!(entity instanceof Resolvable)) {
460 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
461 }
462 ((Resolvable) entity).resolve();
Bharat saraswald9822e92016-04-05 15:13:44 +0530463 // Sets the resolution status in inside the type/uses.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530464 ((Resolvable) entity).setResolvableStatus(ResolvableStatus.RESOLVED);
465 }
466 /*
Bharat saraswald9822e92016-04-05 15:13:44 +0530467 * Sets the resolution status in resolution info present in resolution
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530468 * list.
469 */
470 setIsResolved(true);
471 }
472
473 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530474 * Adds to partial resolved stack.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530475 *
476 * @param node grouping/typedef node
477 * @throws DataModelException a violation of data model rules
478 */
479 private void addToPartialResolvedStack(YangNode node) throws DataModelException {
480 if (getPartialResolvedStack().peek() instanceof YangType) {
Bharat saraswald9822e92016-04-05 15:13:44 +0530481 // Adds to the stack only for YANG typedef.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530482 getPartialResolvedStack().push((T) ((YangTypeDef) node).getDataType());
483 } else if (getPartialResolvedStack().peek() instanceof YangUses) {
484 getPartialResolvedStack().push((T) getUsesInGrouping(node));
485 } else {
486 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
487 }
488 }
489
490 /**
491 * Check if prefix is associated with type/uses.
492 *
493 * @param node typedef/grouping node
494 * @return true if prefix is present, otherwise false
495 * @throws DataModelException a violation of data model rules
496 */
497 private boolean isExternalPrefixPresent(YangNode node) throws DataModelException {
498 if (getEntityToResolve() instanceof YangType) {
499 if (((YangTypeDef) node).getDataType().getPrefix() != null &&
500 (!((YangTypeDef) node).getDataType().getPrefix().equals(resolutionInfoRootNodePrefix))) {
501 return true;
502 }
503 } else if (getEntityToResolve() instanceof YangUses) {
504 if (getUsesInGrouping(node).getPrefix() != null) {
505 return true;
506 }
507 } else {
508 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
509 }
510 return false;
511 }
512
513 /**
514 * Returns prefix of imported module.
515 *
516 * @return prefix of imported module
517 */
518 public String getPrefix() {
519 return prefix;
520 }
521
522 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530523 * Sets prefix of imported module.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530524 *
525 * @param prefix of imported module
526 */
527 public void setPrefix(String prefix) {
528 this.prefix = prefix;
529 }
530
531 /**
532 * Returns parsable entity which is to be resolved.
533 *
534 * @return parsable entity which is to be resolved
535 */
536 public T getEntityToResolve() {
537 return entityToResolve;
538 }
539
540 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530541 * Sets parsable entity to be resolved.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530542 *
543 * @param entityToResolve YANG entity to be resolved
544 */
545 public void setEntityToResolve(T entityToResolve) {
546 this.entityToResolve = entityToResolve;
547 }
548
549 /**
550 * Returns parent YANG node holder for the entity to be resolved.
551 *
552 * @return parent YANG node holder
553 */
554 public YangNode getHolderOfEntityToResolve() {
555 return holderOfEntityToResolve;
556 }
557
558 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530559 * Sets parent YANG node holder for the entity to be resolved.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530560 *
561 * @param holderOfEntityToResolve parent YANG node holder
562 */
563 public void setHolderOfEntityToResolve(YangNode holderOfEntityToResolve) {
564 this.holderOfEntityToResolve = holderOfEntityToResolve;
565 }
566
567 /**
568 * Returns error position.
569 *
570 * @return error position
571 */
572 public int getCharPosition() {
573 return charPosition;
574 }
575
576 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530577 * Sets error position.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530578 *
579 * @param charPosition position of error
580 */
581 public void setCharPosition(int charPosition) {
582 this.charPosition = charPosition;
583 }
584
585 /**
586 * Returns error character position in line.
587 *
588 * @return error character position in line
589 */
590 public int getLineNumber() {
591 return lineNumber;
592 }
593
594 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530595 * Sets error character position in line.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530596 *
597 * @param lineNumber error character position in line
598 */
599 public void setLineNumber(int lineNumber) {
600 this.lineNumber = lineNumber;
601 }
602
603 /**
604 * Returns status of resolution.
605 *
606 * @return resolution status
607 */
608 public boolean isResolved() {
609 return isResolved;
610 }
611
612 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530613 * Sets status of resolution.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530614 *
615 * @param isResolved resolution status
616 */
617 public void setIsResolved(boolean isResolved) {
618 this.isResolved = isResolved;
619 }
620
621 /**
622 * Returns stack of YANG type with partially resolved YANG construct hierarchy.
623 *
624 * @return partial resolved YANG construct stack
625 */
626 public Stack<T> getPartialResolvedStack() {
627 return partialResolvedStack;
628 }
629
630 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530631 * Sets stack of YANG type with partially resolved YANG construct hierarchy.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530632 *
633 * @param partialResolvedStack partial resolved YANG construct stack
634 */
635 public void setPartialResolvedStack(Stack<T> partialResolvedStack) {
636 this.partialResolvedStack = partialResolvedStack;
637 }
638}