blob: d2d8bc285efac150dcd1e68607854afa598ef2d4 [file] [log] [blame]
Vinod Kumar S2ff139c2016-02-16 01:37:16 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Vinod Kumar S2ff139c2016-02-16 01:37:16 +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 */
16package org.onosproject.yangutils.datamodel;
17
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +053018import java.util.LinkedList;
19import java.util.List;
20
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053021import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +053022import org.onosproject.yangutils.linker.Resolvable;
23import org.onosproject.yangutils.linker.ResolvableStatus;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053024import org.onosproject.yangutils.linker.exceptions.LinkerException;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053025import org.onosproject.yangutils.parser.Parsable;
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053026import org.onosproject.yangutils.utils.YangConstructType;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053027
janani b4e53f9b2016-04-26 18:49:20 +053028import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
Vinod Kumar S427d2932016-04-20 13:02:58 +053029import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getParentNodeInGenCode;
30
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053031/*-
32 * Reference RFC 6020.
33 *
34 * The "uses" statement is used to reference a "grouping" definition. It takes
35 * one argument, which is the name of the grouping.
36 *
37 * The effect of a "uses" reference to a grouping is that the nodes defined by
38 * the grouping are copied into the current schema tree, and then updated
39 * according to the "refine" and "augment" statements.
40 *
41 * The identifiers defined in the grouping are not bound to a namespace until
42 * the contents of the grouping are added to the schema tree via a "uses"
43 * statement that does not appear inside a "grouping" statement, at which point
44 * they are bound to the namespace of the current module.
45 *
46 * The uses's sub-statements
47 *
48 * +--------------+---------+-------------+------------------+
49 * | substatement | section | cardinality |data model mapping|
50 * +--------------+---------+-------------+------------------+
51 * | augment | 7.15 | 0..1 | -child nodes |
52 * | description | 7.19.3 | 0..1 | -string |
53 * | if-feature | 7.18.2 | 0..n | -TODO |
54 * | refine | 7.12.2 | 0..1 | -TODO |
55 * | reference | 7.19.4 | 0..1 | -string |
56 * | status | 7.19.2 | 0..1 | -YangStatus |
57 * | when | 7.19.5 | 0..1 | -TODO |
58 * +--------------+---------+-------------+------------------+
59 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053060
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053061/**
Bharat saraswald9822e92016-04-05 15:13:44 +053062 * Represents data model node to maintain information defined in YANG uses.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053063 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053064public class YangUses
65 extends YangNode
janani b4e53f9b2016-04-26 18:49:20 +053066 implements YangCommonInfo, Parsable, Resolvable, CollisionDetector {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053067
68 /**
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053069 * YANG node identifier.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053070 */
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053071 private YangNodeIdentifier nodeIdentifier;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053072
73 /**
Gaurav Agrawalbd804472016-03-25 11:25:36 +053074 * Referred group.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053075 */
76 private YangGrouping refGroup;
77
78 /**
Gaurav Agrawalbd804472016-03-25 11:25:36 +053079 * Description of YANG uses.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053080 */
81 private String description;
82
83 /**
84 * YANG reference.
85 */
86 private String reference;
87
88 /**
Gaurav Agrawalbd804472016-03-25 11:25:36 +053089 * Status of YANG uses.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053090 */
91 private YangStatusType status;
92
93 /**
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053094 * Status of resolution. If completely resolved enum value is "RESOLVED",
95 * if not enum value is "UNRESOLVED", in case reference of grouping/typedef
96 * is added to uses/type but it's not resolved value of enum should be
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053097 * "INTRA_FILE_RESOLVED".
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053098 */
99 private ResolvableStatus resolvableStatus;
100
101 /**
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530102 * Effective list of nodes of grouping that needs to replicated at YANG uses.
103 */
104 List<YangNode> resolvedGroupingNodes;
105
106 /**
107 * Effective list of leaves of grouping that needs to replicated at YANG uses.
108 */
109 List<List<YangLeaf>> resolvedGroupingLeaves;
110
111 /**
112 * Effective list of leaf lists of grouping that needs to replicated at YANG uses.
113 */
114 List<List<YangLeafList>> resolvedGroupingLeafLists;
115
116 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530117 * Creates an YANG uses node.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530118 */
119 public YangUses() {
120 super(YangNodeType.USES_NODE);
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530121 nodeIdentifier = new YangNodeIdentifier();
122 resolvableStatus = ResolvableStatus.UNRESOLVED;
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530123 resolvedGroupingNodes = new LinkedList<YangNode>();
124 resolvedGroupingLeaves = new LinkedList<List<YangLeaf>>();
125 resolvedGroupingLeafLists = new LinkedList<List<YangLeafList>>();
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530126 }
127
128 /**
Gaurav Agrawalbd804472016-03-25 11:25:36 +0530129 * Returns the referred group.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530130 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530131 * @return the referred group
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530132 */
133 public YangGrouping getRefGroup() {
134 return refGroup;
135 }
136
137 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530138 * Sets the referred group.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530139 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530140 * @param refGroup the referred group
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530141 */
142 public void setRefGroup(YangGrouping refGroup) {
143 this.refGroup = refGroup;
144 }
145
146 /**
Gaurav Agrawalbd804472016-03-25 11:25:36 +0530147 * Returns the description.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530148 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530149 * @return the description
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530150 */
Bharat saraswal594bc6d2016-02-22 22:15:21 +0530151 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530152 public String getDescription() {
153 return description;
154 }
155
156 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530157 * Sets the description.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530158 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530159 * @param description set the description
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530160 */
Bharat saraswal594bc6d2016-02-22 22:15:21 +0530161 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530162 public void setDescription(String description) {
163 this.description = description;
164 }
165
166 /**
Gaurav Agrawalbd804472016-03-25 11:25:36 +0530167 * Returns the textual reference.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530168 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530169 * @return the reference
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530170 */
Bharat saraswal594bc6d2016-02-22 22:15:21 +0530171 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530172 public String getReference() {
173 return reference;
174 }
175
176 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530177 * Sets the textual reference.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530178 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530179 * @param reference the reference to set
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530180 */
Bharat saraswal594bc6d2016-02-22 22:15:21 +0530181 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530182 public void setReference(String reference) {
183 this.reference = reference;
184 }
185
186 /**
Gaurav Agrawalbd804472016-03-25 11:25:36 +0530187 * Returns the status.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530188 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530189 * @return the status
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530190 */
Bharat saraswal594bc6d2016-02-22 22:15:21 +0530191 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530192 public YangStatusType getStatus() {
193 return status;
194 }
195
196 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530197 * Sets the status.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530198 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530199 * @param status the status to set
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530200 */
Bharat saraswal594bc6d2016-02-22 22:15:21 +0530201 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530202 public void setStatus(YangStatusType status) {
203 this.status = status;
204 }
205
206 /**
207 * Returns the type of the data.
208 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530209 * @return returns USES_DATA
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530210 */
Bharat saraswal594bc6d2016-02-22 22:15:21 +0530211 @Override
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530212 public YangConstructType getYangConstructType() {
213 return YangConstructType.USES_DATA;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530214 }
215
216 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530217 * Validates the data on entering the corresponding parse tree node.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530218 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530219 * @throws DataModelException a violation of data model rules
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530220 */
Bharat saraswal594bc6d2016-02-22 22:15:21 +0530221 @Override
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530222 public void validateDataOnEntry()
223 throws DataModelException {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530224 // TODO auto-generated method stub, to be implemented by parser
225 }
226
227 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530228 * Validates the data on exiting the corresponding parse tree node.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530229 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530230 * @throws DataModelException a violation of data model rules
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530231 */
Bharat saraswal594bc6d2016-02-22 22:15:21 +0530232 @Override
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530233 public void validateDataOnExit()
234 throws DataModelException {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530235 // TODO auto-generated method stub, to be implemented by parser
236 }
237
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530238 @Override
239 public String getName() {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530240 return nodeIdentifier.getName();
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530241 }
242
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530243 @Override
244 public void setName(String name) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530245 nodeIdentifier.setName(name);
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530246 }
247
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530248 /**
249 * Returns node identifier.
250 *
251 * @return node identifier
252 */
253 public YangNodeIdentifier getNodeIdentifier() {
254 return nodeIdentifier;
255 }
256
257 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530258 * Sets node identifier.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530259 *
260 * @param nodeIdentifier the node identifier
261 */
262 public void setNodeIdentifier(YangNodeIdentifier nodeIdentifier) {
263 this.nodeIdentifier = nodeIdentifier;
264 }
265
266 /**
267 * Returns prefix associated with uses.
268 *
269 * @return prefix associated with uses
270 */
271 public String getPrefix() {
272 return nodeIdentifier.getPrefix();
273 }
274
275 /**
276 * Get prefix associated with uses.
277 *
278 * @param prefix prefix associated with uses
279 */
280 public void setPrefix(String prefix) {
281 nodeIdentifier.setPrefix(prefix);
282 }
283
284 @Override
Vinod Kumar S427d2932016-04-20 13:02:58 +0530285 public void resolve()
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530286 throws LinkerException {
Vinod Kumar S427d2932016-04-20 13:02:58 +0530287
288 YangGrouping referredGrouping = getRefGroup();
289
290 if (referredGrouping == null) {
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530291 throw new LinkerException("Linker Exception: YANG uses linker error, cannot resolve uses");
Vinod Kumar S427d2932016-04-20 13:02:58 +0530292 }
293
294 YangNode usesParentNode = getParentNodeInGenCode(this);
Bharat saraswalcad0e652016-05-26 23:48:38 +0530295 if (!(usesParentNode instanceof YangLeavesHolder)
296 || !(usesParentNode instanceof CollisionDetector)) {
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530297 throw new LinkerException("Linker Exception: YANG uses holder construct is wrong");
Vinod Kumar S427d2932016-04-20 13:02:58 +0530298 }
299
300 YangLeavesHolder usesParentLeavesHolder = (YangLeavesHolder) usesParentNode;
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530301 if (referredGrouping.getListOfLeaf() != null
302 && referredGrouping.getListOfLeaf().size() != 0) {
303 addLeavesOfGrouping(
304 cloneLeavesList(referredGrouping.getListOfLeaf(),
305 usesParentLeavesHolder));
Vinod Kumar S427d2932016-04-20 13:02:58 +0530306 }
307
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530308 if (referredGrouping.getListOfLeafList() != null
309 && referredGrouping.getListOfLeafList().size() != 0) {
310 addListOfLeafListOfGrouping(
311 cloneListOfLeafList(referredGrouping.getListOfLeafList(),
312 usesParentLeavesHolder));
313 }
314
315 YangNode childInGrouping = referredGrouping.getChild();
316
317 while (childInGrouping != null) {
318 if ((childInGrouping instanceof YangEnumeration)
319 || (childInGrouping instanceof YangUnion)
320 || (childInGrouping instanceof YangTypeDef)) {
321
322 /*
323 * No need to copy the leaves, union / enum class,
324 * as these will be generated in the scope of grouping
325 */
326 childInGrouping = childInGrouping.getNextSibling();
327 continue;
328 } else if ((childInGrouping instanceof YangUses)) {
329 addResolvedUsesInfoOfGrouping((YangUses) childInGrouping,
330 usesParentLeavesHolder);
331 } else {
332 addNodeOfGrouping(childInGrouping);
333 }
334
335 childInGrouping = childInGrouping.getNextSibling();
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530336 }
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530337 }
338
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530339 /**
340 * Clone the resolved uses contained in grouping to the uses of grouping.
341 *
342 * @param usesInGrouping resolved uses in grouping
343 * @param usesHolder holder of uses
344 */
345 private void addResolvedUsesInfoOfGrouping(YangUses usesInGrouping,
346 YangLeavesHolder usesHolder) {
347 for (YangNode usesResolvedNode :
348 usesInGrouping.getUsesResolvedNodeList()) {
349 addNodeOfGrouping(usesResolvedNode);
350 }
351
352 for (List<YangLeaf> leavesList :
353 usesInGrouping.getUsesResolvedLeavesList()) {
354 addLeavesOfGrouping(cloneLeavesList(leavesList, usesHolder));
355 }
356
357 for (List<YangLeafList> listOfLeafLists :
358 usesInGrouping.getUsesResolvedListOfLeafList()) {
359 addListOfLeafListOfGrouping(
360 cloneListOfLeafList(listOfLeafLists, usesHolder));
361 }
362 }
363
364 /**
365 * Clone the list of leaves and return the cloned list leaves.
366 *
367 * @param listOfLeaves list of leaves to be cloned
368 * @param usesParentNode parent of the cloned location
369 * @return cloned list of leaves
370 */
371 private List<YangLeaf> cloneLeavesList(List<YangLeaf> listOfLeaves,
372 YangLeavesHolder usesParentNode) {
373 if ((listOfLeaves == null) || listOfLeaves.size() == 0) {
374 throw new LinkerException("No leaves to clone");
375 }
376
377 List<YangLeaf> newLeavesList = new LinkedList<YangLeaf>();
378 for (YangLeaf leaf : listOfLeaves) {
379 YangLeaf clonedLeaf;
380 try {
381 ((CollisionDetector) usesParentNode).detectCollidingChild(leaf.getName(),
382 YangConstructType.LEAF_DATA);
383 clonedLeaf = leaf.clone();
384 } catch (CloneNotSupportedException | DataModelException e) {
385 throw new LinkerException(e.getMessage());
386 }
387
388 clonedLeaf.setContainedIn(usesParentNode);
389 newLeavesList.add(clonedLeaf);
390 }
391
392 return newLeavesList;
393 }
394
395 /**
396 * Clone the list of leaf list.
397 *
398 * @param listOfLeafList list of leaf list that needs to be cloned
399 * @param usesParentNode parent of uses
400 * @return cloned list of leaf list
401 */
402 private List<YangLeafList> cloneListOfLeafList(List<YangLeafList> listOfLeafList,
403 YangLeavesHolder usesParentNode) {
404 if ((listOfLeafList == null) || listOfLeafList.size() == 0) {
405 throw new LinkerException("No leaf lists to clone");
406 }
407
408 List<YangLeafList> newListOfLeafList = new LinkedList<YangLeafList>();
409 for (YangLeafList leafList : listOfLeafList) {
410 YangLeafList clonedLeafList;
411 try {
412 ((CollisionDetector) usesParentNode).detectCollidingChild(leafList.getName(),
413 YangConstructType.LEAF_LIST_DATA);
414 clonedLeafList = leafList.clone();
415 } catch (CloneNotSupportedException | DataModelException e) {
416 throw new LinkerException(e.getMessage());
417 }
418
419 clonedLeafList.setContainedIn(usesParentNode);
420 newListOfLeafList.add(clonedLeafList);
421 }
422
423 return newListOfLeafList;
424 }
425
426
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530427 @Override
428 public ResolvableStatus getResolvableStatus() {
429 return resolvableStatus;
430 }
431
432 @Override
433 public void setResolvableStatus(ResolvableStatus resolvableStatus) {
434 this.resolvableStatus = resolvableStatus;
435 }
janani b4e53f9b2016-04-26 18:49:20 +0530436
437 @Override
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530438 public void detectCollidingChild(String identifierName, YangConstructType dataType)
439 throws DataModelException {
janani b4e53f9b2016-04-26 18:49:20 +0530440 detectCollidingChildUtil(identifierName, dataType, this);
441 }
442
443 @Override
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530444 public void detectSelfCollision(String identifierName, YangConstructType dataType)
445 throws DataModelException {
janani b4e53f9b2016-04-26 18:49:20 +0530446
447 if (getName().equals(identifierName)) {
448 throw new DataModelException("YANG file error: Duplicate input identifier detected, same as uses \""
449 + getName() + "\"");
450 }
451 }
452
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530453
454 /**
455 * Adds the node under grouping to the effective uses resolved info.
456 *
457 * @param nodeInGrouping node defined under grouping which needs to be copied in
458 * the context of uses
459 */
460 public void addNodeOfGrouping(YangNode nodeInGrouping) {
461 resolvedGroupingNodes.add(nodeInGrouping);
462 }
463
464 /**
465 * Returns the effective list of nodes added due to uses linking.
466 *
467 * @return effective list of nodes added due to uses linking
468 */
469 public List<YangNode> getUsesResolvedNodeList() {
470 return resolvedGroupingNodes;
471 }
472
473 /**
474 * Adds the leaves under grouping to the effective uses resolved info.
475 *
476 * @param leavesInGrouping Leaves defined under grouping which needs to be copied in
477 * the context of uses
478 */
479 public void addLeavesOfGrouping(List<YangLeaf> leavesInGrouping) {
480 resolvedGroupingLeaves.add(leavesInGrouping);
481 }
482
483 /**
484 * Returns the effective list of Leaves added due to uses linking.
485 *
486 * @return effective list of Leaves added due to uses linking
487 */
488 public List<List<YangLeaf>> getUsesResolvedLeavesList() {
489 return resolvedGroupingLeaves;
490 }
491
492 /**
493 * Adds the leaf-lists under grouping to the effective uses resolved info.
494 *
495 * @param leafListsInGrouping leaf-lists defined under grouping which needs to be copied in
496 * the context of uses
497 */
498 public void addListOfLeafListOfGrouping(List<YangLeafList> leafListsInGrouping) {
499 resolvedGroupingLeafLists.add(leafListsInGrouping);
500 }
501
502 /**
503 * Returns the effective list of Leaves added due to uses linking.
504 *
505 * @return effective list of Leaves added due to uses linking
506 */
507 public List<List<YangLeafList>> getUsesResolvedListOfLeafList() {
508 return resolvedGroupingLeafLists;
509 }
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530510}