YANG runtime impl package consolidation & YANG compiler's YangLexer package correction.
Change-Id: I86ebebf5e15f17e32eda31db65ae55fdf11bc6f9
diff --git a/compiler/base/parser/src/main/resources/GeneratedYang.g4 b/compiler/base/parser/src/main/resources/GeneratedYang.g4
index af16c05..0646a60 100644
--- a/compiler/base/parser/src/main/resources/GeneratedYang.g4
+++ b/compiler/base/parser/src/main/resources/GeneratedYang.g4
@@ -21,10 +21,6 @@
grammar GeneratedYang;
import YangLexer;
-@header {
-package org.onosproject.yang.compiler.parser.antlrgencode;
-}
-
yangfile : moduleStatement EOF
| subModuleStatement EOF;
diff --git a/compiler/base/parser/src/main/resources/YangLexer.g4 b/compiler/base/parser/src/main/resources/YangLexer.g4
index 51a9231..45189f7 100644
--- a/compiler/base/parser/src/main/resources/YangLexer.g4
+++ b/compiler/base/parser/src/main/resources/YangLexer.g4
@@ -20,6 +20,10 @@
lexer grammar YangLexer;
+@header {
+package org.onosproject.yang.compiler.parser.antlrgencode;
+}
+
// Statements keywords
ANYXML_KEYWORD : 'anyxml';
ARGUMENT_KEYWORD : 'argument';
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/ymrimpl/DefaultYangModelRegistry.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangModelRegistry.java
similarity index 99%
rename from runtime/src/main/java/org/onosproject/yang/runtime/ymrimpl/DefaultYangModelRegistry.java
rename to runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangModelRegistry.java
index 566fefc..51cbf03 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/ymrimpl/DefaultYangModelRegistry.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangModelRegistry.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.onosproject.yang.runtime.ymrimpl;
+package org.onosproject.yang.runtime.impl;
import org.onosproject.yang.YangModel;
import org.onosproject.yang.YangModuleId;
@@ -57,9 +57,8 @@
public class DefaultYangModelRegistry implements YangModelRegistry,
SingleInstanceNodeContext {
- private final Logger log = getLogger(getClass());
private static final String AT = "@";
-
+ private final Logger log = getLogger(getClass());
/*
* Map for storing YANG schema nodes. Key will be the schema name of
* module node defined in YANG file.
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/yrhimpl/DefaultYangRuntimeHandler.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangRuntimeHandler.java
similarity index 94%
rename from runtime/src/main/java/org/onosproject/yang/runtime/yrhimpl/DefaultYangRuntimeHandler.java
rename to runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangRuntimeHandler.java
index 074a06d..d8252d1 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/yrhimpl/DefaultYangRuntimeHandler.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangRuntimeHandler.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.onosproject.yang.runtime.yrhimpl;
+package org.onosproject.yang.runtime.impl;
import org.onosproject.yang.model.SchemaContext;
import org.onosproject.yang.runtime.CompositeData;
@@ -26,8 +26,6 @@
import org.onosproject.yang.runtime.YangSerializer;
import org.onosproject.yang.runtime.YangSerializerContext;
import org.onosproject.yang.runtime.YangSerializerRegistry;
-import org.onosproject.yang.runtime.ymrimpl.DefaultYangModelRegistry;
-import org.onosproject.yang.runtime.ysrimpl.DefaultYangSerializerRegistry;
import org.slf4j.Logger;
import static org.slf4j.LoggerFactory.getLogger;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/ysrimpl/DefaultYangSerializerRegistry.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangSerializerRegistry.java
similarity index 95%
rename from runtime/src/main/java/org/onosproject/yang/runtime/ysrimpl/DefaultYangSerializerRegistry.java
rename to runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangSerializerRegistry.java
index df652b5..4ac99a5 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/ysrimpl/DefaultYangSerializerRegistry.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DefaultYangSerializerRegistry.java
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package org.onosproject.yang.runtime.ysrimpl;
+package org.onosproject.yang.runtime.impl;
import org.onosproject.yang.runtime.YangSerializer;
import org.onosproject.yang.runtime.YangSerializerRegistry;
-import org.onosproject.yang.runtime.ymrimpl.DefaultYangModelRegistry;
import org.slf4j.Logger;
import java.util.HashSet;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/yrhimpl/package-info.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/package-info.java
similarity index 86%
rename from runtime/src/main/java/org/onosproject/yang/runtime/yrhimpl/package-info.java
rename to runtime/src/main/java/org/onosproject/yang/runtime/impl/package-info.java
index d4aef06..c0db4c9 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/yrhimpl/package-info.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/package-info.java
@@ -15,6 +15,6 @@
*/
/**
- * Contains implementation of YANG runtime service.
+ * Provides an implementation of YANG runtime.
*/
-package org.onosproject.yang.runtime.yrhimpl;
\ No newline at end of file
+package org.onosproject.yang.runtime.impl;
\ No newline at end of file
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/ymrimpl/package-info.java b/runtime/src/main/java/org/onosproject/yang/runtime/ymrimpl/package-info.java
deleted file mode 100644
index 2f5448f..0000000
--- a/runtime/src/main/java/org/onosproject/yang/runtime/ymrimpl/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2017-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.
- */
-
-/**
- * Contains implementation of YANG model registry.
- */
-package org.onosproject.yang.runtime.ymrimpl;
\ No newline at end of file
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/ysrimpl/package-info.java b/runtime/src/main/java/org/onosproject/yang/runtime/ysrimpl/package-info.java
deleted file mode 100644
index 93f65f4..0000000
--- a/runtime/src/main/java/org/onosproject/yang/runtime/ysrimpl/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2017-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.
- */
-
-/**
- * Contains implementation of YANG schema registry.
- */
-package org.onosproject.yang.runtime.ysrimpl;
\ No newline at end of file
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/DefaultYangModelRegistryTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/DefaultYangModelRegistryTest.java
index 0e12c39..c16189b 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/DefaultYangModelRegistryTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/DefaultYangModelRegistryTest.java
@@ -22,7 +22,6 @@
import org.onosproject.yang.compiler.datamodel.YangNode;
import org.onosproject.yang.compiler.datamodel.YangRevision;
import org.onosproject.yang.compiler.datamodel.YangSchemaNode;
-import org.onosproject.yang.runtime.ymrimpl.DefaultYangModelRegistry;
import java.io.IOException;
import java.util.ArrayList;
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/RuntimeHandlerTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/RuntimeHandlerTest.java
index 2f93f2b..e2571e2 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/RuntimeHandlerTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/RuntimeHandlerTest.java
@@ -22,8 +22,6 @@
import org.onosproject.yang.runtime.DefaultRuntimeContext;
import org.onosproject.yang.runtime.YangRuntimeService;
import org.onosproject.yang.runtime.YangSerializer;
-import org.onosproject.yang.runtime.yrhimpl.DefaultYangRuntimeHandler;
-import org.onosproject.yang.runtime.ysrimpl.DefaultYangSerializerRegistry;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/SerializerRegistryTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/SerializerRegistryTest.java
index 6d9f88c..4368e86 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/SerializerRegistryTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/SerializerRegistryTest.java
@@ -18,7 +18,6 @@
import org.junit.Test;
import org.onosproject.yang.runtime.YangSerializer;
-import org.onosproject.yang.runtime.ysrimpl.DefaultYangSerializerRegistry;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestYangSchemaNodeProvider.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestYangSchemaNodeProvider.java
index 88f0a44..272bbb9 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestYangSchemaNodeProvider.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestYangSchemaNodeProvider.java
@@ -24,7 +24,6 @@
import org.onosproject.yang.runtime.DefaultModelRegistrationParam;
import org.onosproject.yang.runtime.ModelRegistrationParam;
import org.onosproject.yang.runtime.YangModelRegistry;
-import org.onosproject.yang.runtime.ymrimpl.DefaultYangModelRegistry;
import java.io.File;
import java.io.IOException;
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestYangSerializerContext.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestYangSerializerContext.java
index bd34087..b01b44e 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestYangSerializerContext.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestYangSerializerContext.java
@@ -19,7 +19,6 @@
import org.onosproject.yang.model.SchemaContext;
import org.onosproject.yang.runtime.Annotation;
import org.onosproject.yang.runtime.YangSerializerContext;
-import org.onosproject.yang.runtime.ymrimpl.DefaultYangModelRegistry;
import java.util.List;
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/CaseSchemaContextTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/CaseSchemaContextTest.java
index 4d54d2c..2d3b21c 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/CaseSchemaContextTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/CaseSchemaContextTest.java
@@ -25,7 +25,7 @@
import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
import org.onosproject.yang.model.SchemaId;
import org.onosproject.yang.runtime.impl.TestYangSchemaNodeProvider;
-import org.onosproject.yang.runtime.ymrimpl.DefaultYangModelRegistry;
+import org.onosproject.yang.runtime.impl.DefaultYangModelRegistry;
import static org.onosproject.yang.model.DataNode.Type.MULTI_INSTANCE_NODE;
import static org.onosproject.yang.model.DataNode.Type.SINGLE_INSTANCE_NODE;
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/LeafSchemaContextTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/LeafSchemaContextTest.java
index cc9e0bd..48166a8 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/LeafSchemaContextTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/LeafSchemaContextTest.java
@@ -27,7 +27,7 @@
import org.onosproject.yang.model.DataNode;
import org.onosproject.yang.model.SchemaId;
import org.onosproject.yang.runtime.impl.TestYangSchemaNodeProvider;
-import org.onosproject.yang.runtime.ymrimpl.DefaultYangModelRegistry;
+import org.onosproject.yang.runtime.impl.DefaultYangModelRegistry;
import static org.onosproject.yang.runtime.impl.TestUtils.checkLeafListSchemaContext;
import static org.onosproject.yang.runtime.impl.TestUtils.checkLeafSchemaContext;
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/SchemaContextTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/SchemaContextTest.java
index 1b3d3de..d1db55f 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/SchemaContextTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/schemacontext/SchemaContextTest.java
@@ -25,7 +25,7 @@
import org.onosproject.yang.model.DataNode;
import org.onosproject.yang.model.SchemaId;
import org.onosproject.yang.runtime.impl.TestYangSchemaNodeProvider;
-import org.onosproject.yang.runtime.ymrimpl.DefaultYangModelRegistry;
+import org.onosproject.yang.runtime.impl.DefaultYangModelRegistry;
import java.util.List;
diff --git a/serializers/xml/src/test/java/org/onosproject/yang/serializers/xml/MockYangSchemaNodeProvider.java b/serializers/xml/src/test/java/org/onosproject/yang/serializers/xml/MockYangSchemaNodeProvider.java
index 138d22d..7b26f0f 100644
--- a/serializers/xml/src/test/java/org/onosproject/yang/serializers/xml/MockYangSchemaNodeProvider.java
+++ b/serializers/xml/src/test/java/org/onosproject/yang/serializers/xml/MockYangSchemaNodeProvider.java
@@ -24,7 +24,7 @@
import org.onosproject.yang.runtime.DefaultModelRegistrationParam;
import org.onosproject.yang.runtime.ModelRegistrationParam;
import org.onosproject.yang.runtime.YangModelRegistry;
-import org.onosproject.yang.runtime.ymrimpl.DefaultYangModelRegistry;
+import org.onosproject.yang.runtime.impl.DefaultYangModelRegistry;
import java.io.File;
import java.io.IOException;
diff --git a/serializers/xml/src/test/java/org/onosproject/yang/serializers/xml/MockYangSerializerContext.java b/serializers/xml/src/test/java/org/onosproject/yang/serializers/xml/MockYangSerializerContext.java
index dfc8d06..c89700b 100644
--- a/serializers/xml/src/test/java/org/onosproject/yang/serializers/xml/MockYangSerializerContext.java
+++ b/serializers/xml/src/test/java/org/onosproject/yang/serializers/xml/MockYangSerializerContext.java
@@ -20,7 +20,7 @@
import org.onosproject.yang.runtime.Annotation;
import org.onosproject.yang.runtime.DefaultAnnotation;
import org.onosproject.yang.runtime.YangSerializerContext;
-import org.onosproject.yang.runtime.ymrimpl.DefaultYangModelRegistry;
+import org.onosproject.yang.runtime.impl.DefaultYangModelRegistry;
import java.util.LinkedList;
import java.util.List;