[ONOS-3884] Common interface for parser and translator

Change-Id: I0e556f4324375132787a6b1abefccdd1414abf50
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangCommonInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangCommonInfo.java
new file mode 100644
index 0000000..c2c76e7
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangCommonInfo.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2016 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 YANG entity's common meta data. Abstracted to unify the
+ * parsing and translator processing.
+ */
+public interface YangCommonInfo extends YangDesc, YangReference, YangStatus {
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangDesc.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangDesc.java
new file mode 100644
index 0000000..d39c1ee
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangDesc.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2016 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 textual description for a YANG entity. Abstracted to unify the
+ * parsing and translator processing of description.
+ */
+public interface YangDesc {
+    /**
+     * Get the description of YANG entity.
+     *
+     * @return the description of YANG entity.
+     */
+    String getDescription();
+
+    /**
+     * Set the description of YANG entity.
+     *
+     * @param description set the description of YANG entity.
+     */
+    void setDescription(String description);
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNameSpace.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNameSpace.java
new file mode 100644
index 0000000..03779bd
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNameSpace.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2016 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;
+
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.parser.Parsable;
+import org.onosproject.yangutils.parser.ParsableDataType;
+
+/*
+ *  Reference:RFC 6020.
+ *  The "namespace" statement defines the XML namespace that all
+ *  identifiers defined by the module are qualified by, with the
+ *  exception of data node identifiers defined inside a grouping.
+ *  The argument to the "namespace" statement is the URI of the
+ *  namespace.
+ */
+
+/**
+ * Name space to be used for the XML data tree.
+ */
+public class YangNameSpace implements Parsable {
+
+    private String uri;
+
+    /**
+     * Default constructor.
+     */
+    public YangNameSpace() {
+    }
+
+    /**
+     * Get the name space URI.
+     *
+     * @return the URI.
+     */
+    public String getUri() {
+        return uri;
+    }
+
+    /**
+     * Set the name space URI.
+     *
+     * @param uri the URI to set
+     */
+    public void setUri(String uri) {
+        this.uri = uri;
+    }
+
+    /**
+     * Returns the type of the parsed data.
+     *
+     * @return returns NAMESPACE_DATA.
+     */
+    public ParsableDataType getParsableDataType() {
+        return ParsableDataType.NAMESPACE_DATA;
+    }
+
+    /**
+     * Validate the data on entering the corresponding parse tree node.
+     *
+     * @throws DataModelException a violation of data model rules.
+     */
+    public void validateDataOnEntry() throws DataModelException {
+        // TODO auto-generated method stub, to be implemented by parser
+
+    }
+
+    /**
+     * Validate the data on exiting the corresponding parse tree node.
+     *
+     * @throws DataModelException a violation of data model rules.
+     */
+    public void validateDataOnExit() throws DataModelException {
+        // TODO auto-generated method stub, to be implemented by parser
+
+    }
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangReference.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangReference.java
new file mode 100644
index 0000000..98093bb
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangReference.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2016 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 textual reference for a YANG entity. Abstracted to unify the
+ * parsing and translator processing of reference.
+ */
+public interface YangReference {
+    /**
+     * Get the textual reference.
+     *
+     * @return the reference.
+     */
+    String getReference();
+
+    /**
+     * Set the textual reference.
+     *
+     * @param reference the reference to set.
+     */
+    void setReference(String reference);
+
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangRevision.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangRevision.java
new file mode 100644
index 0000000..7fb293d
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangRevision.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2016 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;
+
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.parser.Parsable;
+import org.onosproject.yangutils.parser.ParsableDataType;
+
+/*
+ *  Reference:RFC 6020.
+ *  The "revision" statement specifies the editorial revision history of
+ *  the module, including the initial revision.  A series of revision
+ *  statements detail the changes in the module's definition.  The
+ *  argument is a date string in the format "YYYY-MM-DD", followed by a
+ *  block of sub-statements that holds detailed revision information.  A
+ *  module SHOULD have at least one initial "revision" statement.  For
+ *  every published editorial change, a new one SHOULD be added in front
+ *  of the revisions sequence, so that all revisions are in reverse
+ *  chronological order.
+ *  The revision's sub-statement
+ *
+ *                +--------------+---------+-------------+------------------+
+ *                | substatement | section | cardinality |data model mapping|
+ *                +--------------+---------+-------------+------------------+
+ *                | description  | 7.19.3  | 0..1        |string            |
+ *                | reference    | 7.19.4  | 0..1        |sring            |
+ *                +--------------+---------+-------------+------------------+
+ */
+/**
+ * Maintains the information about the revision.
+ */
+public class YangRevision implements YangDesc, YangReference, Parsable {
+
+    /**
+     * Revision date. Date string in the format "YYYY-MM-DD"
+     */
+    private String revDate;
+
+    /**
+     * Description of revision.
+     */
+    private String description;
+
+    /**
+     * Textual reference for revision.
+     */
+    private String reference;
+
+    /**
+     * Default constructor.
+     */
+    public YangRevision() {
+    }
+
+    /**
+     * Get the revision date.
+     *
+     * @return the revision date
+     */
+    public String getRevDate() {
+        return revDate;
+    }
+
+    /**
+     * Set the revision date.
+     *
+     * @param revDate the revision date to set
+     */
+    public void setRevDate(String revDate) {
+        this.revDate = revDate;
+    }
+
+    /**
+     * Get the description.
+     *
+     * @return the description.
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Set the description.
+     *
+     * @param description set the description.
+     */
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    /**
+     * Get the textual reference.
+     *
+     * @return the reference.
+     */
+    public String getReference() {
+        return reference;
+    }
+
+    /**
+     * Set the textual reference.
+     *
+     * @param reference the reference to set.
+     */
+    public void setReference(String reference) {
+        this.reference = reference;
+    }
+
+    /**
+     * Returns the type of the parsed data.
+     *
+     * @return returns REVISION_DATA.
+     */
+    public ParsableDataType getParsableDataType() {
+        return ParsableDataType.REVISION_DATA;
+    }
+
+    /**
+     * Validate the data on entering the corresponding parse tree node.
+     *
+     * @throws DataModelException a violation of data model rules.
+     */
+    public void validateDataOnEntry() throws DataModelException {
+        // TODO auto-generated method stub, to be implemented by parser
+
+    }
+
+    /**
+     * Validate the data on exiting the corresponding parse tree node.
+     *
+     * @throws DataModelException a violation of data model rules.
+     */
+    public void validateDataOnExit() throws DataModelException {
+        // TODO auto-generated method stub, to be implemented by parser
+
+    }
+}