blob: 6d475cbe9322fa6aa55a1c98de7640eeaf23c505 [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
Bharat saraswalb551aae2016-07-14 15:18:20 +053018import java.util.HashMap;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053019import java.util.LinkedList;
20import java.util.List;
Bharat saraswalb551aae2016-07-14 15:18:20 +053021import java.util.Map;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053022
23import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
Bharat saraswal96dfef02016-06-16 00:29:12 +053024import org.onosproject.yangutils.datamodel.utils.Parsable;
Bharat saraswalb1170bd2016-07-14 13:26:18 +053025import org.onosproject.yangutils.datamodel.utils.ResolvableStatus;
Bharat saraswal96dfef02016-06-16 00:29:12 +053026import org.onosproject.yangutils.datamodel.utils.YangConstructType;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053027
Vidyashree Rama25bf4d02016-03-29 14:37:02 +053028import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
29
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053030/*-
31 * Reference RFC 6020.
32 *
33 * The "augment" statement allows a module or submodule to add to the
34 * schema tree defined in an external module, or the current module and
35 * its submodules, and to add to the nodes from a grouping in a "uses"
36 * statement. The argument is a string that identifies a node in the
37 * schema tree. This node is called the augment's target node. The
38 * target node MUST be either a container, list, choice, case, input,
39 * output, or notification node. It is augmented with the nodes defined
40 * in the sub-statements that follow the "augment" statement.
41 *
42 * The argument string is a schema node identifier.
43 * If the "augment" statement is on the top level in a module or
44 * submodule, the absolute form of a schema node identifier
45 * MUST be used. If the "augment" statement is a sub-statement to the
46 * "uses" statement, the descendant form MUST be used.
47 *
48 * If the target node is a container, list, case, input, output, or
49 * notification node, the "container", "leaf", "list", "leaf-list",
50 * "uses", and "choice" statements can be used within the "augment"
51 * statement.
52 *
53 * If the target node is a choice node, the "case" statement, or a case
54 * shorthand statement can be used within the "augment" statement.
55 *
56 * If the target node is in another module, then nodes added by the
57 * augmentation MUST NOT be mandatory nodes.
58 *
59 * The "augment" statement MUST NOT add multiple nodes with the same
60 * name from the same module to the target node.
61 * The augment's sub-statements
62 *
63 * +--------------+---------+-------------+------------------+
64 * | substatement | section | cardinality |data model mapping|
65 * +--------------+---------+-------------+------------------+
66 * | anyxml | 7.10 | 0..n |-not supported |
67 * | case | 7.9.2 | 0..n |-child nodes |
68 * | choice | 7.9 | 0..n |-child nodes |
69 * | container | 7.5 | 0..n |-child nodes |
70 * | description | 7.19.3 | 0..1 |-string |
Vidyashree Ramadeac28b2016-06-20 15:12:43 +053071 * | if-feature | 7.18.2 | 0..n |-YangIfFeature |
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053072 * | leaf | 7.6 | 0..n |-YangLeaf |
73 * | leaf-list | 7.7 | 0..n |-YangLeafList |
74 * | list | 7.8 | 0..n |-child nodes |
75 * | reference | 7.19.4 | 0..1 |-String |
76 * | status | 7.19.2 | 0..1 |-YangStatus |
77 * | uses | 7.12 | 0..n |-child nodes |
Vidyashree Ramadeac28b2016-06-20 15:12:43 +053078 * | when | 7.19.5 | 0..1 |-YangWhen |
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053079 * +--------------+---------+-------------+------------------+
80 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053081
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053082/**
Bharat saraswald9822e92016-04-05 15:13:44 +053083 * Representation of data model node to maintain information defined in YANG augment.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053084 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +053085public class YangAugment
86 extends YangNode
Bharat saraswalb1170bd2016-07-14 13:26:18 +053087 implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentedInfo, Resolvable,
Bharat saraswalb551aae2016-07-14 15:18:20 +053088 YangXPathResolver, YangWhenHolder, YangIfFeatureHolder {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053089
Bharat saraswal96dfef02016-06-16 00:29:12 +053090 private static final long serialVersionUID = 806201602L;
91
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053092 /**
93 * Augment target node.
94 */
Vidyashree Rama25bf4d02016-03-29 14:37:02 +053095 private String name;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053096
97 /**
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053098 * Description of augment.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +053099 */
100 private String description;
101
102 /**
103 * List of leaves.
104 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530105 private List<YangLeaf> listOfLeaf;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530106
107 /**
108 * List of leaf-lists.
109 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530110 private List<YangLeafList> listOfLeafList;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530111
112 /**
Vidyashree Rama25bf4d02016-03-29 14:37:02 +0530113 * List of node identifiers.
114 */
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530115 private List<YangAtomicPath> targetNode;
Vidyashree Rama25bf4d02016-03-29 14:37:02 +0530116
117 /**
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530118 * Reference of the YANG augment.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530119 */
120 private String reference;
121
122 /**
123 * Status of the node.
124 */
125 private YangStatusType status;
126
127 /**
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530128 * Resolved augmented node.
129 */
130 private YangNode augmentedNode;
131
132 /**
Bharat saraswalb551aae2016-07-14 15:18:20 +0530133 * All resolved nodes in given xPath.
134 */
135 private Map<YangAtomicPath, YangNode> resolveNodeInPath;
136
137 /**
138 * Status of resolution. If completely resolved enum value is "RESOLVED", if not enum value is "UNRESOLVED", in case
139 * reference of grouping/typedef is added to uses/type but it's not resolved value of enum should be
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530140 * "INTRA_FILE_RESOLVED".
141 */
142 private ResolvableStatus resolvableStatus;
143
144 /**
Vidyashree Ramadeac28b2016-06-20 15:12:43 +0530145 * When data of the node.
146 */
147 private YangWhen when;
148
149 /**
150 * List of if-feature.
151 */
152 private List<YangIfFeature> ifFeatureList;
153
154 /**
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530155 * Create a YANG augment node.
156 */
157 public YangAugment() {
158 super(YangNodeType.AUGMENT_NODE);
Bharat saraswalb551aae2016-07-14 15:18:20 +0530159 resolveNodeInPath = new HashMap<>();
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530160 resolvableStatus = ResolvableStatus.UNRESOLVED;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530161 }
162
163 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530164 * Returns the augmented node.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530165 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530166 * @return the augmented node
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530167 */
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530168 public List<YangAtomicPath> getTargetNode() {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530169 return targetNode;
170 }
171
172 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530173 * Sets the augmented node.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530174 *
Vidyashree Rama25bf4d02016-03-29 14:37:02 +0530175 * @param nodeIdentifiers the augmented node
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530176 */
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530177 public void setTargetNode(List<YangAtomicPath> nodeIdentifiers) {
Bharat saraswal96dfef02016-06-16 00:29:12 +0530178 targetNode = nodeIdentifiers;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530179 }
180
181 /**
Vidyashree Ramadeac28b2016-06-20 15:12:43 +0530182 * Returns the when.
183 *
184 * @return the when
185 */
186 @Override
187 public YangWhen getWhen() {
188 return when;
189 }
190
191 /**
192 * Sets the when.
193 *
194 * @param when the when to set
195 */
196 @Override
197 public void setWhen(YangWhen when) {
198 this.when = when;
199 }
200
201 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530202 * Returns the description.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530203 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530204 * @return the description
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530205 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530206 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530207 public String getDescription() {
208 return description;
209 }
210
211 /**
212 * Set the description.
213 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530214 * @param description set the description
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530215 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530216 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530217 public void setDescription(String description) {
218 this.description = description;
219 }
220
Vidyashree Rama25bf4d02016-03-29 14:37:02 +0530221 @Override
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530222 public void detectCollidingChild(String identifierName, YangConstructType dataType)
223 throws DataModelException {
Vidyashree Rama25bf4d02016-03-29 14:37:02 +0530224 // Detect colliding child.
225 detectCollidingChildUtil(identifierName, dataType, this);
226 }
227
228 @Override
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530229 public void detectSelfCollision(String identifierName, YangConstructType dataType)
230 throws DataModelException {
Bharat saraswal96dfef02016-06-16 00:29:12 +0530231 if (getName().equals(identifierName)) {
Vidyashree Rama25bf4d02016-03-29 14:37:02 +0530232 throw new DataModelException("YANG file error: Duplicate input identifier detected, same as input \""
Bharat saraswal96dfef02016-06-16 00:29:12 +0530233 + getName() + "\"");
Vidyashree Rama25bf4d02016-03-29 14:37:02 +0530234 }
235 }
236
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530237 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530238 * Returns the list of leaves.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530239 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530240 * @return the list of leaves
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530241 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530242 @Override
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530243 public List<YangLeaf> getListOfLeaf() {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530244 return listOfLeaf;
245 }
246
247 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530248 * Sets the list of leaves.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530249 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530250 * @param leafsList the list of leaf to set
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530251 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530252 @Override
253 public void setListOfLeaf(List<YangLeaf> leafsList) {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530254 listOfLeaf = leafsList;
255 }
256
257 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530258 * Adds a leaf.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530259 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530260 * @param leaf the leaf to be added
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530261 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530262 @Override
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530263 public void addLeaf(YangLeaf leaf) {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530264 if (getListOfLeaf() == null) {
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530265 setListOfLeaf(new LinkedList<YangLeaf>());
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530266 }
267
268 getListOfLeaf().add(leaf);
269 }
270
271 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530272 * Returns the list of leaf-list.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530273 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530274 * @return the list of leaf-list
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530275 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530276 @Override
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530277 public List<YangLeafList> getListOfLeafList() {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530278 return listOfLeafList;
279 }
280
281 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530282 * Sets the list of leaf-list.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530283 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530284 * @param listOfLeafList the list of leaf-list to set
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530285 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530286 @Override
287 public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530288 this.listOfLeafList = listOfLeafList;
289 }
290
291 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530292 * Adds a leaf-list.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530293 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530294 * @param leafList the leaf-list to be added
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530295 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530296 @Override
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530297 public void addLeafList(YangLeafList leafList) {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530298 if (getListOfLeafList() == null) {
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530299 setListOfLeafList(new LinkedList<YangLeafList>());
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530300 }
301
302 getListOfLeafList().add(leafList);
303 }
304
305 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530306 * Returns the textual reference.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530307 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530308 * @return the reference
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530309 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530310 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530311 public String getReference() {
312 return reference;
313 }
314
315 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530316 * Sets the textual reference.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530317 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530318 * @param reference the reference to set
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530319 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530320 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530321 public void setReference(String reference) {
322 this.reference = reference;
323 }
324
325 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530326 * Returns the status.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530327 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530328 * @return the status
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530329 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530330 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530331 public YangStatusType getStatus() {
332 return status;
333 }
334
335 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530336 * Sets the status.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530337 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530338 * @param status the status to set
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530339 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530340 @Override
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530341 public void setStatus(YangStatusType status) {
342 this.status = status;
343 }
344
345 /**
346 * Returns the type of the data as belongs-to.
347 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530348 * @return returns AUGMENT_DATA
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530349 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530350 @Override
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530351 public YangConstructType getYangConstructType() {
352 return YangConstructType.AUGMENT_DATA;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530353 }
354
355 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530356 * Validates the data on entering the corresponding parse tree node.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530357 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530358 * @throws DataModelException a violation of data model rules
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530359 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530360 @Override
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530361 public void validateDataOnEntry()
362 throws DataModelException {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530363 // TODO auto-generated method stub, to be implemented by parser
364 }
365
366 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530367 * Validates the data on exiting the corresponding parse tree node.
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530368 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530369 * @throws DataModelException a violation of data model rules
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530370 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530371 @Override
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530372 public void validateDataOnExit()
373 throws DataModelException {
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530374 // TODO auto-generated method stub, to be implemented by parser
375 }
376
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530377 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530378 * Returns the target nodes name where the augmentation is being done.
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530379 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530380 * @return target nodes name where the augmentation is being done
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530381 */
382 @Override
383 public String getName() {
Vidyashree Rama25bf4d02016-03-29 14:37:02 +0530384 return name;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530385 }
386
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530387 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530388 * Sets the target nodes name where the augmentation is being done.
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530389 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530390 * @param name target nodes name where the augmentation is being done
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530391 */
392 @Override
393 public void setName(String name) {
Vidyashree Rama25bf4d02016-03-29 14:37:02 +0530394 this.name = name;
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530395 }
396
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530397 /**
398 * Returns augmented node.
399 *
400 * @return augmented node
401 */
402 public YangNode getAugmentedNode() {
403 return augmentedNode;
404 }
405
406 /**
407 * Sets augmented node.
408 *
409 * @param augmentedNode augmented node
410 */
411 public void setAugmentedNode(YangNode augmentedNode) {
412 this.augmentedNode = augmentedNode;
413 }
414
Vidyashree Ramadeac28b2016-06-20 15:12:43 +0530415 @Override
416 public List<YangIfFeature> getIfFeatureList() {
417 return ifFeatureList;
418 }
419
420 @Override
Bharat saraswalb551aae2016-07-14 15:18:20 +0530421 public void setIfFeatureList(List<YangIfFeature> ifFeatureList) {
422 this.ifFeatureList = ifFeatureList;
423 }
424
425 @Override
Vidyashree Ramadeac28b2016-06-20 15:12:43 +0530426 public void addIfFeatureList(YangIfFeature ifFeature) {
427 if (getIfFeatureList() == null) {
428 setIfFeatureList(new LinkedList<>());
429 }
430 getIfFeatureList().add(ifFeature);
431 }
432
433 @Override
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530434 public ResolvableStatus getResolvableStatus() {
435 return resolvableStatus;
436 }
437
438 @Override
439 public void setResolvableStatus(ResolvableStatus resolvableStatus) {
440 this.resolvableStatus = resolvableStatus;
441
442 }
443
444 @Override
445 public void resolve() throws DataModelException {
446 // Resolving of target node is being done in XPathLinker.
447 }
Bharat saraswalb551aae2016-07-14 15:18:20 +0530448
449 /**
450 * Returns all resolved node in path.
451 *
452 * @return all resolved node in path
453 */
454 public Map<YangAtomicPath, YangNode> getResolveNodeInPath() {
455 return resolveNodeInPath;
456 }
457
458 /**
459 * Sets all resolved node in path.
460 *
461 * @param resolveNodeInPath all resolved node in path
462 */
463 public void setResolveNodeInPath(Map<YangAtomicPath, YangNode> resolveNodeInPath) {
464 this.resolveNodeInPath = resolveNodeInPath;
465 }
Vinod Kumar S2ff139c2016-02-16 01:37:16 +0530466}