blob: d2ee87626b40716a54519ef8a3650666744d1afa [file] [log] [blame]
Vinod Kumar S67e7be62016-02-11 20:13:28 +05301/*
2 * Copyright 2016 Open Networking Laboratory
3 *
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.LinkedList;
20import java.util.List;
21
22import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
23import org.onosproject.yangutils.parser.Parsable;
24import org.onosproject.yangutils.parser.ParsableDataType;
Bharat saraswal594bc6d2016-02-22 22:15:21 +053025import org.onosproject.yangutils.translator.CachedFileHandle;
Vinod Kumar S67e7be62016-02-11 20:13:28 +053026
27/*-
28 * The "list" statement is used to define an interior data node in the
29 * schema tree. A list node may exist in multiple instances in the data
30 * tree. Each such instance is known as a list entry. The "list"
31 * statement takes one argument, which is an identifier, followed by a
32 * block of sub-statements that holds detailed list information.
33 *
34 * A list entry is uniquely identified by the values of the list's keys,
35 * if defined.
36 *
37 * The list's sub-statements
38 *
39 * +--------------+---------+-------------+------------------+
40 * | substatement | section | cardinality |data model mapping|
41 * +--------------+---------+-------------+------------------+
42 * | anyxml | 7.10 | 0..n |-not supported |
43 * | choice | 7.9 | 0..n |-child nodes |
44 * | config | 7.19.1 | 0..1 |-boolean |
45 * | container | 7.5 | 0..n |-child nodes |
46 * | description | 7.19.3 | 0..1 |-string |
47 * | grouping | 7.11 | 0..n |-child nodes |
48 * | if-feature | 7.18.2 | 0..n |-TODO |
49 * | key | 7.8.2 | 0..1 |-String list |
50 * | leaf | 7.6 | 0..n |-YangLeaf |
51 * | leaf-list | 7.7 | 0..n |-YangLeafList |
52 * | list | 7.8 | 0..n |-child nodes |
53 * | max-elements | 7.7.4 | 0..1 |-int |
54 * | min-elements | 7.7.3 | 0..1 |-int |
55 * | must | 7.5.3 | 0..n |-TODO |
56 * | ordered-by | 7.7.5 | 0..1 |-TODO |
57 * | reference | 7.19.4 | 0..1 |-string |
58 * | status | 7.19.2 | 0..1 |-YangStatus |
59 * | typedef | 7.3 | 0..n |-child nodes |
60 * | unique | 7.8.3 | 0..n |-TODO |
61 * | uses | 7.12 | 0..n |-child nodes(TODO)|
62 * | when | 7.19.5 | 0..1 |-TODO |
63 * +--------------+---------+-------------+------------------+
64 */
65
66/**
67 * List data represented in YANG.
68 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +053069public class YangList extends YangNode
70 implements YangLeavesHolder, YangCommonInfo, Parsable {
Vinod Kumar S67e7be62016-02-11 20:13:28 +053071
72 /**
73 * name of the YANG list.
74 */
75 private String name;
76
77 /**
78 * If list maintains config data.
79 */
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +053080 private Boolean isConfig;
Vinod Kumar S67e7be62016-02-11 20:13:28 +053081
82 /**
83 * Description of list.
84 */
85 private String description;
86
87 /**
88 * Reference RFC 6020.
89 *
90 * The "key" statement, which MUST be present if the list represents
91 * configuration, and MAY be present otherwise, takes as an argument a
92 * string that specifies a space-separated list of leaf identifiers of this
93 * list. A leaf identifier MUST NOT appear more than once in the key. Each
94 * such leaf identifier MUST refer to a child leaf of the list. The leafs
95 * can be defined directly in sub-statements to the list, or in groupings
96 * used in the list.
97 *
98 * The combined values of all the leafs specified in the key are used to
99 * uniquely identify a list entry. All key leafs MUST be given values when a
100 * list entry is created. Thus, any default values in the key leafs or their
101 * types are ignored. It also implies that any mandatory statement in the
102 * key leafs are ignored.
103 *
104 * A leaf that is part of the key can be of any built-in or derived type,
105 * except it MUST NOT be the built-in type "empty".
106 *
107 * All key leafs in a list MUST have the same value for their "config" as
108 * the list itself.
109 *
110 * List of key leaf names.
111 */
112 private List<String> keyList;
113
114 /**
115 * List of leaves.
116 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530117 private List<YangLeaf> listOfLeaf;
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530118
119 /**
120 * List of leaf-lists.
121 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530122 private List<YangLeafList> listOfLeafList;
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530123
124 /**
125 * The "max-elements" statement, which is optional, takes as an argument a
126 * positive integer or the string "unbounded", which puts a constraint on
127 * valid list entries. A valid leaf-list or list always has at most
128 * max-elements entries.
129 *
130 * If no "max-elements" statement is present, it defaults to "unbounded".
131 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530132 private int maxElelements = Integer.MAX_VALUE;
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530133
134 /**
135 * The "min-elements" statement, which is optional, takes as an argument a
136 * non-negative integer that puts a constraint on valid list entries. A
137 * valid leaf-list or list MUST have at least min-elements entries.
138 *
139 * If no "min-elements" statement is present, it defaults to zero.
140 *
141 * The behavior of the constraint depends on the type of the leaf-list's or
142 * list's closest ancestor node in the schema tree that is not a non-
143 * presence container:
144 *
145 * o If this ancestor is a case node, the constraint is enforced if any
146 * other node from the case exists.
147 *
148 * o Otherwise, it is enforced if the ancestor node exists.
149 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530150 private int minElements = 0;
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530151
152 /**
153 * reference.
154 */
155 private String reference;
156
157 /**
158 * Status of the node.
159 */
160
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530161 private YangStatusType status = YangStatusType.CURRENT;
162
163 /**
164 * package of the generated java code.
165 */
166 private String pkg;
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530167
168 /**
169 * Constructor.
170 *
171 * @param type list node
172 */
173 public YangList(YangNodeType type) {
174 super(type);
175 }
176
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530177 /**
178 * Get the YANG list name.
179 *
180 * @return YANG list name.
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530181 */
182 @Override
183 public String getName() {
184 return name;
185 }
186
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530187 /**
188 * Set the YANG list name.
189 *
190 * @param name YANG list name.
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530191 */
192 @Override
193 public void setName(String name) {
194 this.name = name;
195 }
196
197 /**
198 * Get the config flag.
199 *
200 * @return the isConfig
201 */
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530202 public Boolean isConfig() {
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530203 return isConfig;
204 }
205
206 /**
207 * Set the config flag.
208 *
209 * @param isCfg the config flag.
210 */
211 public void setConfig(boolean isCfg) {
212 isConfig = isCfg;
213 }
214
215 /**
216 * Get the description.
217 *
218 * @return the description.
219 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530220 @Override
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530221 public String getDescription() {
222 return description;
223 }
224
225 /**
226 * Set the description.
227 *
228 * @param description set the description.
229 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530230 @Override
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530231 public void setDescription(String description) {
232 this.description = description;
233 }
234
235 /**
236 * Get the list of key field names.
237 *
238 * @return the list of key field names.
239 */
240 public List<String> getKeyList() {
241 return keyList;
242 }
243
244 /**
245 * Set the list of key field names.
246 *
247 * @param keyList the list of key field names.
248 */
249 private void setKeyList(List<String> keyList) {
250 this.keyList = keyList;
251 }
252
253 /**
254 * Add a key field name.
255 *
256 * @param key key field name.
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530257 * @throws DataModelException a violation of data model rules.
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530258 */
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530259 public void addKey(String key) throws DataModelException {
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530260 if (getKeyList() == null) {
261 setKeyList(new LinkedList<String>());
262 }
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530263
264 if (getKeyList().contains(key)) {
265 throw new DataModelException("A leaf identifier must not appear more than once in the\n" +
266 " key");
267 }
268
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530269 getKeyList().add(key);
270 }
271
272 /**
273 * Get the list of leaves.
274 *
275 * @return the list of leaves.
276 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530277 @Override
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530278 public List<YangLeaf> getListOfLeaf() {
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530279 return listOfLeaf;
280 }
281
282 /**
283 * Set the list of leaves.
284 *
285 * @param leafsList the list of leaf to set.
286 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530287 private void setListOfLeaf(List<YangLeaf> leafsList) {
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530288 listOfLeaf = leafsList;
289 }
290
291 /**
292 * Add a leaf.
293 *
294 * @param leaf the leaf to be added.
295 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530296 @Override
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530297 public void addLeaf(YangLeaf leaf) {
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530298 if (getListOfLeaf() == null) {
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530299 setListOfLeaf(new LinkedList<YangLeaf>());
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530300 }
301
302 getListOfLeaf().add(leaf);
303 }
304
305 /**
306 * Get the list of leaf-list.
307 *
308 * @return the list of leaf-list.
309 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530310 @Override
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530311 public List<YangLeafList> getListOfLeafList() {
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530312 return listOfLeafList;
313 }
314
315 /**
316 * Set the list of leaf-list.
317 *
318 * @param listOfLeafList the list of leaf-list to set.
319 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530320 private void setListOfLeafList(List<YangLeafList> listOfLeafList) {
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530321 this.listOfLeafList = listOfLeafList;
322 }
323
324 /**
325 * Add a leaf-list.
326 *
327 * @param leafList the leaf-list to be added.
328 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530329 @Override
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530330 public void addLeafList(YangLeafList leafList) {
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530331 if (getListOfLeafList() == null) {
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530332 setListOfLeafList(new LinkedList<YangLeafList>());
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530333 }
334
335 getListOfLeafList().add(leafList);
336 }
337
338 /**
339 * Get the max elements.
340 *
341 * @return the max elements.
342 */
343 public int getMaxElelements() {
344 return maxElelements;
345 }
346
347 /**
348 * Set the max elements.
349 *
350 * @param maxElelements the max elements.
351 */
352 public void setMaxElelements(int maxElelements) {
353 this.maxElelements = maxElelements;
354 }
355
356 /**
357 * Get the minimum elements.
358 *
359 * @return the minimum elements.
360 */
361 public int getMinElements() {
362 return minElements;
363 }
364
365 /**
366 * Set the minimum elements.
367 *
368 * @param minElements the minimum elements.
369 */
370 public void setMinElements(int minElements) {
371 this.minElements = minElements;
372 }
373
374 /**
375 * Get the textual reference.
376 *
377 * @return the reference.
378 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530379 @Override
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530380 public String getReference() {
381 return reference;
382 }
383
384 /**
385 * Set the textual reference.
386 *
387 * @param reference the reference to set.
388 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530389 @Override
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530390 public void setReference(String reference) {
391 this.reference = reference;
392 }
393
394 /**
395 * Get the status.
396 *
397 * @return the status.
398 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530399 @Override
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530400 public YangStatusType getStatus() {
401 return status;
402 }
403
404 /**
405 * Set the status.
406 *
407 * @param status the status to set.
408 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530409 @Override
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530410 public void setStatus(YangStatusType status) {
411 this.status = status;
412 }
413
414 /**
415 * Returns the type of the parsed data.
416 *
417 * @return returns LIST_DATA.
418 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530419 @Override
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530420 public ParsableDataType getParsableDataType() {
421 return ParsableDataType.LIST_DATA;
422 }
423
424 /**
425 * Validate the data on entering the corresponding parse tree node.
426 *
427 * @throws DataModelException a violation of data model rules.
428 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530429 @Override
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530430 public void validateDataOnEntry() throws DataModelException {
431 // TODO auto-generated method stub, to be implemented by parser
432 }
433
434 /**
435 * Validate the data on exiting the corresponding parse tree node.
436 *
437 * @throws DataModelException a violation of data model rules.
438 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530439 @Override
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530440 public void validateDataOnExit() throws DataModelException {
Vinod Kumar S71cba682016-02-25 15:52:16 +0530441 List<String> keys = getKeyList();
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530442 List<YangLeaf> leaves = getListOfLeaf();
443 List<YangLeafList> leafLists = getListOfLeafList();
444
445 setDefaultConfigValueToChild(leaves, leafLists);
446 validateConfig(leaves, leafLists);
447
448 /* A list must have atleast one key leaf if config is true */
449 if ((isConfig)
Vinod Kumar S71cba682016-02-25 15:52:16 +0530450 && ((keys == null) || ((leaves == null) && (leafLists == null)))) {
451 throw new DataModelException("A list must have atleast one key leaf if config is true;");
452 } else if (keys != null) {
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530453 if (leaves != null) {
Vinod Kumar S71cba682016-02-25 15:52:16 +0530454 validateLeafKey(leaves, keys);
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530455 }
456
457 if (leafLists != null) {
Vinod Kumar S71cba682016-02-25 15:52:16 +0530458 validateLeafListKey(leafLists, keys);
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530459 }
460 }
461 }
462
463 /**
Vinod Kumar S71cba682016-02-25 15:52:16 +0530464 * Sets the config's value to all leaf if leaf's config statement is not
465 * specified.
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530466 *
467 * @param leaves list of leaf attributes of YANG list.
468 * @param leafLists list of leaf-list attributes of YANG list.
469 */
470 private void setDefaultConfigValueToChild(List<YangLeaf> leaves, List<YangLeafList> leafLists) {
471
Vinod Kumar S71cba682016-02-25 15:52:16 +0530472 /*
473 * If "config" is not specified, the default is the same as the parent
474 * schema node's "config" value.
475 */
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530476 if (leaves != null) {
477 for (YangLeaf leaf : leaves) {
478 if (leaf.isConfig() == null) {
479 leaf.setConfig(isConfig);
480 }
481 }
482 }
483
Vinod Kumar S71cba682016-02-25 15:52:16 +0530484 /*
485 * If "config" is not specified, the default is the same as the parent
486 * schema node's "config" value.
487 */
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530488 if (leafLists != null) {
489 for (YangLeafList leafList : leafLists) {
490 if (leafList.isConfig() == null) {
491 leafList.setConfig(isConfig);
492 }
493 }
494 }
495 }
496
497 /**
498 * Validates config statement of YANG list.
499 *
500 * @param leaves list of leaf attributes of YANG list.
501 * @param leafLists list of leaf-list attributes of YANG list.
502 * @throws DataModelException a violation of data model rules.
503 */
504 private void validateConfig(List<YangLeaf> leaves, List<YangLeafList> leafLists) throws DataModelException {
505
Vinod Kumar S71cba682016-02-25 15:52:16 +0530506 /*
507 * If a node has "config" set to "false", no node underneath it can have
508 * "config" set to "true".
509 */
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530510 if ((!isConfig) && (leaves != null)) {
511 for (YangLeaf leaf : leaves) {
512 if (leaf.isConfig()) {
513 throw new DataModelException("If a list has \"config\" set to \"false\", no node underneath " +
514 "it can have \"config\" set to \"true\".");
515 }
516 }
517 }
518
519 if ((!isConfig) && (leafLists != null)) {
520 for (YangLeafList leafList : leafLists) {
521 if (leafList.isConfig()) {
522 throw new DataModelException("If a list has \"config\" set to \"false\", no node underneath " +
523 "it can have \"config\" set to \"true\".");
524 }
525 }
526 }
527 }
528
529 /**
530 * Validates key statement of list.
531 *
532 * @param leaves list of leaf attributes of list.
Vinod Kumar S71cba682016-02-25 15:52:16 +0530533 * @param keys list of key attributes of list.
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530534 * @throws DataModelException a violation of data model rules.
535 */
Vinod Kumar S71cba682016-02-25 15:52:16 +0530536 private void validateLeafKey(List<YangLeaf> leaves, List<String> keys) throws DataModelException {
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530537 boolean leafFound = false;
538 List<YangLeaf> keyLeaves = new LinkedList<>();
539
Vinod Kumar S71cba682016-02-25 15:52:16 +0530540 /*
541 * 1. Leaf identifier must refer to a child leaf of the list 2. A leaf
542 * that is part of the key must not be the built-in type "empty".
543 */
544 for (String key : keys) {
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530545 for (YangLeaf leaf : leaves) {
546 if (key.equals(leaf.getLeafName())) {
Vinod Kumar S71cba682016-02-25 15:52:16 +0530547 if (leaf.getDataType().getDataType() == YangDataTypes.EMPTY) {
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530548 throw new DataModelException(" A leaf that is part of the key must not be the built-in " +
549 "type \"empty\".");
550 }
551 leafFound = true;
552 keyLeaves.add(leaf);
553 break;
554 }
555 }
556 if (!leafFound) {
557 throw new DataModelException("Leaf identifier must refer to a child leaf of the list");
558 }
559 leafFound = false;
560 }
561
Vinod Kumar S71cba682016-02-25 15:52:16 +0530562 /*
563 * All key leafs in a list MUST have the same value for their "config"
564 * as the list itself.
565 */
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530566 for (YangLeaf keyLeaf : keyLeaves) {
567 if (isConfig != keyLeaf.isConfig()) {
568 throw new DataModelException("All key leafs in a list must have the same value for their" +
569 " \"config\" as the list itself.");
570 }
571 }
572 }
573
574 /**
575 * Validates key statement of list.
576 *
577 * @param leafLists list of leaf-list attributes of list.
Vinod Kumar S71cba682016-02-25 15:52:16 +0530578 * @param keys list of key attributes of list.
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530579 * @throws DataModelException a violation of data model rules.
580 */
Vinod Kumar S71cba682016-02-25 15:52:16 +0530581 private void validateLeafListKey(List<YangLeafList> leafLists, List<String> keys) throws DataModelException {
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530582 boolean leafFound = false;
583 List<YangLeafList> keyLeafLists = new LinkedList<>();
584
Vinod Kumar S71cba682016-02-25 15:52:16 +0530585 /*
586 * 1. Leaf identifier must refer to a child leaf of the list 2. A leaf
587 * that is part of the key must not be the built-in type "empty".
588 */
589 for (String key : keys) {
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530590 for (YangLeafList leafList : leafLists) {
591 if (key.equals(leafList.getLeafName())) {
Vinod Kumar S71cba682016-02-25 15:52:16 +0530592 if (leafList.getDataType().getDataType() == YangDataTypes.EMPTY) {
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530593 throw new DataModelException(" A leaf-list that is part of the key must not be the built-in " +
594 "type \"empty\".");
595 }
596 leafFound = true;
597 keyLeafLists.add(leafList);
598 break;
599 }
600 }
601 if (!leafFound) {
602 throw new DataModelException("Leaf-list identifier must refer to a child leaf of the list");
603 }
604 leafFound = false;
605 }
606
Vinod Kumar S71cba682016-02-25 15:52:16 +0530607 /*
608 * All key leafs in a list MUST have the same value for their "config"
609 * as the list itself.
610 */
Vidyashree Ramaf4c617c2016-02-24 12:28:22 +0530611 for (YangLeafList keyLeafList : keyLeafLists) {
612 if (isConfig() != keyLeafList.isConfig()) {
613 throw new DataModelException("All key leaf-lists in a list must have the same value for their" +
614 " \"config\" as the list itself.");
615 }
616 }
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530617 }
618
Vinod Kumar S71cba682016-02-25 15:52:16 +0530619 /**
620 * Populate the cached handle with information about the list attributes to
621 * generate java code.
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530622 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530623 @Override
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530624 public void generateJavaCodeEntry() {
625 // TODO Auto-generated method stub
626
627 }
628
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530629 /**
630 * Free the resources used to generate the java file corresponding to YANG
631 * list info.
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530632 */
Bharat saraswal870c56f2016-02-20 21:57:16 +0530633 @Override
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530634 public void generateJavaCodeExit() {
635 // TODO Auto-generated method stub
636
637 }
638
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530639 /**
640 * Get the mapped java package.
641 *
642 * @return the java package
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530643 */
644 @Override
645 public String getPackage() {
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530646 return pkg;
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530647 }
648
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530649 /**
650 * Set the mapped java package.
651 *
652 * @param pakg the package to set
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530653 */
654 @Override
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530655 public void setPackage(String pakg) {
656 pkg = pakg;
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530657
658 }
Bharat saraswal594bc6d2016-02-22 22:15:21 +0530659
660 @Override
661 public CachedFileHandle getFileHandle() {
662 // TODO Auto-generated method stub
663 return null;
664 }
665
666 @Override
667 public void setFileHandle(CachedFileHandle fileHandle) {
668 // TODO Auto-generated method stub
669
670 }
Vinod Kumar S67e7be62016-02-11 20:13:28 +0530671}