Elaborating ModelConverter API javadoc
Change-Id: Iba736b255fc8d01207d29a8b707c6313d444de84
diff --git a/model/src/main/java/org/onosproject/yang/model/ModelConverter.java b/model/src/main/java/org/onosproject/yang/model/ModelConverter.java
index 22e07df..e8c4df1 100644
--- a/model/src/main/java/org/onosproject/yang/model/ModelConverter.java
+++ b/model/src/main/java/org/onosproject/yang/model/ModelConverter.java
@@ -30,6 +30,7 @@
*
* @param data resource data
* @return model object data of specified resource data
+ * @throws ModelConverterException when fails to perform model conversion
*/
ModelObjectData createModel(ResourceData data);
@@ -42,6 +43,7 @@
*
* @param modelData model object data
* @return resource data corresponds to model object
+ * @throws ModelConverterException when fails to perform model conversion
*/
ResourceData createDataNode(ModelObjectData modelData);
}
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConvertorException.java b/model/src/main/java/org/onosproject/yang/model/ModelConverterException.java
similarity index 77%
rename from runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConvertorException.java
rename to model/src/main/java/org/onosproject/yang/model/ModelConverterException.java
index 2d15937..0a2be87 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConvertorException.java
+++ b/model/src/main/java/org/onosproject/yang/model/ModelConverterException.java
@@ -14,22 +14,21 @@
* limitations under the License.
*/
-package org.onosproject.yang.runtime.impl;
+package org.onosproject.yang.model;
/**
* Represents exception that needs to be handled by model converter.
- *
- * @deprecated use {@link ModelConverterException} instead.
*/
-@Deprecated
-class ModelConvertorException extends RuntimeException {
+public class ModelConverterException extends RuntimeException {
+
+ private static final long serialVersionUID = 4586537426529302237L;
/**
* Creates model converter exception with an exception message.
*
* @param exceptionMessage message with which exception must be thrown
*/
- ModelConvertorException(String exceptionMessage) {
+ public ModelConverterException(String exceptionMessage) {
super(exceptionMessage);
}
@@ -39,7 +38,7 @@
* @param exceptionMessage message with which exception must be thrown
* @param cause cause of the exception
*/
- ModelConvertorException(String exceptionMessage, Throwable cause) {
+ public ModelConverterException(String exceptionMessage, Throwable cause) {
super(exceptionMessage, cause);
}
@@ -48,7 +47,7 @@
*
* @param cause cause of the exception
*/
- ModelConvertorException(Throwable cause) {
+ public ModelConverterException(Throwable cause) {
super(cause);
}
}
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/DataTreeBuilderHelper.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DataTreeBuilderHelper.java
index cb88b02..bf106fd 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/DataTreeBuilderHelper.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DataTreeBuilderHelper.java
@@ -34,6 +34,7 @@
import org.onosproject.yang.model.LeafNode;
import org.onosproject.yang.model.LeafSchemaContext;
import org.onosproject.yang.model.LeafType;
+import org.onosproject.yang.model.ModelConverterException;
import org.onosproject.yang.model.YangNamespace;
import java.util.ArrayList;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultDataTreeBuilder.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultDataTreeBuilder.java
index d9b4157..2448a32 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultDataTreeBuilder.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultDataTreeBuilder.java
@@ -37,6 +37,7 @@
import org.onosproject.yang.model.InnerNode;
import org.onosproject.yang.model.LeafModelObject;
import org.onosproject.yang.model.LeafNode;
+import org.onosproject.yang.model.ModelConverterException;
import org.onosproject.yang.model.ModelObject;
import org.onosproject.yang.model.ModelObjectData;
import org.onosproject.yang.model.ModelObjectId;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangModelRegistry.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangModelRegistry.java
index 3d6f507..8aad2b4 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangModelRegistry.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangModelRegistry.java
@@ -27,6 +27,7 @@
import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
import org.onosproject.yang.compiler.tool.YangModuleExtendedInfo;
import org.onosproject.yang.model.DataNode;
+import org.onosproject.yang.model.ModelConverterException;
import org.onosproject.yang.model.ModelObjectId;
import org.onosproject.yang.model.SchemaContext;
import org.onosproject.yang.model.SchemaId;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModIdToRscIdConverter.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModIdToRscIdConverter.java
index 6ac031e..b80ae02 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModIdToRscIdConverter.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModIdToRscIdConverter.java
@@ -29,6 +29,7 @@
import org.onosproject.yang.compiler.datamodel.YangSchemaNodeType;
import org.onosproject.yang.compiler.datamodel.YangType;
import org.onosproject.yang.model.AtomicPath;
+import org.onosproject.yang.model.ModelConverterException;
import org.onosproject.yang.model.ModelObjectId;
import org.onosproject.yang.model.MultiInstanceLeaf;
import org.onosproject.yang.model.MultiInstanceNode;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConverterException.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConverterException.java
deleted file mode 100644
index 1c33a08..0000000
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConverterException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2017-present Open Networking Foundation
- *
- * 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.yang.runtime.impl;
-
-/**
- * Represents exception that needs to be handled by model converter.
- */
-// extending ModelConvertorException for backward compatibility,
-// directly extend RuntimeException when removing Exception class with typo
-@SuppressWarnings("deprecation")
-class ModelConverterException
- extends ModelConvertorException {
-
- private static final long serialVersionUID = 4586537426529302237L;
-
- /**
- * Creates model converter exception with an exception message.
- *
- * @param exceptionMessage message with which exception must be thrown
- */
- ModelConverterException(String exceptionMessage) {
- super(exceptionMessage);
- }
-
- /**
- * Creates model converter exception with an exception message and cause.
- *
- * @param exceptionMessage message with which exception must be thrown
- * @param cause cause of the exception
- */
- ModelConverterException(String exceptionMessage, Throwable cause) {
- super(exceptionMessage, cause);
- }
-
- /**
- * Creates model converter exception with the cause for it.
- *
- * @param cause cause of the exception
- */
- ModelConverterException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConverterUtil.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConverterUtil.java
index 7c52154..3bff872 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConverterUtil.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConverterUtil.java
@@ -35,6 +35,7 @@
import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yang.model.AtomicPath;
import org.onosproject.yang.model.LeafSchemaContext;
+import org.onosproject.yang.model.ModelConverterException;
import org.onosproject.yang.model.MultiInstanceLeaf;
import org.onosproject.yang.model.MultiInstanceNode;
import org.onosproject.yang.model.SingleInstanceLeaf;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobHandlerFactory.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobHandlerFactory.java
index a3f9a16..4814a89 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobHandlerFactory.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobHandlerFactory.java
@@ -17,6 +17,7 @@
package org.onosproject.yang.runtime.impl;
import org.onosproject.yang.model.DataNode;
+import org.onosproject.yang.model.ModelConverterException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafListNodeHandler.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafListNodeHandler.java
index 754c3db..e7cbf6f 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafListNodeHandler.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafListNodeHandler.java
@@ -22,6 +22,7 @@
import org.onosproject.yang.compiler.datamodel.javadatamodel.JavaQualifiedTypeInfoContainer;
import org.onosproject.yang.model.DataNode;
import org.onosproject.yang.model.LeafNode;
+import org.onosproject.yang.model.ModelConverterException;
import org.onosproject.yang.runtime.YangModelRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafNodeHandler.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafNodeHandler.java
index 8414387..de18305 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafNodeHandler.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafNodeHandler.java
@@ -22,6 +22,7 @@
import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yang.model.DataNode;
import org.onosproject.yang.model.LeafNode;
+import org.onosproject.yang.model.ModelConverterException;
import org.onosproject.yang.runtime.YangModelRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobUtils.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobUtils.java
index 681d1eb..4f1b707 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobUtils.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobUtils.java
@@ -38,6 +38,7 @@
import org.onosproject.yang.model.LeafModelObject;
import org.onosproject.yang.model.LeafNode;
import org.onosproject.yang.model.ListKey;
+import org.onosproject.yang.model.ModelConverterException;
import org.onosproject.yang.model.ModelObject;
import org.onosproject.yang.model.ModelObjectId;
import org.onosproject.yang.model.MultiInstanceObject;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobWorkBench.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobWorkBench.java
index aab956c..79201da 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobWorkBench.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobWorkBench.java
@@ -22,6 +22,7 @@
import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
import org.onosproject.yang.model.DataNode;
import org.onosproject.yang.model.InnerModelObject;
+import org.onosproject.yang.model.ModelConverterException;
import org.onosproject.yang.runtime.YangModelRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;