YANG Schema node Interface update

Change-Id: Id99029c28f80117015566527faf54e13f4403d2a
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java
index 57db582..fa4becf 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java
@@ -81,7 +81,7 @@
 /**
  * Representation of data model node to maintain information defined in YANG augment.
  */
-public class YangAugment
+public abstract class YangAugment
         extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentedInfo, Resolvable,
         YangXPathResolver, YangWhenHolder, YangIfFeatureHolder, YangTranslatorOperatorNode {
@@ -152,7 +152,8 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo) throws DataModelException {
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
+            throws DataModelException {
         getYsnContextInfoMap().put(schemaNodeIdentifier, yangSchemaNodeContextInfo);
         YangSchemaNodeContextInfo yangSchemaNodeContextInfo1 = new YangSchemaNodeContextInfo();
         yangSchemaNodeContextInfo1.setSchemaNode(yangSchemaNodeContextInfo.getSchemaNode());
@@ -454,7 +455,8 @@
     }
 
     @Override
-    public Object resolve() throws DataModelException {
+    public Object resolve()
+            throws DataModelException {
         // Resolving of target node is being done in XPathLinker.
         return null;
     }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java
index a8b6354..5990641 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java
@@ -94,7 +94,7 @@
 /**
  * Represents data model node to maintain information defined in YANG case.
  */
-public class YangCase
+public abstract class YangCase
         extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentableNode,
         YangWhenHolder, YangIfFeatureHolder, YangIsFilterContentNodes {
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangChoice.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangChoice.java
index f151e1d..da9db0d 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangChoice.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangChoice.java
@@ -19,6 +19,7 @@
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.YangConstructType;
@@ -67,7 +68,8 @@
 /**
  * Represents data model node to maintain information defined in YANG choice.
  */
-public class YangChoice extends YangNode
+public abstract class YangChoice
+        extends YangNode
         implements YangCommonInfo, Parsable, CollisionDetector, YangAugmentableNode,
         YangWhenHolder, YangIfFeatureHolder, YangAppErrorHolder, YangIsFilterContentNodes, YangConfig {
 
@@ -172,7 +174,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
             throws DataModelException {
         getYsnContextInfoMap().put(schemaNodeIdentifier, yangSchemaNodeContextInfo);
         YangSchemaNodeContextInfo yangSchemaNodeContextInfo1 = new YangSchemaNodeContextInfo();
@@ -358,7 +360,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
     }
 
@@ -368,7 +371,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         if (defaultValueInString != null && !defaultValueInString.isEmpty()) {
             YangNode node = getChild();
             boolean matched = false;
@@ -391,7 +395,8 @@
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
 
         if (getParent() instanceof YangCase && dataType != YangConstructType.CASE_DATA) {
             ((CollisionDetector) getParent()).detectCollidingChild(identifierName, dataType);
@@ -406,7 +411,8 @@
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
 
         if (dataType == CHOICE_DATA) {
             if (getName().equals(identifierName)) {
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java
index 736499e..a0275eb 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java
@@ -20,6 +20,7 @@
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.YangConstructType;
@@ -88,7 +89,7 @@
 /**
  * Represents data model node to maintain information defined in YANG container.
  */
-public class YangContainer
+public abstract class YangContainer
         extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector,
         YangAugmentableNode, YangMustHolder, YangWhenHolder, YangIfFeatureHolder, YangIsFilterContentNodes,
@@ -162,7 +163,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo) {
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo) {
         getYsnContextInfoMap().put(schemaNodeIdentifier, yangSchemaNodeContextInfo);
     }
 
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangEnumeration.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangEnumeration.java
index be86e8c..c793399 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangEnumeration.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangEnumeration.java
@@ -18,6 +18,7 @@
 
 import java.util.SortedSet;
 import java.util.TreeSet;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.YangConstructType;
@@ -30,7 +31,7 @@
 /**
  * Represents the enumeration data type information.
  */
-public class YangEnumeration
+public abstract class YangEnumeration
         extends YangNode
         implements Parsable, CollisionDetector {
 
@@ -49,7 +50,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
             throws DataModelException {
         // Do nothing.
     }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java
index c728096..6f9d9b0 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java
@@ -17,6 +17,7 @@
 
 import java.util.LinkedList;
 import java.util.List;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.YangConstructType;
@@ -76,7 +77,7 @@
 /**
  * Represents data model node to maintain information defined in YANG grouping.
  */
-public class YangGrouping
+public abstract class YangGrouping
         extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangTranslatorOperatorNode {
 
@@ -118,7 +119,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
             throws DataModelException {
         // Do nothing, to be handled during linking.
     }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentity.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentity.java
index 28bba80..a9c35c1 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentity.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentity.java
@@ -16,6 +16,7 @@
 package org.onosproject.yangutils.datamodel;
 
 import java.io.Serializable;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.YangConstructType;
@@ -46,7 +47,9 @@
 /**
  * Represents data model node to maintain information defined in YANG identity.
  */
-public class YangIdentity extends YangNode implements YangCommonInfo, Parsable, Serializable {
+public abstract class YangIdentity
+        extends YangNode
+        implements YangCommonInfo, Parsable, Serializable {
 
     private static final long serialVersionUID = 806201691L;
 
@@ -69,7 +72,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
             throws DataModelException {
         // Do nothing.
     }
@@ -125,11 +128,13 @@
     }
 
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
     }
 
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
     }
 
     /**
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentityRef.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentityRef.java
index 3f56140..692474c 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentityRef.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangIdentityRef.java
@@ -267,4 +267,16 @@
         YangIdentityRef identityRef = (YangIdentityRef) super.clone();
         return identityRef;
     }
+
+    @Override
+    public String getJavaPackage() {
+        //TODO: throw exception
+        return null;
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        //TODO: throw exception
+        return null;
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangInput.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangInput.java
index ef7206c..4902abe 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangInput.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangInput.java
@@ -69,7 +69,7 @@
 /**
  * Represents data model node to maintain information defined in YANG input.
  */
-public class YangInput
+public abstract class YangInput
         extends YangNode
         implements YangLeavesHolder, Parsable, CollisionDetector, YangAugmentableNode, YangIsFilterContentNodes {
 
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java
index a0316b7..9d0ae23 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java
@@ -62,7 +62,7 @@
 /**
  * Represents leaf data represented in YANG.
  */
-public class YangLeaf
+public abstract class YangLeaf
         implements YangCommonInfo, Parsable, Cloneable, Serializable,
         YangMustHolder, YangIfFeatureHolder, YangWhenHolder, YangSchemaNode, YangConfig {
 
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
index eedfe7b..975c271 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
@@ -58,7 +58,7 @@
 /**
  * Represents leaf-list data represented in YANG.
  */
-public class YangLeafList
+public abstract class YangLeafList
         implements YangCommonInfo, Parsable, Cloneable, Serializable,
         YangMustHolder, YangWhenHolder, YangIfFeatureHolder, YangSchemaNode, YangConfig {
 
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangList.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
index c754b3e..e06d5d5 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
@@ -20,6 +20,7 @@
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.YangConstructType;
@@ -69,7 +70,7 @@
 /**
  * Represents list data represented in YANG.
  */
-public class YangList
+public abstract class YangList
         extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector,
         YangAugmentableNode, YangMustHolder, YangWhenHolder, YangIfFeatureHolder, YangSchemaNode,
@@ -221,7 +222,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo) {
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo) {
         getYsnContextInfoMap().put(schemaNodeIdentifier, yangSchemaNodeContextInfo);
     }
 
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
index 4e6654f..b6e27b7 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
@@ -20,6 +20,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.YangConstructType;
@@ -71,7 +72,7 @@
 /**
  * Represents data model node to maintain information defined in YANG module.
  */
-public class YangModule
+public abstract class YangModule
         extends YangNode
         implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, YangReferenceResolver,
         RpcNotificationContainer, YangFeatureHolder, YangIsFilterContentNodes {
@@ -253,7 +254,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo) {
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo) {
         getYsnContextInfoMap().put(schemaNodeIdentifier, yangSchemaNodeContextInfo);
     }
 
@@ -642,7 +643,7 @@
 
     @Override
     public void addToResolutionList(YangResolutionInfo resolutionInfo,
-                                    ResolvableType type) {
+            ResolvableType type) {
         if (type == ResolvableType.YANG_DERIVED_DATA_TYPE) {
             derivedTypeResolutionList.add(resolutionInfo);
         } else if (type == ResolvableType.YANG_USES) {
@@ -664,7 +665,7 @@
 
     @Override
     public void setResolutionList(List<YangResolutionInfo> resolutionList,
-                                  ResolvableType type) {
+            ResolvableType type) {
         if (type == ResolvableType.YANG_DERIVED_DATA_TYPE) {
             derivedTypeResolutionList = resolutionList;
         } else if (type == ResolvableType.YANG_USES) {
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangNotification.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangNotification.java
index 4daf88b..f0f6f5c 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangNotification.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangNotification.java
@@ -75,7 +75,7 @@
 /**
  * Represents data model node to maintain information defined in YANG notification.
  */
-public class YangNotification
+public abstract class YangNotification
         extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector,
         YangAugmentableNode, YangIfFeatureHolder {
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangOutput.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangOutput.java
index f0af8c2..0c40297 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangOutput.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangOutput.java
@@ -68,7 +68,7 @@
 /**
  * Represents data model node to maintain information defined in YANG output.
  */
-public class YangOutput
+public abstract class YangOutput
         extends YangNode
         implements YangLeavesHolder, Parsable, CollisionDetector, YangAugmentableNode, YangIsFilterContentNodes {
 
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangRpc.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangRpc.java
index 96abbe6..b904da6 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangRpc.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangRpc.java
@@ -19,6 +19,7 @@
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.YangConstructType;
@@ -59,7 +60,9 @@
 /**
  * Represents data model node to maintain information defined in YANG rpc.
  */
-public class YangRpc extends YangNode implements YangCommonInfo, Parsable,
+public abstract class YangRpc
+        extends YangNode
+        implements YangCommonInfo, Parsable,
         CollisionDetector, YangIfFeatureHolder {
 
     private static final long serialVersionUID = 806201613L;
@@ -93,7 +96,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
             throws DataModelException {
         /*
          * This will maintain all child schema which are there inside input and
@@ -113,7 +116,7 @@
 
     @Override
     public void addToDefaultChildMap(YangSchemaNodeIdentifier yangSchemaNodeIdentifier,
-                                     YangSchemaNode yangSchemaNode) {
+            YangSchemaNode yangSchemaNode) {
         /*
          * This will maintain all default child which are there inside input and
          * output as input/output is non data node.
@@ -127,13 +130,15 @@
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // 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 rpc \""
                     + getName() + "\"");
@@ -146,12 +151,14 @@
     }
 
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         //TODO: implement the method.
     }
 
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         //TODO: implement the method.
     }
 
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangSchemaNode.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangSchemaNode.java
index f8fea06..f2662ec 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangSchemaNode.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangSchemaNode.java
@@ -73,4 +73,19 @@
      */
     Map<YangSchemaNodeIdentifier, YangSchemaNode> getDefaultChild(YangSchemaNodeIdentifier dataNodeIdentifier);
 
+    /**
+     * Get Java class's package corresponding to the schema node.
+     *
+     * @return java package, it is null, if the Java type is a built in data type
+     */
+    String getJavaPackage();
+
+    /**
+     * Get Java class or built in data type corresponding to the schema node.
+     *
+     * @return Java class or built in data type corresponding to the schema node
+     */
+    String getJavaClassNameOrBuiltInType();
+
+
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java
index 1022db9..115aaa7 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java
@@ -20,6 +20,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.YangConstructType;
@@ -79,7 +80,7 @@
 /**
  * Represents data model node to maintain information defined in YANG sub-module.
  */
-public class YangSubModule
+public abstract class YangSubModule
         extends YangNode
         implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, YangReferenceResolver,
         RpcNotificationContainer, YangFeatureHolder, YangIsFilterContentNodes {
@@ -256,7 +257,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo) {
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo) {
         getYsnContextInfoMap().put(schemaNodeIdentifier, yangSchemaNodeContextInfo);
     }
 
@@ -601,7 +602,7 @@
 
     @Override
     public void addToResolutionList(YangResolutionInfo resolutionInfo,
-                                    ResolvableType type) {
+            ResolvableType type) {
         if (type == ResolvableType.YANG_DERIVED_DATA_TYPE) {
             derivedTypeResolutionList.add(resolutionInfo);
         } else if (type == ResolvableType.YANG_USES) {
@@ -623,7 +624,7 @@
 
     @Override
     public void setResolutionList(List<YangResolutionInfo> resolutionList,
-                                  ResolvableType type) {
+            ResolvableType type) {
         if (type == ResolvableType.YANG_DERIVED_DATA_TYPE) {
             derivedTypeResolutionList = resolutionList;
         } else if (type == ResolvableType.YANG_USES) {
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
index a786e98..6e2db7f 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
@@ -17,6 +17,7 @@
 
 import java.util.LinkedList;
 import java.util.List;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.YangConstructType;
@@ -56,7 +57,9 @@
 /**
  * Represents data model node to maintain information defined in YANG typedef.
  */
-public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable, YangTypeHolder, CollisionDetector,
+public abstract class YangTypeDef
+        extends YangNode
+        implements YangCommonInfo, Parsable, YangTypeHolder, CollisionDetector,
         YangTranslatorOperatorNode {
 
     private static final long serialVersionUID = 806201615L;
@@ -103,7 +106,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
             throws DataModelException {
         // Do nothing.
     }
@@ -258,7 +261,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
     }
 
@@ -268,7 +272,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         if (defaultValueInString != null && !defaultValueInString.isEmpty() && getTypeDefBaseType() != null) {
             getTypeDefBaseType().isValidValue(defaultValueInString);
         }
@@ -280,13 +285,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 typedef \""
                     + getName() + "\"");
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangUnion.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangUnion.java
index e106c8f..070d101 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangUnion.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangUnion.java
@@ -18,6 +18,7 @@
 
 import java.util.LinkedList;
 import java.util.List;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.YangConstructType;
@@ -48,7 +49,9 @@
 /**
  * Represents data model node to maintain information defined in YANG union.
  */
-public class YangUnion extends YangNode implements Parsable, YangTypeHolder, CollisionDetector {
+public abstract class YangUnion
+        extends YangNode
+        implements Parsable, YangTypeHolder, CollisionDetector {
 
     private static final long serialVersionUID = 806201616L;
 
@@ -69,7 +72,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
             throws DataModelException {
         // Do nothing.
     }
@@ -130,7 +133,8 @@
      * @throws DataModelException union member type must not be one of the
      *                            built-in types "empty" or "leafref"
      */
-    public void addType(YangType<?> yangType) throws DataModelException {
+    public void addType(YangType<?> yangType)
+            throws DataModelException {
         if (yangType.getDataType() == YangDataTypes.EMPTY || yangType.getDataType() == YangDataTypes.LEAFREF) {
             throw new DataModelException("Union member type must not be one of the built-in types \"empty\" or " +
                     "\"leafref\"");
@@ -149,7 +153,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         //TODO: implement the method.
     }
 
@@ -159,17 +164,20 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         //TODO: implement the method.
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Do nothing
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Do nothing
     }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java
index 42e4237..fccf76f 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java
@@ -17,6 +17,7 @@
 
 import java.util.LinkedList;
 import java.util.List;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.datamodel.utils.Parsable;
 import org.onosproject.yangutils.datamodel.utils.ResolvableStatus;
@@ -65,7 +66,7 @@
 /**
  * Represents data model node to maintain information defined in YANG uses.
  */
-public class YangUses
+public abstract class YangUses
         extends YangNode
         implements YangCommonInfo, Parsable, Resolvable, CollisionDetector, YangWhenHolder,
         YangIfFeatureHolder, YangTranslatorOperatorNode {
@@ -154,7 +155,7 @@
 
     @Override
     public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
-                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
+            YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
             throws DataModelException {
         // Do nothing.
     }
@@ -167,7 +168,7 @@
 
     @Override
     public void addToDefaultChildMap(YangSchemaNodeIdentifier yangSchemaNodeIdentifier,
-                                     YangSchemaNode yangSchemaNode) {
+            YangSchemaNode yangSchemaNode) {
         // Do nothing.
         // TODO
     }
@@ -432,7 +433,7 @@
                     if (getCurrentGroupingDepth() == 0) {
                         YangEntityToResolveInfoImpl resolveInfo =
                                 resolveYangConstructsUnderGroupingForLeafList(clonedLeafList,
-                                                                                   usesParentLeavesHolder, this);
+                                        usesParentLeavesHolder, this);
                         if (resolveInfo != null) {
                             addEntityToResolve(resolveInfo);
                         }
@@ -505,7 +506,8 @@
      * @param usesHolder     holder of uses
      */
     private void addResolvedUsesInfoOfGrouping(YangUses usesInGrouping,
-                                               YangLeavesHolder usesHolder) throws DataModelException {
+            YangLeavesHolder usesHolder)
+            throws DataModelException {
         for (YangNode usesResolvedNode : usesInGrouping.getUsesResolvedNodeList()) {
             addNodeOfGrouping(usesResolvedNode);
         }
@@ -529,7 +531,8 @@
      * @throws DataModelException a violation in data model rule
      */
     private List<YangLeaf> cloneLeavesList(List<YangLeaf> listOfLeaves,
-                                           YangLeavesHolder usesParentNode) throws DataModelException {
+            YangLeavesHolder usesParentNode)
+            throws DataModelException {
         if (listOfLeaves == null || listOfLeaves.size() == 0) {
             throw new DataModelException("No leaves to clone");
         }
@@ -560,7 +563,8 @@
      * @return cloned list of leaf list
      */
     private List<YangLeafList> cloneListOfLeafList(List<YangLeafList> listOfLeafList,
-                                                   YangLeavesHolder usesParentNode) throws DataModelException {
+            YangLeavesHolder usesParentNode)
+            throws DataModelException {
         if (listOfLeafList == null || listOfLeafList.size() == 0) {
             throw new DataModelException("No leaf lists to clone");
         }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaAugment.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaAugment.java
index b1d7e44..75274ae 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaAugment.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaAugment.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java augment.
  */
-public class YangJavaAugment extends YangAugment {
+public class YangJavaAugment
+        extends YangAugment {
 
     private static final long serialVersionUID = 208201601L;
 
@@ -35,4 +36,15 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaCase.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaCase.java
index 356825f..aa6e4cf 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaCase.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaCase.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java case.
  */
-public class YangJavaCase extends YangCase {
+public class YangJavaCase
+        extends YangCase {
 
     private static final long serialVersionUID = 208201602L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaChoice.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaChoice.java
index 1b4412d..b54013a 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaChoice.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaChoice.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java choice.
  */
-public class YangJavaChoice extends YangChoice {
+public class YangJavaChoice
+        extends YangChoice {
 
     private static final long serialVersionUID = 208201603L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaContainer.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaContainer.java
index 5b579cd..e0470ed 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaContainer.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaContainer.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java container.
  */
-public class YangJavaContainer extends YangContainer {
+public class YangJavaContainer
+        extends YangContainer {
 
     private static final long serialVersionUID = 208201604L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaEnumeration.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaEnumeration.java
index 2fbc954..1e9a5d5 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaEnumeration.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaEnumeration.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java enumeration.
  */
-public class YangJavaEnumeration extends YangEnumeration {
+public class YangJavaEnumeration
+        extends YangEnumeration {
 
     private static final long serialVersionUID = 208201605L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaGrouping.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaGrouping.java
index 78088cc..79cfb17 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaGrouping.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaGrouping.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java grouping.
  */
-public class YangJavaGrouping extends YangGrouping {
+public class YangJavaGrouping
+        extends YangGrouping {
 
     private static final long serialVersionUID = 208201606L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaIdentity.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaIdentity.java
index 3dc6fa3..4a5a866 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaIdentity.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaIdentity.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java identity.
  */
-public class YangJavaIdentity extends YangIdentity {
+public class YangJavaIdentity
+        extends YangIdentity {
 
     private static final long serialVersionUID = 208201616L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaInput.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaInput.java
index a4578cd..635b51b 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaInput.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaInput.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java input.
  */
-public class YangJavaInput extends YangInput {
+public class YangJavaInput
+        extends YangInput {
 
     private static final long serialVersionUID = 208201607L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaLeaf.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaLeaf.java
index 5d43f14..689358e 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaLeaf.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaLeaf.java
@@ -38,4 +38,15 @@
     public JavaQualifiedTypeInfo getJavaQualifiedTypeInfo() {
         return javaQualifiedTypeInfo;
     }
+
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaQualifiedTypeInfo().getPkgInfo();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaQualifiedTypeInfo().getClassInfo();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaLeafList.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaLeafList.java
index fac2b84..c229b1f 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaLeafList.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaLeafList.java
@@ -38,4 +38,14 @@
     public JavaQualifiedTypeInfo getJavaQualifiedTypeInfo() {
         return javaQualifiedTypeInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaQualifiedTypeInfo().getPkgInfo();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaQualifiedTypeInfo().getClassInfo();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaList.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaList.java
index 499f89f..00d42c1 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaList.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaList.java
@@ -21,7 +21,8 @@
 /**
  * Represent YANG java list.
  */
-public class YangJavaList extends YangList {
+public class YangJavaList
+        extends YangList {
 
     private static final long serialVersionUID = 208201608L;
 
@@ -39,4 +40,13 @@
         return javaFileInfo;
     }
 
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaModule.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaModule.java
index 46915db..08544f4 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaModule.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaModule.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java module.
  */
-public class YangJavaModule extends YangModule {
+public class YangJavaModule
+        extends YangModule {
 
     private static final long serialVersionUID = 208201609L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaNotification.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaNotification.java
index 653f37b..39a32e1 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaNotification.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaNotification.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java notification.
  */
-public class YangJavaNotification extends YangNotification {
+public class YangJavaNotification
+        extends YangNotification {
 
     private static final long serialVersionUID = 208201610L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaOutput.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaOutput.java
index 08fe3bd..8b23fba 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaOutput.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaOutput.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java output.
  */
-public class YangJavaOutput extends YangOutput {
+public class YangJavaOutput
+        extends YangOutput {
 
     private static final long serialVersionUID = 208201611L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaRpc.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaRpc.java
index 382f36c..74b8f11 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaRpc.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaRpc.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java rpc.
  */
-public class YangJavaRpc extends YangRpc {
+public class YangJavaRpc
+        extends YangRpc {
 
     private static final long serialVersionUID = 208201612L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaSubModule.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaSubModule.java
index 34d90c4..15acdb8 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaSubModule.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaSubModule.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java submodule.
  */
-public class YangJavaSubModule extends YangSubModule {
+public class YangJavaSubModule
+        extends YangSubModule {
 
     private static final long serialVersionUID = 208201612L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaTypeDef.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaTypeDef.java
index 345d53b..3cb5841 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaTypeDef.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaTypeDef.java
@@ -21,7 +21,8 @@
 /**
  * Represents YANG java typedef.
  */
-public class YangJavaTypeDef extends YangTypeDef {
+public class YangJavaTypeDef
+        extends YangTypeDef {
 
     private static final long serialVersionUID = 208201613L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaUnion.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaUnion.java
index 1111d48..a13c127 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaUnion.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaUnion.java
@@ -21,7 +21,8 @@
 /**
  * Represent YANG java union.
  */
-public class YangJavaUnion extends YangUnion {
+public class YangJavaUnion
+        extends YangUnion {
 
     private static final long serialVersionUID = 208201614L;
     protected JavaFileInfo javaFileInfo;
@@ -34,4 +35,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaUses.java b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaUses.java
index 1e1e363..07c1b3f 100644
--- a/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaUses.java
+++ b/datamodel/src/main/java/org/onosproject/yangutils/datamodel/javadatamodel/YangJavaUses.java
@@ -21,7 +21,8 @@
 /**
  * Represent YANG java uses.
  */
-public class YangJavaUses extends YangUses {
+public class YangJavaUses
+        extends YangUses {
 
     private static final long serialVersionUID = 208201615L;
 
@@ -35,4 +36,14 @@
     public JavaFileInfo getJavaFileInfo() {
         return javaFileInfo;
     }
+
+    @Override
+    public String getJavaPackage() {
+        return getJavaFileInfo().getPackage();
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        return getJavaFileInfo().getJavaName();
+    }
 }
diff --git a/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListenerTest.java b/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListenerTest.java
index ee418c2..fbe961b 100644
--- a/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListenerTest.java
+++ b/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListenerTest.java
@@ -20,6 +20,7 @@
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaModule;
 import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
@@ -41,7 +42,7 @@
         thrown.expect(ParserException.class);
         thrown.expectMessage("Internal parser error detected: Invalid holder for yangbase before processing.");
 
-        YangModule tmpModule = new YangModule();
+        YangModule tmpModule = new YangJavaModule();
         TreeWalkListener listener = new TreeWalkListener();
         listener.getParsedDataStack().push(tmpModule);
         GeneratedYangParser.YangfileContext ctx = null;
@@ -95,12 +96,12 @@
         thrown.expect(ParserException.class);
         thrown.expectMessage("Internal parser error detected: Invalid holder for yangbase after processing.");
 
-        YangModule tmpModule = new YangModule();
-        YangModule tmpModule2 = new YangModule();
+        YangModule tmpModule = new YangJavaModule();
+        YangModule tmpModule2 = new YangJavaModule();
         TreeWalkListener listener = new TreeWalkListener();
         listener.getParsedDataStack().push(tmpModule);
         listener.getParsedDataStack().push(tmpModule2);
         GeneratedYangParser.YangfileContext ctx = null;
         BaseFileListener.processYangFileExit(listener, ctx);
     }
-}
\ No newline at end of file
+}