[ONOS-4839] update file priority for translator and OP param file impl defect fix
Change-Id: Ieaef43f915996ed0a34dfa17c338ab612716b2bc
diff --git a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAtomicPath.java b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAtomicPath.java
index 6df33bb..f0bb617 100644
--- a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAtomicPath.java
+++ b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAtomicPath.java
@@ -32,6 +32,11 @@
private List<YangPathPredicate> pathPredicatesList;
/**
+ * Resolved node for the absolute path.
+ */
+ private YangNode resolvedNode;
+
+ /**
* Returns the node identifier.
*
* @return the node identifier
@@ -75,4 +80,23 @@
public void addLeavesPredicate(YangPathPredicate predicatesExp) {
getPathPredicatesList().add(predicatesExp);
}
+
+
+ /**
+ * Returns resolved node.
+ *
+ * @return resolved node
+ */
+ public YangNode getResolvedNode() {
+ return resolvedNode;
+ }
+
+ /**
+ * Sets resolved node.
+ *
+ * @param resolvedNode resolved node
+ */
+ public void setResolvedNode(YangNode resolvedNode) {
+ this.resolvedNode = resolvedNode;
+ }
}
diff --git a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java
index 21c7bd3..64c13ed 100644
--- a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java
+++ b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java
@@ -15,10 +15,8 @@
*/
package org.onosproject.yangutils.datamodel;
-import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.datamodel.utils.Parsable;
@@ -130,11 +128,6 @@
private YangNode augmentedNode;
/**
- * All resolved nodes in given xPath.
- */
- private Map<YangAtomicPath, YangNode> resolveNodeInPath;
-
- /**
* Status of resolution. If completely resolved enum value is "RESOLVED", if not enum value is "UNRESOLVED", in case
* reference of grouping/typedef is added to uses/type but it's not resolved value of enum should be
* "INTRA_FILE_RESOLVED".
@@ -156,7 +149,6 @@
*/
public YangAugment() {
super(YangNodeType.AUGMENT_NODE);
- resolveNodeInPath = new HashMap<>();
resolvableStatus = ResolvableStatus.UNRESOLVED;
}
@@ -447,21 +439,4 @@
return null;
}
- /**
- * Returns all resolved node in path.
- *
- * @return all resolved node in path
- */
- public Map<YangAtomicPath, YangNode> getResolveNodeInPath() {
- return resolveNodeInPath;
- }
-
- /**
- * Sets all resolved node in path.
- *
- * @param resolveNodeInPath all resolved node in path
- */
- public void setResolveNodeInPath(Map<YangAtomicPath, YangNode> resolveNodeInPath) {
- this.resolveNodeInPath = resolveNodeInPath;
- }
}
diff --git a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAugmentedOpParamInfo.java b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAugmentedOpParamInfo.java
new file mode 100644
index 0000000..b9c1a3a
--- /dev/null
+++ b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAugmentedOpParamInfo.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yangutils.datamodel;
+
+/**
+ * Abstraction of an entity which represent operation parameter info for augmentable node.
+ */
+public interface YangAugmentedOpParamInfo extends YangAugmentedInfo {
+
+ /**
+ * Returns class object of base class.
+ *
+ * @return class object of base class
+ */
+ Class<?> getBaseClass();
+
+ /**
+ * Returns if augmented info's contents matches.
+ *
+ * @param augmentedInfo augmented info
+ * @return true or false
+ */
+ boolean isFilterContentMatch(Object augmentedInfo);
+}
diff --git a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java
index 0f6ba7a..bf85835 100644
--- a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java
+++ b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java
@@ -79,7 +79,7 @@
*/
public class YangGrouping
extends YangNode
- implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector {
+ implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangTranslatorOperatorNode {
private static final long serialVersionUID = 806201607L;
diff --git a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java
index 381a39a..0c72c61 100644
--- a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java
+++ b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java
@@ -64,6 +64,11 @@
private int priority;
/**
+ * Flag if the node is for translation.
+ */
+ private boolean isToTranslate = true;
+
+ /**
* Returns the priority of the node.
*
* @return priority of the node
@@ -268,6 +273,7 @@
/**
* Clones the current node contents and create a new node.
*
+ * @param yangUses YANG uses
* @return cloned node
* @throws CloneNotSupportedException clone is not supported by the referred
* node
@@ -297,6 +303,7 @@
*
* @param srcRootNode source node for sub tree cloning
* @param dstRootNode destination node where the sub tree needs to be cloned
+ * @param yangUses YANG uses
* @throws DataModelException data model error
*/
public static void cloneSubTree(YangNode srcRootNode, YangNode dstRootNode, YangUses yangUses)
@@ -411,6 +418,24 @@
}
/**
+ * /** Returns true if translation required.
+ *
+ * @return true if translation required
+ */
+ public boolean isToTranslate() {
+ return isToTranslate;
+ }
+
+ /**
+ * Sest true if translation required.
+ *
+ * @param toTranslate true if translation required.
+ */
+ public void setToTranslate(boolean toTranslate) {
+ isToTranslate = toTranslate;
+ }
+
+ /**
* Adds a new next sibling.
*
* @param newSibling new sibling to be added
diff --git a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangTranslatorOperatorNode.java b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangTranslatorOperatorNode.java
new file mode 100644
index 0000000..1c96c68
--- /dev/null
+++ b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangTranslatorOperatorNode.java
@@ -0,0 +1,25 @@
+
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.datamodel;
+
+/**
+ * Abstraction of an entity which provides info about whether to translate module/submodule in manager and service
+ * classes.
+ */
+public interface YangTranslatorOperatorNode {
+}
diff --git a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
index d0f69af..6fd95e0 100644
--- a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
+++ b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
@@ -57,7 +57,8 @@
/**
* Represents data model node to maintain information defined in YANG typedef.
*/
-public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable, YangTypeHolder, CollisionDetector {
+public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable, YangTypeHolder, CollisionDetector,
+ YangTranslatorOperatorNode {
private static final long serialVersionUID = 806201615L;
diff --git a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java
index 503bebe..5b29216 100644
--- a/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java
+++ b/utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java
@@ -370,6 +370,7 @@
*
* @param clonedLeaf cloned leaf in uses from grouping
* @param leafParentHolder holder of the leaf from uses
+ * @param yangUses YANG uses
* @return entity of leafref which has to be resolved
* @throws DataModelException data model error
*/