[ONOS-4636]YANG Grouping linking bug fix + YANG Code review comment fix
Change-Id: I68ee8dd08266a02593e217cef1a9bb010037d673
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangList.java b/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
index cd45bdc..834a0ad 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
@@ -67,7 +67,8 @@
/**
* Represents list data represented in YANG.
*/
-public class YangList extends YangNode
+public class YangList
+ extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder {
/**
@@ -254,7 +255,8 @@
* @param key key field name.
* @throws DataModelException a violation of data model rules
*/
- public void addKey(String key) throws DataModelException {
+ public void addKey(String key)
+ throws DataModelException {
if (getKeyList() == null) {
setKeyList(new LinkedList<String>());
}
@@ -282,7 +284,8 @@
*
* @param leafsList the list of leaf to set
*/
- private void setListOfLeaf(List<YangLeaf> leafsList) {
+ @Override
+ public void setListOfLeaf(List<YangLeaf> leafsList) {
listOfLeaf = leafsList;
}
@@ -315,7 +318,8 @@
*
* @param listOfLeafList the list of leaf-list to set
*/
- private void setListOfLeafList(List<YangLeafList> listOfLeafList) {
+ @Override
+ public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
this.listOfLeafList = listOfLeafList;
}
@@ -425,7 +429,8 @@
* @throws DataModelException a violation of data model rules
*/
@Override
- public void validateDataOnEntry() throws DataModelException {
+ public void validateDataOnEntry()
+ throws DataModelException {
// TODO auto-generated method stub, to be implemented by parser
}
@@ -435,7 +440,8 @@
* @throws DataModelException a violation of data model rules
*/
@Override
- public void validateDataOnExit() throws DataModelException {
+ public void validateDataOnExit()
+ throws DataModelException {
List<String> keys = getKeyList();
List<YangLeaf> leaves = getListOfLeaf();
List<YangLeafList> leafLists = getListOfLeafList();
@@ -493,7 +499,8 @@
* @param leafLists list of leaf-list attributes of YANG list
* @throws DataModelException a violation of data model rules
*/
- private void validateConfig(List<YangLeaf> leaves, List<YangLeafList> leafLists) throws DataModelException {
+ private void validateConfig(List<YangLeaf> leaves, List<YangLeafList> leafLists)
+ throws DataModelException {
/*
* If a node has "config" set to "false", no node underneath it can have
@@ -526,7 +533,8 @@
* @param keys list of key attributes of list
* @throws DataModelException a violation of data model rules
*/
- private void validateKey(List<YangLeaf> leaves, List<YangLeafList> leafLists, List<String> keys) throws
+ private void validateKey(List<YangLeaf> leaves, List<YangLeafList> leafLists, List<String> keys)
+ throws
DataModelException {
boolean leafFound = false;
List<YangLeaf> keyLeaves = new LinkedList<>();
@@ -595,13 +603,15 @@
}
@Override
- public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+ public void detectCollidingChild(String identifierName, YangConstructType dataType)
+ throws DataModelException {
// Asks helper to detect colliding child.
detectCollidingChildUtil(identifierName, dataType, this);
}
@Override
- public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+ public void detectSelfCollision(String identifierName, YangConstructType dataType)
+ throws DataModelException {
if (getName().equals(identifierName)) {
throw new DataModelException("YANG file error: Duplicate input identifier detected, same as list \"" +
getName() + "\"");