multiFileYangTranslator

Change-Id: I2adfef3acaec4bd74ba2c487404d2c655b800988
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/CollisionDetector.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/CollisionDetector.java
index 7d37929..69ff0c0 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/CollisionDetector.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/CollisionDetector.java
@@ -28,23 +28,25 @@
      * Checks for the colliding child.
      *
      * @param identifierName name of identifier for which collision to be
-     *            checked
+     * checked
      * @param dataType type of the YANG construct for which collision to be
-     *            checked
+     * checked
      * @throws DataModelException if there is any collision in YANG rules in
      *             parsed data, corresponding exception should be thrown
      */
-    void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException;
+    void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException;
 
     /**
      * Check for the self collision.
      *
      * @param identifierName name of identifier for which collision to be
-     *            checked
+     * checked
      * @param dataType type of the YANG construct for which collision to be
-     *            checked
+     * checked
      * @throws DataModelException if there is any collision in YANG rules in
-     *             parsed data, corresponding exception should be thrown
+     *                            parsed data, corresponding exception should be thrown
      */
-    void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException;
+    void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException;
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasRpcNotification.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/RpcNotificationContainer.java
similarity index 93%
rename from utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasRpcNotification.java
rename to utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/RpcNotificationContainer.java
index 9d4d5f1..2d29f9e 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasRpcNotification.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/RpcNotificationContainer.java
@@ -19,5 +19,5 @@
 /**
  * Represents class having rpc and notification.
  */
-public interface HasRpcNotification {
+public interface RpcNotificationContainer {
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangEntityToResolveInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangEntityToResolveInfo.java
index aa95899..229625c 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangEntityToResolveInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangEntityToResolveInfo.java
@@ -19,6 +19,8 @@
 
 /**
  * Represents information about entity being resolved.
+ *
+ * @param <T> type of entity being resolved, uses / grouping
  */
 public class YangEntityToResolveInfo<T> {
 
@@ -58,13 +60,19 @@
     /**
      * Sets parent node which contains the entity to be resolved.
      *
-     * @param holderOfEntityToResolve parent node which contains the entity to be resolved
+     * @param holderOfEntityToResolve parent node which contains the entity to
+     * be resolved
      */
     public void setHolderOfEntityToResolve(YangNode holderOfEntityToResolve) {
         this.holderOfEntityToResolve = holderOfEntityToResolve;
     }
 
-
+    /**
+     * Retrieves the prefix of the entity.
+     *
+     * @return entities prefix
+     * @throws DataModelException data model error
+     */
     public String getEntityPrefix()
             throws DataModelException {
         if (getEntityToResolve() == null) {
@@ -72,11 +80,11 @@
         }
 
         String prefix;
-        T entityToResolve = getEntityToResolve();
-        if (entityToResolve instanceof YangType) {
-            prefix = ((YangType<?>) entityToResolve).getPrefix();
-        } else if (entityToResolve instanceof YangUses) {
-            prefix = ((YangUses) entityToResolve).getPrefix();
+        T entityToBeResolved = getEntityToResolve();
+        if (entityToBeResolved instanceof YangType) {
+            prefix = ((YangType<?>) entityToBeResolved).getPrefix();
+        } else if (entityToBeResolved instanceof YangUses) {
+            prefix = ((YangUses) entityToBeResolved).getPrefix();
         } else {
             throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
         }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java
index 83091b1..c9808a2 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java
@@ -53,10 +53,12 @@
  *       | when         | 7.19.5  | 0..1        | - TODO           |
  *       +--------------+---------+-------------+------------------+
  */
+
 /**
  * Represents leaf data represented in YANG.
  */
-public class YangLeaf implements YangCommonInfo, Parsable {
+public class YangLeaf
+        implements YangCommonInfo, Parsable {
 
     /**
      * Name of leaf.
@@ -109,7 +111,7 @@
      *
      * @return the leaf name
      */
-    public String getLeafName() {
+    public String getName() {
         return name;
     }
 
@@ -270,7 +272,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
 
     }
@@ -281,7 +284,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    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/YangLeafList.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
index 809bb8c..0e0bc3e 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
@@ -49,10 +49,12 @@
  *                | when         | 7.19.5  | 0..1        | -TODO            |
  *                +--------------+---------+-------------+------------------+
  */
+
 /**
  * Represents leaf-list data represented in YANG.
  */
-public class YangLeafList implements YangCommonInfo, Parsable {
+public class YangLeafList
+        implements YangCommonInfo, Parsable {
 
     /**
      * Name of leaf-list.
@@ -132,7 +134,7 @@
      *
      * @return the leaf-list name
      */
-    public String getLeafName() {
+    public String getName() {
         return name;
     }
 
@@ -311,7 +313,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
 
     }
@@ -322,7 +325,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    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/YangList.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
index f743f42..e82132f 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
@@ -541,7 +541,7 @@
          */
         for (String key : keys) {
             for (YangLeaf leaf : leaves) {
-                if (key.equals(leaf.getLeafName())) {
+                if (key.equals(leaf.getName())) {
                     if (leaf.getDataType().getDataType() == YangDataTypes.EMPTY) {
                         throw new DataModelException(" A leaf that is part of the key must not be the built-in " +
                                 "type \"empty\".");
@@ -586,7 +586,7 @@
          */
         for (String key : keys) {
             for (YangLeafList leafList : leafLists) {
-                if (key.equals(leafList.getLeafName())) {
+                if (key.equals(leafList.getName())) {
                     if (leafList.getDataType().getDataType() == YangDataTypes.EMPTY) {
                         throw new DataModelException(" A leaf-list that is part of the key must not be the built-in " +
                                 "type \"empty\".");
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
index c902389..f737e32 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
@@ -17,6 +17,7 @@
 
 import java.util.LinkedList;
 import java.util.List;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.parser.Parsable;
 import org.onosproject.yangutils.utils.YangConstructType;
@@ -68,8 +69,8 @@
  * Represents data model node to maintain information defined in YANG module.
  */
 public class YangModule extends YangNode
-        implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, HasResolutionInfo,
-        HasRpcNotification {
+        implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, YangReferenceResolver,
+        RpcNotificationContainer {
 
     /**
      * Name of the module.
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java
index ae29433..811c76e 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java
@@ -234,8 +234,10 @@
      * Clone the current node contents and create a new node.
      *
      * @return cloned node
-     * @throws CloneNotSupportedException clone is not supported by the referred node
+     * @throws CloneNotSupportedException clone is not supported by the referred
+     *             node
      */
+    @Override
     public YangNode clone()
             throws CloneNotSupportedException {
         YangNode clonedNode = (YangNode) super.clone();
@@ -247,8 +249,9 @@
     }
 
     /**
-     * Clone the subtree from the specified source node to the mentioned target node.
-     * The source and target root node cloning is carried out by the caller.
+     * Clone the subtree from the specified source node to the mentioned target
+     * node. The source and target root node cloning is carried out by the
+     * caller.
      *
      * @param srcRootNode source node for sub tree cloning
      * @param dstRootNode destination node where the sub tree needs to be cloned
@@ -260,7 +263,6 @@
         YangNode nextNodeToClone = srcRootNode;
         TraversalType curTraversal;
 
-
         YangNode clonedTreeCurNode = dstRootNode;
         YangNode newNode = null;
 
@@ -286,6 +288,7 @@
                     newNode = nextNodeToClone.clone();
                     detectCollisionWhileCloning(clonedTreeCurNode, newNode, curTraversal);
                 }
+
                 if (curTraversal == CHILD) {
 
                     /**
@@ -294,7 +297,8 @@
                     clonedTreeCurNode.addChild(newNode);
 
                     /**
-                     * update the cloned tree's travesal current node as the new node.
+                     * update the cloned tree's traversal current node as the
+                     * new node.
                      */
                     clonedTreeCurNode = newNode;
                 } else if (curTraversal == SIBILING) {
@@ -339,8 +343,8 @@
      */
     private static void detectCollisionWhileCloning(YangNode currentNode, YangNode newNode, TraversalType addAs)
             throws DataModelException {
-        if ((!(currentNode instanceof CollisionDetector))
-                || (!(newNode instanceof Parsable))) {
+        if (!(currentNode instanceof CollisionDetector)
+                || !(newNode instanceof Parsable)) {
             throw new DataModelException("Node in data model tree does not support collision detection");
         }
 
@@ -376,9 +380,10 @@
 
         if (newSibling.getParent() == null) {
             /**
-             * Since the siblings needs to have a common parent, set the parent as the current node's parent
+             * Since the siblings needs to have a common parent, set the parent
+             * as the current node's parent
              */
-            newSibling.setParent(this.getParent());
+            newSibling.setParent(getParent());
 
         } else {
             throw new DataModelException("Node is already part of a tree, and cannot be added as a sibling");
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasResolutionInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangReferenceResolver.java
similarity index 98%
rename from utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasResolutionInfo.java
rename to utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangReferenceResolver.java
index 4e786ff..e9ae54d 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasResolutionInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangReferenceResolver.java
@@ -23,7 +23,7 @@
  * Abstraction of YANG dependency resolution information. Abstracted to obtain the
  * resolution information.
  */
-public interface HasResolutionInfo {
+public interface YangReferenceResolver {
 
     /**
      * Returns unresolved resolution list.
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java
index 9db0469..d762151 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java
@@ -17,6 +17,7 @@
 
 import java.util.LinkedList;
 import java.util.List;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.parser.Parsable;
 import org.onosproject.yangutils.utils.YangConstructType;
@@ -76,8 +77,8 @@
  * Represents data model node to maintain information defined in YANG sub-module.
  */
 public class YangSubModule extends YangNode
-        implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, HasResolutionInfo,
-        HasRpcNotification {
+        implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, YangReferenceResolver,
+        RpcNotificationContainer {
 
     /**
      * Name of sub module.
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasType.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangTypeContainer.java
similarity index 95%
rename from utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasType.java
rename to utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangTypeContainer.java
index e7a5c73..c22bfc0 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasType.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangTypeContainer.java
@@ -21,7 +21,7 @@
 /**
  * Represents the holder with type(s).
  */
-public interface HasType {
+public interface YangTypeContainer {
 
     /**
      * Returns type list.
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
index 49eafff..2eac613 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
@@ -54,7 +54,7 @@
 /**
  * Represents data model node to maintain information defined in YANG typedef.
  */
-public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable, HasType {
+public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable, YangTypeContainer {
 
     /**
      * Default value in string, needs to be converted to the target object,
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUnion.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUnion.java
index eb0e34d..038cf38 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUnion.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUnion.java
@@ -47,7 +47,7 @@
 /**
  * Represents data model node to maintain information defined in YANG union.
  */
-public class YangUnion extends YangNode implements Parsable, HasType {
+public class YangUnion extends YangNode implements Parsable, YangTypeContainer {
 
     // List of YANG type.
     private List<YangType<?>> typeList;
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java
index 16f45c4..55fbaf4 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java
@@ -276,14 +276,14 @@
         YangLeavesHolder usesParentLeavesHolder = (YangLeavesHolder) usesParentNode;
         if (referredGrouping.getListOfLeaf() != null) {
             for (YangLeaf leaf : referredGrouping.getListOfLeaf()) {
-                ((CollisionDetector) usesParentLeavesHolder).detectCollidingChild(leaf.getLeafName(),
+                ((CollisionDetector) usesParentLeavesHolder).detectCollidingChild(leaf.getName(),
                         YangConstructType.LEAF_DATA);
                 usesParentLeavesHolder.addLeaf(leaf);
             }
         }
         if (referredGrouping.getListOfLeafList() != null) {
             for (YangLeafList leafList : referredGrouping.getListOfLeafList()) {
-                ((CollisionDetector) usesParentLeavesHolder).detectCollidingChild(leafList.getLeafName(),
+                ((CollisionDetector) usesParentLeavesHolder).detectCollidingChild(leafList.getName(),
                         YangConstructType.LEAF_LIST_DATA);
                 usesParentLeavesHolder.addLeafList(leafList);
             }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java
index e848299..928e87b 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java
@@ -19,7 +19,7 @@
 import java.util.List;
 
 import org.onosproject.yangutils.datamodel.CollisionDetector;
-import org.onosproject.yangutils.datamodel.HasResolutionInfo;
+import org.onosproject.yangutils.datamodel.YangReferenceResolver;
 import org.onosproject.yangutils.datamodel.YangImport;
 import org.onosproject.yangutils.datamodel.YangLeaf;
 import org.onosproject.yangutils.datamodel.YangLeafList;
@@ -112,9 +112,9 @@
             return;
         }
         for (YangLeaf leaf : listOfLeaf) {
-            if (leaf.getLeafName().equals(identifierName)) {
+            if (leaf.getName().equals(identifierName)) {
                 throw new DataModelException("YANG file error: Duplicate input identifier detected, same as leaf \""
-                        + leaf.getLeafName() + "\"");
+                        + leaf.getName() + "\"");
             }
         }
     }
@@ -133,10 +133,10 @@
         if (listOfLeafList == null) {
             return;
         }
-       for (YangLeafList leafList : listOfLeafList) {
-            if (leafList.getLeafName().equals(identifierName)) {
+        for (YangLeafList leafList : listOfLeafList) {
+            if (leafList.getName().equals(identifierName)) {
                 throw new DataModelException("YANG file error: Duplicate input identifier detected, same as leaf " +
-                        "list \"" + leafList.getLeafName() + "\"");
+                        "list \"" + leafList.getName() + "\"");
             }
         }
     }
@@ -154,13 +154,13 @@
         /* get the module node to add maintain the list of nested reference */
         YangNode curNode = resolutionInfo.getEntityToResolveInfo()
                 .getHolderOfEntityToResolve();
-        while (!(curNode instanceof HasResolutionInfo)) {
+        while (!(curNode instanceof YangReferenceResolver)) {
             curNode = curNode.getParent();
             if (curNode == null) {
                 throw new DataModelException("Internal datamodel error: Datamodel tree is not correct");
             }
         }
-        HasResolutionInfo resolutionNode = (HasResolutionInfo) curNode;
+        YangReferenceResolver resolutionNode = (YangReferenceResolver) curNode;
 
         if (!isPrefixValid(resolutionInfo.getEntityToResolveInfo().getEntityPrefix(),
                 resolutionNode)) {
@@ -176,7 +176,7 @@
      * @param resolutionNode uses/type node which has the prefix with it
      * @return whether prefix is valid or not
      */
-    private static boolean isPrefixValid(String entityPrefix, HasResolutionInfo resolutionNode) {
+    private static boolean isPrefixValid(String entityPrefix, YangReferenceResolver resolutionNode) {
         if (entityPrefix == null) {
             return true;
         }
@@ -215,7 +215,7 @@
      * @throws DataModelException a violation of data model rules
      */
     public static void resolveLinkingForResolutionList(List<YangResolutionInfo> resolutionList,
-            HasResolutionInfo dataModelRootNode)
+            YangReferenceResolver dataModelRootNode)
             throws DataModelException {
 
         for (YangResolutionInfo resolutionInfo : resolutionList) {
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/YangDataModelFactory.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/YangDataModelFactory.java
index 686360e..aff53c4 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/YangDataModelFactory.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/YangDataModelFactory.java
@@ -20,38 +20,42 @@
 import org.onosproject.yangutils.datamodel.YangChoice;
 import org.onosproject.yangutils.datamodel.YangContainer;
 import org.onosproject.yangutils.datamodel.YangGrouping;
+import org.onosproject.yangutils.datamodel.YangInput;
 import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangLeafList;
 import org.onosproject.yangutils.datamodel.YangList;
 import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNotification;
+import org.onosproject.yangutils.datamodel.YangOutput;
+import org.onosproject.yangutils.datamodel.YangRpc;
 import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.YangType;
 import org.onosproject.yangutils.datamodel.YangTypeDef;
 import org.onosproject.yangutils.datamodel.YangUnion;
 import org.onosproject.yangutils.datamodel.YangUses;
-import org.onosproject.yangutils.datamodel.YangNotification;
-import org.onosproject.yangutils.datamodel.YangRpc;
-import org.onosproject.yangutils.datamodel.YangInput;
-import org.onosproject.yangutils.datamodel.YangOutput;
+import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaAugment;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaCase;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaChoice;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaContainer;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaGrouping;
+import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaInput;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaLeaf;
+import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaLeafList;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaList;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
+import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaNotification;
+import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaOutput;
+import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaRpc;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule;
+import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaType;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeDef;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaUnion;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaUses;
-import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaNotification;
-import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaRpc;
-import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaInput;
-import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaOutput;
-import org.onosproject.yangutils.translator.exception.TranslatorException;
 
 /**
- *Represents factory to create data model objects based on the target file type.
+ * Represents factory to create data model objects based on the target file type.
  */
 public final class YangDataModelFactory {
 
@@ -65,7 +69,7 @@
      * Based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangModule getYangModuleNode(GeneratedLanguage targetLanguage) {
@@ -83,7 +87,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangAugment getYangAugmentNode(GeneratedLanguage targetLanguage) {
@@ -101,7 +105,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangCase getYangCaseNode(GeneratedLanguage targetLanguage) {
@@ -119,7 +123,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangChoice getYangChoiceNode(GeneratedLanguage targetLanguage) {
@@ -137,7 +141,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangContainer getYangContainerNode(GeneratedLanguage targetLanguage) {
@@ -155,7 +159,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangGrouping getYangGroupingNode(GeneratedLanguage targetLanguage) {
@@ -173,7 +177,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangList getYangListNode(GeneratedLanguage targetLanguage) {
@@ -191,7 +195,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangSubModule getYangSubModuleNode(GeneratedLanguage targetLanguage) {
@@ -209,7 +213,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangTypeDef getYangTypeDefNode(GeneratedLanguage targetLanguage) {
@@ -227,7 +231,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *                       generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangUnion getYangUnionNode(GeneratedLanguage targetLanguage) {
@@ -245,7 +249,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *                       generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangUses getYangUsesNode(GeneratedLanguage targetLanguage) {
@@ -263,7 +267,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangNotification getYangNotificationNode(GeneratedLanguage targetLanguage) {
@@ -281,7 +285,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangLeaf getYangLeaf(GeneratedLanguage targetLanguage) {
@@ -294,11 +298,30 @@
             }
         }
     }
+
     /**
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
+     * @return the corresponding inherited node based on the target language
+     */
+    public static YangLeafList getYangLeafList(GeneratedLanguage targetLanguage) {
+        switch (targetLanguage) {
+            case JAVA_GENERATION: {
+                return new YangJavaLeafList();
+            }
+            default: {
+                throw new RuntimeException("Only YANG to Java is supported.");
+            }
+        }
+    }
+
+    /**
+     * Returns based on the target language generate the inherited data model node.
+     *
+     * @param targetLanguage target language in which YANG mapping needs to be
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangRpc getYangRpcNode(GeneratedLanguage targetLanguage) {
@@ -316,7 +339,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangInput getYangInputNode(GeneratedLanguage targetLanguage) {
@@ -334,7 +357,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangOutput getYangOutputNode(GeneratedLanguage targetLanguage) {
@@ -352,7 +375,7 @@
      * Returns based on the target language generate the inherited data model node.
      *
      * @param targetLanguage target language in which YANG mapping needs to be
-     *            generated
+     * generated
      * @return the corresponding inherited node based on the target language
      */
     public static YangJavaEnumeration getYangEnumerationNode(GeneratedLanguage targetLanguage) {
@@ -365,4 +388,21 @@
             }
         }
     }
+    /**
+     * Returns based on the target language generate the inherited data model node.
+     *
+     * @param targetLanguage target language in which YANG mapping needs to be
+     * generated
+     * @return the corresponding inherited node based on the target language
+     */
+    public static YangType getYangType(GeneratedLanguage targetLanguage) {
+        switch (targetLanguage) {
+            case JAVA_GENERATION: {
+                return new YangJavaType();
+            }
+            default: {
+                throw new RuntimeException("Only YANG to Java is supported.");
+            }
+        }
+    }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/YangLinker.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/YangLinker.java
index 5d38c9b..f659fa9 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/YangLinker.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/YangLinker.java
@@ -17,7 +17,7 @@
 package org.onosproject.yangutils.linker;
 
 import java.util.Map;
-import org.onosproject.yangutils.datamodel.HasResolutionInfo;
+import org.onosproject.yangutils.datamodel.YangReferenceResolver;
 
 /**
  * Abstraction of entity which provides linking service of YANG files.
@@ -30,6 +30,6 @@
      *
      * @param fileMapEntry map entry for which resolution is to be done
      * @param yangFilesMap map of dependent file and resolution information*/
-    void resolveDependencies(Map.Entry<String, HasResolutionInfo> fileMapEntry, Map<String,
-            HasResolutionInfo> yangFilesMap);
+    void resolveDependencies(Map.Entry<String, YangReferenceResolver> fileMapEntry, Map<String,
+            YangReferenceResolver> yangFilesMap);
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/TreeWalkListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/TreeWalkListener.java
index c1c84a1..5c03e54 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/TreeWalkListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/TreeWalkListener.java
@@ -52,8 +52,8 @@
 import org.onosproject.yangutils.parser.impl.listeners.MaxElementsListener;
 import org.onosproject.yangutils.parser.impl.listeners.MinElementsListener;
 import org.onosproject.yangutils.parser.impl.listeners.ModuleListener;
-import org.onosproject.yangutils.parser.impl.listeners.NamespaceListener;
 import org.onosproject.yangutils.parser.impl.listeners.NotificationListener;
+import org.onosproject.yangutils.parser.impl.listeners.NamespaceListener;
 import org.onosproject.yangutils.parser.impl.listeners.OrganizationListener;
 import org.onosproject.yangutils.parser.impl.listeners.OutputListener;
 import org.onosproject.yangutils.parser.impl.listeners.PatternRestrictionListener;
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java
index 0501806..07dba80 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java
@@ -96,10 +96,10 @@
 
             switch (tmpData.getYangConstructType()) {
                 case LEAF_DATA:
-                    bitsNode.setBitsName(((YangLeaf) tmpData).getLeafName());
+                    bitsNode.setBitsName(((YangLeaf) tmpData).getName());
                     break;
                 case LEAF_LIST_DATA:
-                    bitsNode.setBitsName(((YangLeafList) tmpData).getLeafName());
+                    bitsNode.setBitsName(((YangLeafList) tmpData).getName());
                     break;
                 // TODO typedef, union, deviate.
                 default:
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java
index e822c14..97efebb 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java
@@ -112,7 +112,7 @@
             switch (tmpData.getYangConstructType()) {
                 case LEAF_DATA:
                     // Set the name of enumeration same as leaf.
-                    enumerationNode.setName(((YangLeaf) tmpData).getLeafName() + ENUMERATION_CLASS_SUFFIX);
+                    enumerationNode.setName(((YangLeaf) tmpData).getName() + ENUMERATION_CLASS_SUFFIX);
                     // Pop the stack entry to obtain the parent YANG node.
                     Parsable leaf = listener.getParsedDataStack().pop();
                     // Add the enumeration node to the parent holder of leaf.
@@ -122,7 +122,7 @@
                     break;
                 case LEAF_LIST_DATA:
                     // Set the name of enumeration same as leaf list.
-                    enumerationNode.setName(((YangLeafList) tmpData).getLeafName() + ENUMERATION_CLASS_SUFFIX);
+                    enumerationNode.setName(((YangLeafList) tmpData).getName() + ENUMERATION_CLASS_SUFFIX);
                     // Pop the stack entry to obtain the parent YANG node.
                     Parsable leafList = listener.getParsedDataStack().pop();
                     // Add the enumeration node to the parent holder of leaf.
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListener.java
index 67dacbb..c81e554 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListener.java
@@ -46,10 +46,12 @@
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateMutuallyExclusiveChilds;
 import static org.onosproject.yangutils.utils.YangConstructType.DESCRIPTION_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.GROUPING_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.REFERENCE_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.utils.YangConstructType.TYPEDEF_DATA;
 
 /*
  * Reference: RFC6020 and YANG ANTLR Grammar
@@ -166,5 +168,7 @@
         validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA, GROUPING_DATA,
                 ctx.identifier().getText());
         validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, GROUPING_DATA, ctx.identifier().getText());
+        validateMutuallyExclusiveChilds(ctx.typedefStatement(), TYPEDEF_DATA, ctx.groupingStatement(), GROUPING_DATA,
+                GROUPING_DATA, ctx.identifier().getText());
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/InputListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/InputListener.java
index 78a5153..ecd8c4d 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/InputListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/InputListener.java
@@ -29,15 +29,15 @@
 import static org.onosproject.yangutils.datamodel.utils.YangDataModelFactory.getYangInputNode;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityNonZero;
-import static org.onosproject.yangutils.utils.YangConstructType.DATA_DEF_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.INPUT_DATA;
 
 /*
@@ -80,17 +80,14 @@
      * (input), performs validation and updates the data model tree.
      *
      * @param listener listener's object
-     * @param ctx      context object of the grammar rule
+     * @param ctx context object of the grammar rule
      */
     public static void processInputEntry(TreeWalkListener listener,
-                                         GeneratedYangParser.InputStatementContext ctx) {
+            GeneratedYangParser.InputStatementContext ctx) {
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, INPUT_DATA, "", ENTRY);
 
-        validateCardinalityNonZero(ctx.dataDefStatement(), DATA_DEF_DATA,
-                INPUT_DATA, "", ctx);
-
         Parsable curData = listener.getParsedDataStack().peek();
         if (curData instanceof YangRpc) {
 
@@ -115,10 +112,10 @@
      * validations and updates the data model tree.
      *
      * @param listener listener's object
-     * @param ctx      context object of the grammar rule
+     * @param ctx context object of the grammar rule
      */
     public static void processInputExit(TreeWalkListener listener,
-                                        GeneratedYangParser.InputStatementContext ctx) {
+            GeneratedYangParser.InputStatementContext ctx) {
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, INPUT_DATA, "", EXIT);
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java
index 6b5afe3..4a2481a 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java
@@ -23,10 +23,13 @@
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
 
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangDataModelFactory.getYangLeafList;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
@@ -106,7 +109,7 @@
         int charPositionInLine = ctx.getStart().getCharPositionInLine();
         detectCollidingChildUtil(listener, line, charPositionInLine, identifier, LEAF_LIST_DATA);
 
-        YangLeafList leafList = new YangLeafList();
+        YangLeafList leafList = getYangLeafList(JAVA_GENERATION);
         leafList.setLeafName(identifier);
 
         Parsable tmpData = listener.getParsedDataStack().peek();
@@ -117,7 +120,7 @@
             leaves.addLeafList(leafList);
         } else {
             throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LEAF_LIST_DATA,
-                            ctx.identifier().getText(), ENTRY));
+                    ctx.identifier().getText(), ENTRY));
         }
         listener.getParsedDataStack().push(leafList);
     }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
index 2cb6187..fd1bd84 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
@@ -16,7 +16,7 @@
 
 package org.onosproject.yangutils.parser.impl.listeners;
 
-import org.onosproject.yangutils.datamodel.HasResolutionInfo;
+import org.onosproject.yangutils.datamodel.YangReferenceResolver;
 import org.onosproject.yangutils.datamodel.YangModule;
 import org.onosproject.yangutils.datamodel.YangRevision;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
@@ -116,7 +116,7 @@
                     ctx.identifier().getText(), EXIT));
         }
         try {
-            ((HasResolutionInfo) listener.getParsedDataStack().peek()).resolveSelfFileLinking();
+            ((YangReferenceResolver) listener.getParsedDataStack().peek()).resolveSelfFileLinking();
         } catch (DataModelException e) {
             ParserException parserException = new ParserException(e.getMessage());
             parserException.setLine(e.getLineNumber());
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListener.java
index 1bd7390..58daefb 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListener.java
@@ -40,10 +40,13 @@
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateMutuallyExclusiveChilds;
 import static org.onosproject.yangutils.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.utils.YangConstructType.GROUPING_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.NOTIFICATION_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.REFERENCE_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.utils.YangConstructType.TYPEDEF_DATA;
 
 /*
  * Reference: RFC6020 and YANG ANTLR Grammar
@@ -156,5 +159,7 @@
                 ctx.identifier().getText());
         validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, NOTIFICATION_DATA,
                 ctx.identifier().getText());
+        validateMutuallyExclusiveChilds(ctx.typedefStatement(), TYPEDEF_DATA, ctx.groupingStatement(), GROUPING_DATA,
+                NOTIFICATION_DATA, ctx.identifier().getText());
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OutputListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OutputListener.java
index 83fec50..f1cde72 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OutputListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OutputListener.java
@@ -29,15 +29,15 @@
 import static org.onosproject.yangutils.datamodel.utils.YangDataModelFactory.getYangOutputNode;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityNonZero;
-import static org.onosproject.yangutils.utils.YangConstructType.DATA_DEF_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.OUTPUT_DATA;
 
 /*
@@ -80,17 +80,14 @@
      * (output), performs validation and updates the data model tree.
      *
      * @param listener listener's object
-     * @param ctx      context object of the grammar rule
+     * @param ctx context object of the grammar rule
      */
     public static void processOutputEntry(TreeWalkListener listener,
-                                          GeneratedYangParser.OutputStatementContext ctx) {
+            GeneratedYangParser.OutputStatementContext ctx) {
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, OUTPUT_DATA, "", ENTRY);
 
-        validateCardinalityNonZero(ctx.dataDefStatement(), DATA_DEF_DATA,
-                OUTPUT_DATA, "", ctx);
-
         Parsable curData = listener.getParsedDataStack().peek();
         if (curData instanceof YangRpc) {
 
@@ -115,10 +112,10 @@
      * validations and updates the data model tree.
      *
      * @param listener listener's object
-     * @param ctx      context object of the grammar rule
+     * @param ctx context object of the grammar rule
      */
     public static void processOutputExit(TreeWalkListener listener,
-                                         GeneratedYangParser.OutputStatementContext ctx) {
+            GeneratedYangParser.OutputStatementContext ctx) {
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, OUTPUT_DATA, "", EXIT);
@@ -129,4 +126,4 @@
         }
         listener.getParsedDataStack().pop();
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RpcListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RpcListener.java
index b440289..ae9e04c 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RpcListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RpcListener.java
@@ -37,9 +37,12 @@
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateMutuallyExclusiveChilds;
 import static org.onosproject.yangutils.utils.YangConstructType.RPC_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.INPUT_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.OUTPUT_DATA;
+import static org.onosproject.yangutils.utils.YangConstructType.TYPEDEF_DATA;
+import static org.onosproject.yangutils.utils.YangConstructType.GROUPING_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.STATUS_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.REFERENCE_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.DESCRIPTION_DATA;
@@ -154,6 +157,8 @@
         validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, RPC_DATA, ctx.identifier().getText());
         validateCardinalityMaxOne(ctx.inputStatement(), INPUT_DATA, RPC_DATA, ctx.identifier().getText());
         validateCardinalityMaxOne(ctx.outputStatement(), OUTPUT_DATA, RPC_DATA, ctx.identifier().getText());
+        validateMutuallyExclusiveChilds(ctx.typedefStatement(), TYPEDEF_DATA, ctx.groupingStatement(), GROUPING_DATA,
+                RPC_DATA, ctx.identifier().getText());
     }
 
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
index d20f90a..cfaa15f 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
@@ -16,7 +16,7 @@
 
 package org.onosproject.yangutils.parser.impl.listeners;
 
-import org.onosproject.yangutils.datamodel.HasResolutionInfo;
+import org.onosproject.yangutils.datamodel.YangReferenceResolver;
 import org.onosproject.yangutils.datamodel.YangRevision;
 import org.onosproject.yangutils.datamodel.YangSubModule;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
@@ -121,7 +121,7 @@
                     ctx.identifier().getText(), EXIT));
         }
         try {
-            ((HasResolutionInfo) listener.getParsedDataStack().peek()).resolveSelfFileLinking();
+            ((YangReferenceResolver) listener.getParsedDataStack().peek()).resolveSelfFileLinking();
         } catch (DataModelException e) {
             ParserException parserException = new ParserException(e.getMessage());
             parserException.setLine(e.getLineNumber());
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
index e93001e..e5b098b 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
@@ -34,6 +34,8 @@
 
 import static org.onosproject.yangutils.datamodel.ResolvableStatus.UNRESOLVED;
 import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangDataModelFactory.getYangType;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
@@ -95,7 +97,7 @@
         YangDataTypes yangDataTypes = YangDataTypes.getType(ctx.string().getText());
 
         // Create YANG type object and fill the values.
-        YangType<?> type = new YangType();
+        YangType<?> type = getYangType(JAVA_GENERATION);
         type.setNodeIdentifier(nodeIdentifier);
         type.setDataType(yangDataTypes);
 
@@ -253,7 +255,7 @@
      * @param ctx context object of the grammar rule
      */
     private static void addToResolutionList(YangResolutionInfo<YangType> resolutionInfo,
-                                            GeneratedYangParser.TypeStatementContext ctx) {
+            GeneratedYangParser.TypeStatementContext ctx) {
         try {
             addResolutionInfo(resolutionInfo);
         } catch (DataModelException e) {
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java
index 1d2a698..2a78eec 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java
@@ -108,7 +108,7 @@
             switch (tmpData.getYangConstructType()) {
                 case LEAF_DATA:
                     // Set the name of union same as leaf.
-                    unionNode.setName(((YangLeaf) tmpData).getLeafName() + UNION_CLASS_SUFFIX);
+                    unionNode.setName(((YangLeaf) tmpData).getName() + UNION_CLASS_SUFFIX);
                     // Pop the stack entry to obtain the parent YANG node.
                     Parsable leaf = listener.getParsedDataStack().pop();
                     // Add the union node to the parent holder of leaf.
@@ -118,7 +118,7 @@
                     break;
                 case LEAF_LIST_DATA:
                     // Set the name of union same as leaf list.
-                    unionNode.setName(((YangLeafList) tmpData).getLeafName() + UNION_CLASS_SUFFIX);
+                    unionNode.setName(((YangLeafList) tmpData).getName() + UNION_CLASS_SUFFIX);
                     // Pop the stack entry to obtain the parent YANG node.
                     Parsable leafList = listener.getParsedDataStack().pop();
                     // Add the union node to the parent holder of leaf.
@@ -217,4 +217,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/GeneratedJavaFileType.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/GeneratedJavaFileType.java
index c112ce0..1b3c7e0 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/GeneratedJavaFileType.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/GeneratedJavaFileType.java
@@ -44,7 +44,8 @@
     /**
      * Interface and class file.
      */
-    public static final int GENERATE_INTERFACE_WITH_BUILDER = 15;
+    public static final int GENERATE_INTERFACE_WITH_BUILDER = INTERFACE_MASK
+            | BUILDER_INTERFACE_MASK | BUILDER_CLASS_MASK | IMPL_CLASS_MASK;
 
     /**
      * Java interface corresponding to rpc.
@@ -54,24 +55,31 @@
     /**
      * Interface, class file and rpc.
      */
-    public static final int GENERATE_MANAGER_WITH_RPC = 31;
+    public static final int GENERATE_MANAGER_WITH_RPC = GENERATE_INTERFACE_WITH_BUILDER
+            | GENERATE_RPC_INTERFACE;
 
     // TODO RPC implementation to be integrated with notification.
 
     /**
      * Java class corresponding to YANG enumeration.
      */
-    public static final int GENERATE_ENUM_CLASS = 64;
+    public static final int GENERATE_ENUM_CLASS = 32;
 
     /**
      * Java class corresponding to typedef.
      */
-    public static final int GENERATE_TYPEDEF_CLASS = 1024;
+    public static final int GENERATE_TYPEDEF_CLASS = 64;
 
     /**
      * Java class corresponding to union.
      */
-    public static final int GENERATE_UNION_CLASS = 2048;
+    public static final int GENERATE_UNION_CLASS = 128;
+
+    /**
+     * Java class corresponding to typedef.
+     */
+    public static final int GENERATE_TYPE_CLASS = GENERATE_TYPEDEF_CLASS
+            | GENERATE_UNION_CLASS;
 
     /**
      * Creates an instance of generate java file type.
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaAttributeInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaAttributeInfo.java
index f50f84a..485878b 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaAttributeInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaAttributeInfo.java
@@ -16,16 +16,9 @@
 
 package org.onosproject.yangutils.translator.tojava;
 
-import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.datamodel.YangType;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 
-import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getIsQualifiedAccessOrAddToImportList;
-import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedInfoOfFromString;
-import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfAttribute;
-import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
-
 /**
  * Represents the attribute info corresponding to class/interface generated.
  */
@@ -44,12 +37,12 @@
     /**
      * If the added attribute is a list of info.
      */
-    private boolean isListAttr = false;
+    private boolean isListAttr;
 
     /**
      * If the added attribute has to be accessed in a fully qualified manner.
      */
-    private boolean isQualifiedName = false;
+    private boolean isQualifiedName;
 
     /**
      * The class info will be used to set the attribute type and package info
@@ -66,9 +59,9 @@
     /**
      * Creates object of java attribute info.
      *
-     * @param attrType        YANG type
-     * @param name            attribute name
-     * @param isListAttr      is list attribute
+     * @param attrType YANG type
+     * @param name attribute name
+     * @param isListAttr is list attribute
      * @param isQualifiedName is qualified name
      */
     public JavaAttributeInfo(YangType<?> attrType, String name, boolean isListAttr, boolean isQualifiedName) {
@@ -79,75 +72,6 @@
     }
 
     /**
-     * Creates an attribute info object corresponding to the passed type's attribute
-     * information and return it.
-     *
-     * @param curNode               current data model node for which the java file is being generated
-     * @param referredTypesAttrInfo attribute of referred type
-     * @return JavaAttributeInfo attribute details required to add in temporary files
-     */
-    public static JavaAttributeInfo getFromStringAttributeInfo(YangNode curNode,
-                                                               JavaAttributeInfo referredTypesAttrInfo) {
-
-        JavaQualifiedTypeInfo qualifiedInfoOfFromString = getQualifiedInfoOfFromString(referredTypesAttrInfo);
-        /*
-         * Create a new java attribute info with qualified information of
-         * wrapper classes.
-         */
-        return getAttributeInfoForTheData(qualifiedInfoOfFromString, referredTypesAttrInfo.getAttributeName(),
-                referredTypesAttrInfo.getAttributeType(), curNode, false);
-    }
-
-    /**
-     * Creates an attribute info object corresponding to the passed type attribute
-     * information and return it.
-     *
-     * @param curNode         current data model node for which the java file is being
-     *                        generated
-     * @param attributeType   leaf data type
-     * @param attributeName   leaf name
-     * @param isListAttribute is the current added attribute needs to be a list
-     * @return AttributeInfo attribute details required to add in temporary
-     * files
-     */
-    public static JavaAttributeInfo getAttributeInfoOfType(YangNode curNode,
-                                                           YangType<?> attributeType, String attributeName,
-                                                           boolean isListAttribute) {
-        /*
-         * Get the import info corresponding to the attribute for import in
-         * generated java files or qualified access
-         */
-        JavaQualifiedTypeInfo importInfo = getQualifiedTypeInfoOfAttribute(curNode,
-                attributeType, attributeName, isListAttribute);
-
-        return getAttributeInfoForTheData(importInfo, attributeName, attributeType, curNode, isListAttribute);
-    }
-
-    /**
-     * Creates an attribute info object corresponding to the passed enumeration attribute
-     * information and return it.
-     *
-     * @param curNode       current data model node for which the java file is being
-     *                      generated
-     * @param attributeName attribute name
-     * @return AttributeInfo attribute details required to add in temporary
-     * files
-     */
-    public static JavaAttributeInfo getAttributeInfoOfEnumAttribute(YangNode curNode, String attributeName) {
-
-        String curNodeName = ((HasJavaFileInfo) curNode).getJavaFileInfo().getJavaName();
-
-        /*
-         * Get the import info corresponding to the attribute for import in
-         * generated java files or qualified access
-         */
-        JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode,
-                curNodeName, false);
-
-        return getAttributeInfoForTheData(qualifiedTypeInfo, attributeName, null, curNode, false);
-    }
-
-    /**
      * Returns the data type info of attribute.
      *
      * @return the data type info of attribute
@@ -225,7 +149,7 @@
      * manner.
      *
      * @param isQualified if the added attribute has to be accessed in a fully
-     *                    qualified manner
+     * qualified manner
      */
     public void setIsQualifiedAccess(boolean isQualified) {
         isQualifiedName = isQualified;
@@ -251,102 +175,25 @@
     }
 
     /**
-     * Creates an attribute info object corresponding to the passed leaf
-     * information and return it.
-     *
-     * @param curNode         current data model node for which the java file is being
-     *                        generated
-     * @param attributeType   leaf data type
-     * @param attributeName   leaf name
-     * @param isListAttribute is the current added attribute needs to be a list
-     * @return AttributeInfo attribute details required to add in temporary
-     * files
-     */
-    public static JavaAttributeInfo getAttributeInfoOfLeaf(YangNode curNode,
-                                                           YangType<?> attributeType, String attributeName,
-                                                           boolean isListAttribute) {
-
-        /*
-         * Get the import info corresponding to the attribute for import in
-         * generated java files or qualified access
-         */
-        JavaQualifiedTypeInfo importInfo = getQualifiedTypeInfoOfAttribute(curNode,
-                attributeType, attributeName, isListAttribute);
-
-        return getAttributeInfoForTheData(importInfo, attributeName, attributeType, curNode, isListAttribute);
-    }
-
-    /**
-     * Creates an attribute info object corresponding to a data model node and
-     * return it.
-     *
-     * @param curNode    current data model node for which the java code generation
-     *                   is being handled
-     * @param parentNode parent node in which the current node is an attribute
-     * @param isListNode is the current added attribute needs to be a list
-     * @return AttributeInfo attribute details required to add in temporary
-     * files
-     */
-    public static JavaAttributeInfo getCurNodeAsAttributeInParent(
-            YangNode curNode, YangNode parentNode, boolean isListNode) {
-
-        String curNodeName = ((HasJavaFileInfo) curNode).getJavaFileInfo().getJavaName();
-
-        /*
-         * Get the import info corresponding to the attribute for import in
-         * generated java files or qualified access
-         */
-        JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(parentNode,
-                curNodeName, isListNode);
-
-        return getAttributeInfoForTheData(qualifiedTypeInfo, curNodeName, null, parentNode, isListNode);
-    }
-
-    /**
-     * Creates an attribute info object corresponding to a data model node and
-     * return it.
-     *
-     * @param parentNode  parent node in which the current node is an attribute
-     * @param isListNode  is the current added attribute needs to be a list
-     * @param curNodeName is the current added attribute needs to be a list
-     * @return AttributeInfo attribute details required to add in temporary
-     * files
-     */
-    public static JavaAttributeInfo getCurNodeAsAttributeInParent(YangNode parentNode, boolean isListNode,
-                                                                  String curNodeName) {
-
-        /*
-         * Get the import info corresponding to the attribute for import in
-         * generated java files or qualified access
-         */
-        JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(parentNode,
-                curNodeName, isListNode);
-
-        return getAttributeInfoForTheData(qualifiedTypeInfo, curNodeName, null, parentNode, isListNode);
-    }
-
-
-    /**
      * Returns java attribute info.
      *
-     * @param importInfo      java qualified type info
-     * @param attributeName   attribute name
-     * @param attributeType   attribute type
-     * @param curNode         current YANG node
+     * @param importInfo java qualified type info
+     * @param attributeName attribute name
+     * @param attributeType attribute type
+     * @param isQualifiedAccess is the attribute a qualified access
      * @param isListAttribute is list attribute
      * @return java attribute info.
      */
-    private static JavaAttributeInfo getAttributeInfoForTheData(JavaQualifiedTypeInfo importInfo, String attributeName,
-                                                                YangType<?> attributeType, YangNode curNode,
-                                                                boolean isListAttribute) {
+    public static JavaAttributeInfo getAttributeInfoForTheData(JavaQualifiedTypeInfo importInfo, String attributeName,
+            YangType<?> attributeType, boolean isQualifiedAccess,
+            boolean isListAttribute) {
 
         JavaAttributeInfo newAttr = new JavaAttributeInfo();
         newAttr.setImportInfo(importInfo);
-        newAttr.setIsQualifiedAccess(getIsQualifiedAccessOrAddToImportList(curNode, importInfo));
-        newAttr.setAttributeName(getCamelCase(attributeName, null));
-        newAttr.setListAttr(isListAttribute);
-        newAttr.setImportInfo(importInfo);
+        newAttr.setAttributeName(attributeName);
         newAttr.setAttributeType(attributeType);
+        newAttr.setIsQualifiedAccess(isQualifiedAccess);
+        newAttr.setListAttr(isListAttribute);
 
         return newAttr;
     }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java
index add5504..6d05ba6 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java
@@ -39,7 +39,7 @@
     private static YangNode curNode;
 
     /**
-     * Creates a java code generator util object.
+     * Creates a java code generator utility object.
      */
     private JavaCodeGeneratorUtil() {
     }
@@ -68,29 +68,30 @@
      * @param rootNode root node of the data model tree
      * @param yangPlugin YANG plugin config
      * @throws IOException when fails to generate java code file the current
-     *             node
+     *                     node
      */
-    public static void generateJavaCode(YangNode rootNode, YangPluginConfig yangPlugin) throws IOException {
+    public static void generateJavaCode(YangNode rootNode, YangPluginConfig yangPlugin)
+            throws IOException {
 
-        YangNode curNode = rootNode;
+        YangNode codeGenNode = rootNode;
         TraversalType curTraversal = ROOT;
 
-        while (curNode != null) {
+        while (codeGenNode != null) {
             if (curTraversal != PARENT) {
-                setCurNode(curNode);
-                generateCodeEntry(curNode, yangPlugin);
+                setCurNode(codeGenNode);
+                generateCodeEntry(codeGenNode, yangPlugin);
             }
-            if (curTraversal != PARENT && curNode.getChild() != null) {
+            if (curTraversal != PARENT && codeGenNode.getChild() != null) {
                 curTraversal = CHILD;
-                curNode = curNode.getChild();
-            } else if (curNode.getNextSibling() != null) {
-                generateCodeExit(curNode);
+                codeGenNode = codeGenNode.getChild();
+            } else if (codeGenNode.getNextSibling() != null) {
+                generateCodeExit(codeGenNode);
                 curTraversal = SIBILING;
-                curNode = curNode.getNextSibling();
+                codeGenNode = codeGenNode.getNextSibling();
             } else {
-                generateCodeExit(curNode);
+                generateCodeExit(codeGenNode);
                 curTraversal = PARENT;
-                curNode = curNode.getParent();
+                codeGenNode = codeGenNode.getParent();
             }
         }
     }
@@ -98,15 +99,16 @@
     /**
      * Generates the current nodes code snippet.
      *
-     * @param curNode current data model node for which the code needs to be
-     *            generated
+     * @param codeGenNode current data model node for which the code needs to be
+     * generated
      * @param yangPlugin YANG plugin config
      * @throws IOException IO operation exception
      */
-    private static void generateCodeEntry(YangNode curNode, YangPluginConfig yangPlugin) throws IOException {
+    private static void generateCodeEntry(YangNode codeGenNode, YangPluginConfig yangPlugin)
+            throws IOException {
 
-        if (curNode instanceof JavaCodeGenerator) {
-            ((JavaCodeGenerator) curNode).generateCodeEntry(yangPlugin);
+        if (codeGenNode instanceof JavaCodeGenerator) {
+            ((JavaCodeGenerator) codeGenNode).generateCodeEntry(yangPlugin);
         } else {
             throw new TranslatorException(
                     "Generated data model node cannot be translated to target language code");
@@ -116,14 +118,15 @@
     /**
      * Generates the current nodes code target code from the snippet.
      *
-     * @param curNode current data model node for which the code needs to be
-     *            generated
+     * @param codeGenNode current data model node for which the code needs to be
+     * generated
      * @throws IOException IO operation exception
      */
-    private static void generateCodeExit(YangNode curNode) throws IOException {
+    private static void generateCodeExit(YangNode codeGenNode)
+            throws IOException {
 
-        if (curNode instanceof JavaCodeGenerator) {
-            ((JavaCodeGenerator) curNode).generateCodeExit();
+        if (codeGenNode instanceof JavaCodeGenerator) {
+            ((JavaCodeGenerator) codeGenNode).generateCodeExit();
         } else {
             throw new TranslatorException(
                     "Generated data model node cannot be translated to target language code");
@@ -131,31 +134,35 @@
     }
 
     /**
-     * Free other YANG nodes of data-model tree when error occurs while file generation of current node.
+     * Free other YANG nodes of data-model tree when error occurs while file
+     * generation of current node.
+     *
+     * @throws DataModelException when fails to do datamodel operations
      */
-    public static void freeRestResources() {
+    private static void freeRestResources()
+            throws DataModelException {
 
-        YangNode curNode = getCurNode();
-        YangNode tempNode = curNode;
+        YangNode freedNode = getCurNode();
+        YangNode tempNode = freedNode;
         TraversalType curTraversal = ROOT;
 
-        while (curNode != tempNode.getParent()) {
+        while (freedNode != tempNode.getParent()) {
 
-            if (curTraversal != PARENT && curNode.getChild() != null) {
+            if (curTraversal != PARENT && freedNode.getChild() != null) {
                 curTraversal = CHILD;
-                curNode = curNode.getChild();
-            } else if (curNode.getNextSibling() != null) {
+                freedNode = freedNode.getChild();
+            } else if (freedNode.getNextSibling() != null) {
                 curTraversal = SIBILING;
-                if (curNode != tempNode) {
-                    free(curNode);
+                if (freedNode != tempNode) {
+                    free(freedNode);
                 }
-                curNode = curNode.getNextSibling();
+                freedNode = freedNode.getNextSibling();
             } else {
                 curTraversal = PARENT;
-                if (curNode != tempNode) {
-                    free(curNode);
+                if (freedNode != tempNode) {
+                    free(freedNode);
                 }
-                curNode = curNode.getParent();
+                freedNode = freedNode.getParent();
             }
         }
     }
@@ -182,10 +189,11 @@
      * Delete Java code files corresponding to the YANG schema.
      *
      * @param rootNode root node of data-model tree
-     * @throws IOException when fails to delete java code file the current node
+     * @throws IOException        when fails to delete java code file the current node
      * @throws DataModelException when fails to do datamodel operations
      */
-    public static void translatorErrorHandler(YangNode rootNode) throws IOException, DataModelException {
+    public static void translatorErrorHandler(YangNode rootNode)
+            throws IOException, DataModelException {
 
         /**
          * Free other resources where translator has failed.
@@ -195,24 +203,24 @@
         /**
          * Start removing all open files.
          */
-        YangNode curNode = rootNode;
-        setCurNode(curNode.getChild());
+        YangNode tempNode = rootNode;
+        setCurNode(tempNode.getChild());
         TraversalType curTraversal = ROOT;
 
-        while (curNode != null) {
+        while (tempNode != null) {
 
             if (curTraversal != PARENT) {
-                close(curNode);
+                close(tempNode);
             }
-            if (curTraversal != PARENT && curNode.getChild() != null) {
+            if (curTraversal != PARENT && tempNode.getChild() != null) {
                 curTraversal = CHILD;
-                curNode = curNode.getChild();
-            } else if (curNode.getNextSibling() != null) {
+                tempNode = tempNode.getChild();
+            } else if (tempNode.getNextSibling() != null) {
                 curTraversal = SIBILING;
-                curNode = curNode.getNextSibling();
+                tempNode = tempNode.getNextSibling();
             } else {
                 curTraversal = PARENT;
-                curNode = curNode.getParent();
+                tempNode = tempNode.getParent();
             }
         }
 
@@ -220,15 +228,17 @@
     }
 
     /**
-     * Closes all the current open file handles of node and delete all generated files.
+     * Closes all the current open file handles of node and delete all generated
+     * files.
      *
-     * @param curNode current YANG node
+     * @param node current YANG node
      * @throws IOException when fails to do IO operations
      */
-    private static void close(YangNode curNode) throws IOException {
+    private static void close(YangNode node)
+            throws IOException {
 
-        if (((HasTempJavaCodeFragmentFiles) curNode).getTempJavaCodeFragmentFiles() != null) {
-            ((HasTempJavaCodeFragmentFiles) curNode).getTempJavaCodeFragmentFiles().close(true);
+        if (((TempJavaCodeFragmentFilesContainer) node).getTempJavaCodeFragmentFiles() != null) {
+            ((TempJavaCodeFragmentFilesContainer) node).getTempJavaCodeFragmentFiles().close(true);
         }
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaFileInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaFileInfoContainer.java
similarity index 96%
rename from utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaFileInfo.java
rename to utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaFileInfoContainer.java
index efd4be8..485df77 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaFileInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaFileInfoContainer.java
@@ -19,7 +19,7 @@
  * Represents data model nodes which are required to generate java classes, need to support
  * java file info.
  */
-public interface HasJavaFileInfo {
+public interface JavaFileInfoContainer {
 
     /**
      * Returns the generated java file information.
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
index 723b937..13eaf5f 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
@@ -19,10 +19,6 @@
 import java.util.List;
 import java.util.SortedSet;
 import java.util.TreeSet;
-import static java.util.Collections.sort;
-
-import org.onosproject.yangutils.datamodel.YangNode;
-import org.onosproject.yangutils.translator.exception.TranslatorException;
 
 import static org.onosproject.yangutils.utils.UtilConstants.ARRAY_LIST;
 import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED_INFO_CLASS_IMPORT_CLASS;
@@ -42,6 +38,8 @@
 import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
 import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN;
 
+import static java.util.Collections.sort;
+
 /**
  * Represents that generated Java file can contain imports.
  */
@@ -112,61 +110,30 @@
      * denote, it is not added to import collection and needs to be accessed in
      * a qualified manner.
      *
-     * @param curNode current data model node
      * @param newImportInfo class/interface info being imported
      * @return status of new addition of class/interface to the import set
      */
-    public boolean addImportInfo(YangNode curNode, JavaQualifiedTypeInfo newImportInfo) {
+    public boolean addImportInfo(JavaQualifiedTypeInfo newImportInfo) {
 
-        if (!(curNode instanceof HasJavaImportData)) {
-            throw new TranslatorException("missing import info in data model node");
-        }
-        for (JavaQualifiedTypeInfo curImportInfo : ((HasJavaImportData) curNode).getJavaImportData().getImportSet()) {
+        for (JavaQualifiedTypeInfo curImportInfo : getImportSet()) {
             if (curImportInfo.getClassInfo()
                     .contentEquals(newImportInfo.getClassInfo())) {
                 return curImportInfo.getPkgInfo()
                         .contentEquals(newImportInfo.getPkgInfo());
             }
         }
-        ((HasJavaImportData) curNode).getJavaImportData().getImportSet().add(newImportInfo);
+
+        getImportSet().add(newImportInfo);
         return true;
     }
 
     /**
      * Returns import for class.
      *
-     * @param attr java attribute info
-     * @return imports for class
-     */
-    public List<String> getImports(JavaAttributeInfo attr) {
-
-        String importString;
-        List<String> imports = new ArrayList<>();
-
-        for (JavaQualifiedTypeInfo importInfo : getImportSet()) {
-            if (!importInfo.getPkgInfo().equals(EMPTY_STRING) && importInfo.getClassInfo() != null
-                    && !importInfo.getPkgInfo().equals(JAVA_LANG)) {
-                importString = IMPORT + importInfo.getPkgInfo() + PERIOD + importInfo.getClassInfo() + SEMI_COLAN
-                        + NEW_LINE;
-
-                imports.add(importString);
-            }
-        }
-
-        if (attr.isListAttr()) {
-            imports.add(getImportForList());
-        }
-
-        sort(imports);
-        return imports;
-    }
-
-    /**
-     * Returns import for class.
-     *
      * @return imports for class
      */
     public List<String> getImports() {
+
         String importString;
         List<String> imports = new ArrayList<>();
 
@@ -180,6 +147,10 @@
             }
         }
 
+        if (isListToImport) {
+            imports.add(getImportForList());
+        }
+
         sort(imports);
         return imports;
     }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaImportData.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportDataContainer.java
similarity index 96%
rename from utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaImportData.java
rename to utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportDataContainer.java
index 7251b7f..e86b468 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaImportData.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportDataContainer.java
@@ -18,7 +18,7 @@
 /**
  * Represents the information of the java import data.
  */
-public interface HasJavaImportData {
+public interface JavaImportDataContainer {
 
     /**
      * Returns the data of java imports to be included in generated file.
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
index 9b0ccca..370e0f6 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
@@ -17,10 +17,12 @@
 package org.onosproject.yangutils.translator.tojava;
 
 import java.util.Objects;
+
 import org.onosproject.yangutils.datamodel.YangNode;
-import org.onosproject.yangutils.datamodel.YangType;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
+import org.onosproject.yangutils.translator.tojava.javamodel.JavaLeafInfoContainer;
 import org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType;
+
 import com.google.common.base.MoreObjects;
 
 import static org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType.getJavaImportClass;
@@ -29,8 +31,8 @@
 /**
  * Represents the information about individual imports in the generated file.
  */
-public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo> {
-
+public class JavaQualifiedTypeInfo
+        implements Comparable<JavaQualifiedTypeInfo> {
     /**
      * Package location where the imported class/interface is defined.
      */
@@ -84,40 +86,31 @@
     }
 
     /**
-     * Returns the import info for an attribute, which needs to be used for code
-     * generation for import or for qualified access.
+     * Updates the leaf's java information.
      *
-     * @param curNode       current data model node for which the java file is being
-     *                      generated
-     * @param attrType      type of attribute being added, it will be null, when the
-     *                      child class is added as an attribute
-     * @param attributeName name of the attribute being added, it will used in
-     *                      import info for child class
-     * @param isListAttr    is the added attribute going to be used as a list
-     * @return return the import info for this attribute
+     * @param leaf leaf whose jave information is being updated
      */
-    public static JavaQualifiedTypeInfo getQualifiedTypeInfoOfAttribute(YangNode curNode,
-                                                                        YangType<?> attrType, String attributeName,
-                                                                        boolean isListAttr) {
+    public static void updateLeavesJavaQualifiedInfo(JavaLeafInfoContainer leaf) {
 
-        JavaQualifiedTypeInfo importInfo = new JavaQualifiedTypeInfo();
+        JavaQualifiedTypeInfo importInfo = leaf.getJavaQualifiedInfo();
 
-        if (attrType == null) {
-            throw new TranslatorException("missing data type of leaf " + attributeName);
+        if (leaf.getDataType() == null) {
+            throw new TranslatorException("missing data type of leaf " + leaf.getName());
         }
 
         /*
          * Current leaves holder is adding a leaf info as a attribute to the
          * current class.
          */
-        String className = getJavaImportClass(attrType, isListAttr);
+        String className = AttributesJavaDataType.getJavaImportClass(leaf.getDataType(), leaf.isLeafList());
         if (className != null) {
             /*
              * Corresponding to the attribute type a class needs to be imported,
              * since it can be a derived type or a usage of wrapper classes.
              */
             importInfo.setClassInfo(className);
-            String classPkg = getJavaImportPackage(attrType, isListAttr, className);
+            String classPkg = AttributesJavaDataType.getJavaImportPackage(leaf.getDataType(),
+                    leaf.isLeafList(), className);
             if (classPkg == null) {
                 throw new TranslatorException("import package cannot be null when the class is used");
             }
@@ -127,32 +120,30 @@
              * The attribute does not need a class to be imported, for example
              * built in java types.
              */
-            String dataTypeName = AttributesJavaDataType.getJavaDataType(attrType);
+            String dataTypeName = AttributesJavaDataType.getJavaDataType(leaf.getDataType());
             if (dataTypeName == null) {
                 throw new TranslatorException("not supported data type");
             }
             importInfo.setClassInfo(dataTypeName);
         }
-        return importInfo;
     }
 
     /**
      * Returns the import info for an attribute, which needs to be used for code
      * generation for import or for qualified access.
      *
-     * @param curNode       current data model node for which the java file is being
-     *                      generated
+     * @param curNode current data model node for which the java file is being
+     * generated
      * @param attributeName name of the attribute being added, it will used in
-     *                      import info for child class
-     * @param isListAttr    is the added attribute going to be used as a list
+     * import info for child class
      * @return return the import info for this attribute
      */
     public static JavaQualifiedTypeInfo getQualifiedTypeInfoOfCurNode(YangNode curNode,
-                                                                      String attributeName, boolean isListAttr) {
+            String attributeName) {
 
         JavaQualifiedTypeInfo importInfo = new JavaQualifiedTypeInfo();
 
-        if (!(curNode instanceof HasJavaFileInfo)) {
+        if (!(curNode instanceof JavaFileInfoContainer)) {
             throw new TranslatorException("missing java file information to get the package details "
                     + "of attribute corresponding to child node");
         }
@@ -162,8 +153,8 @@
          * classes package with current classes name.
          */
         importInfo.setClassInfo(attributeName);
-        importInfo.setPkgInfo((((HasJavaFileInfo) curNode).getJavaFileInfo().getPackage() + "."
-                + ((HasJavaFileInfo) curNode).getJavaFileInfo().getJavaName()).toLowerCase());
+        importInfo.setPkgInfo((((JavaFileInfoContainer) curNode).getJavaFileInfo().getPackage() + "."
+                + ((JavaFileInfoContainer) curNode).getJavaFileInfo().getJavaName()).toLowerCase());
 
         return importInfo;
     }
@@ -187,82 +178,6 @@
         return qualifiedInfoOfFromString;
     }
 
-    /**
-     * Returns if the attribute needs to be accessed in a qualified manner or not,
-     * if it needs to be imported, then the same needs to be done.
-     *
-     * @param curNode    current cache of the data model node for which java file
-     *                   is bing generated
-     * @param importInfo import info for the current attribute being added
-     * @return status of the qualified access to the attribute
-     */
-    public static boolean getIsQualifiedAccessOrAddToImportList(YangNode curNode,
-                                                                JavaQualifiedTypeInfo importInfo) {
-
-        boolean isImportPkgEqualCurNodePkg;
-        if (!(curNode instanceof HasJavaFileInfo)) {
-            throw new TranslatorException("missing java file info for getting the qualified access");
-        }
-        if (importInfo.getClassInfo().contentEquals(
-                ((HasJavaFileInfo) curNode).getJavaFileInfo().getJavaName())) {
-            /*
-             * if the current class name is same as the attribute class name,
-             * then the attribute must be accessed in a qualified manner.
-             */
-            return true;
-        } else if (importInfo.getPkgInfo() != null) {
-            /*
-             * If the attribute type is having the package info, it is contender
-             * for import list and also need to check if it needs to be a
-             * qualified access.
-             */
-            isImportPkgEqualCurNodePkg = isImportPkgEqualCurNodePkg(curNode, importInfo);
-            if (!isImportPkgEqualCurNodePkg) {
-                /*
-                 * If the package of the attribute added is not same as the
-                 * current class package, then it must either be imported for
-                 * access or it must be a qualified access.
-                 */
-                if (!(curNode instanceof HasJavaImportData)) {
-                    /*
-                     * If the current data model node is not supposed to import
-                     * data, then this is a usage issue and needs to be fixed.
-                     */
-                    throw new TranslatorException("Current node needs to support Imports");
-                }
-
-                boolean isImportAdded = ((HasJavaImportData) curNode).getJavaImportData()
-                        .addImportInfo(curNode, importInfo);
-                if (!isImportAdded) {
-                    /*
-                     * If the attribute type info is not imported, then it must
-                     * be a qualified access.
-                     */
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Checks if the import info is same as the package of the current generated
-     * java file.
-     *
-     * @param curNode    Java identifier of the current data model node
-     * @param importInfo import info for an attribute
-     * @return true if the import info is same as the current nodes package
-     * false otherwise
-     */
-    public static boolean isImportPkgEqualCurNodePkg(
-            YangNode curNode, JavaQualifiedTypeInfo importInfo) {
-
-        if (!(curNode instanceof HasJavaFileInfo)) {
-            throw new TranslatorException("missing java file info for the data model node");
-        }
-        return ((HasJavaFileInfo) curNode).getJavaFileInfo().getPackage()
-                .contentEquals(importInfo.getPkgInfo());
-    }
 
     @Override
     public int hashCode() {
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaQualifiedTypeInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfoContainer.java
similarity index 95%
rename from utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaQualifiedTypeInfo.java
rename to utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfoContainer.java
index 80b72cf..c6570c6 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaQualifiedTypeInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfoContainer.java
@@ -18,7 +18,7 @@
 /**
  * Maintain the java qualified access details for an attribute or a class.
  */
-public interface HasJavaQualifiedTypeInfo {
+public interface JavaQualifiedTypeInfoContainer {
 
     /**
      * Obtain the java qualified details.
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaBeanFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaBeanFragmentFiles.java
new file mode 100644
index 0000000..eaecdd7
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaBeanFragmentFiles.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.translator.tojava;
+
+import java.io.IOException;
+
+/**
+ * Represents implementation of java bean code fragments temporary implementations.
+ */
+public class TempJavaBeanFragmentFiles
+        extends TempJavaFragmentFiles {
+
+    /**
+     * Creates an instance of temporary java code fragment.
+     *
+     * @param javaFileInfo generated java file info
+     * @throws IOException when fails to create new file handle
+     */
+    public TempJavaBeanFragmentFiles(JavaFileInfo javaFileInfo)
+            throws IOException {
+        super(javaFileInfo);
+    }
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java
index 10d98c8..a1bb801 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java
@@ -16,112 +16,17 @@
 
 package org.onosproject.yangutils.translator.tojava;
 
-import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import org.onosproject.yangutils.datamodel.HasType;
-import org.onosproject.yangutils.datamodel.YangEnum;
-import org.onosproject.yangutils.datamodel.YangEnumeration;
-import org.onosproject.yangutils.datamodel.YangLeaf;
-import org.onosproject.yangutils.datamodel.YangLeafList;
-import org.onosproject.yangutils.datamodel.YangLeavesHolder;
+
+import org.onosproject.yangutils.datamodel.YangTypeContainer;
 import org.onosproject.yangutils.datamodel.YangNode;
-import org.onosproject.yangutils.datamodel.YangType;
-import org.onosproject.yangutils.datamodel.YangCase;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 
-import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE;
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK;
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ENUM_CLASS;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_RPC_INTERFACE;
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_TYPEDEF_CLASS;
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS;
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.IMPL_CLASS_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.INTERFACE_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.ATTRIBUTES_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.CONSTRUCTOR_FOR_TYPE_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.CONSTRUCTOR_IMPL_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.ENUM_IMPL_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.EQUALS_IMPL_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.FROM_STRING_IMPL_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.GETTER_FOR_CLASS_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.GETTER_FOR_INTERFACE_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.HASH_CODE_IMPL_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.OF_STRING_IMPL_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.RPC_IMPL_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_CLASS_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK;
-import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoOfEnumAttribute;
-import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoOfLeaf;
-import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoOfType;
-import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getCurNodeAsAttributeInParent;
-import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getFromStringAttributeInfo;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.generateEnumAttributeString;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaAttributeDefination;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaClassDefClose;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateBuilderClassFile;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateBuilderInterfaceFile;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateEnumClassFile;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateImplClassFile;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateInterfaceFile;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateRpcInterfaceFile;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateTypeDefClassFile;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateUnionClassFile;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getFileObject;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getParentNodeInGenCode;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuildString;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getConstructor;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getDefaultConstructorString;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getEqualsMethod;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getFromStringMethod;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getGetterForClass;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getGetterString;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getHashCodeMethod;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getOfMethod;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getOfMethodStringAndJavaDoc;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getOverRideString;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getRpcStringMethod;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getSetterForClass;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getSetterString;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getToStringMethod;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getTypeConstructorStringAndJavaDoc;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.parseBuilderInterfaceBuildMethodString;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addArrayListImport;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addAugmentedInfoImport;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addHasAugmentationImport;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addImportsToStringAndHasCodeMethods;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.closeFile;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.isAugmentedInfoExtended;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.isHasAugmentationExtended;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.prepareJavaFileGeneratorForExtendsList;
-import static org.onosproject.yangutils.utils.UtilConstants.BUILDER;
-import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
-import static org.onosproject.yangutils.utils.UtilConstants.FOUR_SPACE_INDENTATION;
-import static org.onosproject.yangutils.utils.UtilConstants.IMPL;
-import static org.onosproject.yangutils.utils.UtilConstants.INTERFACE;
-import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
-import static org.onosproject.yangutils.utils.UtilConstants.PACKAGE_INFO_JAVADOC_OF_CHILD;
-import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
-import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
-import static org.onosproject.yangutils.utils.UtilConstants.IMPORT;
-import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN;
-import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage;
-import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.readAppendFile;
-import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.GETTER_METHOD;
-import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.OF_METHOD;
-import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.generateJavaDocForRpc;
-import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
-import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.clean;
-import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.insertDataIntoJavaFile;
-import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.mergeJavaFiles;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_TYPE_CLASS;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.getExtendsList;
 
 /**
  * Represents implementation of java code fragments temporary implementations.
@@ -129,919 +34,209 @@
 public class TempJavaCodeFragmentFiles {
 
     /**
-     * The variable which guides the types of temporary files generated using
-     * the temporary generated file types mask.
+     * Has the temporary files required for bean generated classes.
      */
-    private int generatedTempFiles;
+    private TempJavaBeanFragmentFiles beanTempFiles;
 
     /**
-     * The variable which guides the types of files generated using
-     * the generated file types mask.
+     * Has the temporary files required for bean generated classes.
      */
-    private int generatedJavaFiles;
+    private TempJavaTypeFragmentFiles typeTempFiles;
 
     /**
-     * Absolute path where the target java file needs to be generated.
+     * Has the temporary files required for service generated classes.
      */
-    private String absoluteDirPath;
+    private TempJavaServiceFragmentFiles serviceTempFiles;
 
     /**
-     * Name of java file that needs to be generated.
+     * Has the temporary files required for enumeration generated classes.
      */
-    private String generatedJavaClassName;
-
-    /**
-     * Contains all the class name which will be extended by generated files.
-     */
-    private List<String> extendsList = new ArrayList<>();
-
-    /**
-     * File type extension for java classes.
-     */
-    private static final String JAVA_FILE_EXTENSION = ".java";
-
-    /**
-     * File type extension for temporary classes.
-     */
-    private static final String TEMP_FILE_EXTENSION = ".tmp";
-
-    /**
-     * Folder suffix for temporary files folder.
-     */
-    private static final String TEMP_FOLDER_NAME_SUFIX = "-Temp";
-
-    /**
-     * File name for getter method.
-     */
-    private static final String GETTER_METHOD_FILE_NAME = "GetterMethod";
-
-    /**
-     * File name for getter method implementation.
-     */
-    private static final String GETTER_METHOD_IMPL_FILE_NAME = "GetterMethodImpl";
-
-    /**
-     * File name for setter method.
-     */
-    private static final String SETTER_METHOD_FILE_NAME = "SetterMethod";
-
-    /**
-     * File name for setter method implementation.
-     */
-    private static final String SETTER_METHOD_IMPL_FILE_NAME = "SetterMethodImpl";
-
-    /**
-     * File name for constructor.
-     */
-    private static final String CONSTRUCTOR_FILE_NAME = "Constructor";
-
-    /**
-     * File name for attributes.
-     */
-    private static final String ATTRIBUTE_FILE_NAME = "Attributes";
-
-    /**
-     * File name for to string method.
-     */
-    private static final String TO_STRING_METHOD_FILE_NAME = "ToString";
-
-    /**
-     * File name for hash code method.
-     */
-    private static final String HASH_CODE_METHOD_FILE_NAME = "HashCode";
-
-    /**
-     * File name for equals method.
-     */
-    private static final String EQUALS_METHOD_FILE_NAME = "Equals";
-
-    /**
-     * File name for of string method.
-     */
-    private static final String OF_STRING_METHOD_FILE_NAME = "OfString";
-
-    /**
-     * File name for temporary enum class.
-     */
-    private static final String ENUM_CLASS_TEMP_FILE_NAME = "EnumClass";
-
-    /**
-     * File name for construction for special type like union, typedef.
-     */
-    private static final String CONSTRUCTOR_FOR_TYPE_FILE_NAME = "ConstructorForType";
-
-    /**
-     * File name for from string method.
-     */
-    private static final String FROM_STRING_METHOD_FILE_NAME = "FromString";
-
-    /**
-     * File name for interface java file name suffix.
-     */
-    private static final String INTERFACE_FILE_NAME_SUFFIX = EMPTY_STRING;
-
-    /**
-     * File name for builder interface file name suffix.
-     */
-    private static final String BUILDER_INTERFACE_FILE_NAME_SUFFIX = BUILDER + INTERFACE;
-
-    /**
-     * File name for builder class file name suffix.
-     */
-    private static final String BUILDER_CLASS_FILE_NAME_SUFFIX = BUILDER;
-
-    /**
-     * File name for impl class file name suffix.
-     */
-    private static final String IMPL_CLASS_FILE_NAME_SUFFIX = IMPL;
-
-    /**
-     * File name for typedef class file name suffix.
-     */
-    private static final String TYPEDEF_CLASS_FILE_NAME_SUFFIX = EMPTY_STRING;
-
-    /**
-     * File name for enum class file name suffix.
-     */
-    private static final String ENUM_CLASS_FILE_NAME_SUFFIX = EMPTY_STRING;
-
-    /**
-     * File name for rpc method.
-     */
-    private static final String RPC_FILE_NAME = "Rpc";
-
-    /**
-     * File name for generated class file for special type like union, typedef suffix.
-     */
-    private static final String RPC_INTERFACE_FILE_NAME_SUFFIX = "Service";
-
-    /**
-     * File name for generated class file for special type like union, typedef suffix.
-     */
-    private static final String UNION_TYPE_CLASS_FILE_NAME_SUFFIX = EMPTY_STRING;
-
-    /**
-     * Java file handle for interface file.
-     */
-    private File interfaceJavaFileHandle;
-
-    /**
-     * Java file handle for builder interface file.
-     */
-    private File builderInterfaceJavaFileHandle;
-
-    /**
-     * Java file handle for builder class file.
-     */
-    private File builderClassJavaFileHandle;
-
-    /**
-     * Java file handle for impl class file.
-     */
-    private File implClassJavaFileHandle;
-
-    /**
-     * Java file handle for typedef class file.
-     */
-    private File typedefClassJavaFileHandle;
-
-    /**
-     * Java file handle for type class like union, typedef file.
-     */
-    private File typeClassJavaFileHandle;
-
-    /**
-     * Temporary file handle for attribute.
-     */
-    private File attributesTempFileHandle;
-
-    /**
-     * Temporary file handle for getter of interface.
-     */
-    private File getterInterfaceTempFileHandle;
-
-    /**
-     * Temporary file handle for getter of class.
-     */
-    private File getterImplTempFileHandle;
-
-    /**
-     * Temporary file handle for setter of interface.
-     */
-    private File setterInterfaceTempFileHandle;
-
-    /**
-     * Temporary file handle for setter of class.
-     */
-    private File setterImplTempFileHandle;
-
-    /**
-     * Temporary file handle for constructor of class.
-     */
-    private File constructorImplTempFileHandle;
-
-    /**
-     * Temporary file handle for hash code method of class.
-     */
-    private File hashCodeImplTempFileHandle;
-
-    /**
-     * Temporary file handle for equals method of class.
-     */
-    private File equalsImplTempFileHandle;
-
-    /**
-     * Temporary file handle for to string method of class.
-     */
-    private File toStringImplTempFileHandle;
-
-    /**
-     * Temporary file handle for enum class file.
-     */
-    private File enumClassTempFileHandle;
-
-    /**
-     * Temporary file handle for of string method of class.
-     */
-    private File ofStringImplTempFileHandle;
-
-    /**
-     * Temporary file handle for constructor for type class.
-     */
-    private File constructorForTypeTempFileHandle;
-
-    /**
-     * Temporary file handle for from string method of class.
-     */
-    private File fromStringImplTempFileHandle;
-
-    /**
-     * Temporary file handle for rpc interface.
-     */
-    private File rpcInterfaceImplTempFileHandle;
-
-    /**
-     * Java file handle for rpc interface file.
-     */
-    private File rpcInterfaceJavaFileHandle;
-
-    /**
-     * Java attribute info.
-     */
-    private JavaAttributeInfo newAttrInfo;
-
-    /**
-     * Current YANG node.
-     */
-    private YangNode curYangNode;
-
-    /**
-     * Import info for case.
-     */
-    private JavaQualifiedTypeInfo caseImportInfo;
-
-    /**
-     * Current enum's value.
-     */
-    private int enumValue;
-
-    /**
-     * Is attribute added.
-     */
-    private boolean isAttributePresent = false;
-
-    /*
-     * Java file handle for enum class.
-      */
-    private File enumClassJavaFileHandle;
+    private TempJavaEnumerationFragmentFiles enumerationTempFiles;
 
     /**
      * Creates an instance of temporary java code fragment.
      *
-     * @param genFileType file generation type
-     * @param genDir      file generation directory
-     * @param className   class name
+     * @param javaFileInfo generated java file info
      * @throws IOException when fails to create new file handle
      */
-    public TempJavaCodeFragmentFiles(int genFileType, String genDir, String className)
+    public TempJavaCodeFragmentFiles(JavaFileInfo javaFileInfo)
             throws IOException {
 
-        setExtendsList(new ArrayList<>());
-        generatedTempFiles = 0;
-        absoluteDirPath = genDir;
-        generatedJavaClassName = className;
-        generatedJavaFiles = genFileType;
-        /**
-         * Initialize getter when generation file type matches to interface
-         * mask.
-         */
-        if ((genFileType & INTERFACE_MASK) != 0) {
-            generatedTempFiles |= GETTER_FOR_INTERFACE_MASK;
+        if ((javaFileInfo.getGeneratedFileTypes() & GENERATE_INTERFACE_WITH_BUILDER) != 0) {
+            setBeanTempFiles(new TempJavaBeanFragmentFiles(javaFileInfo));
         }
 
         /**
-         * Initialize getter and setter when generation file type matches to
-         * builder interface mask.
+         * Creates user defined data type class file.
          */
-        if ((genFileType & BUILDER_INTERFACE_MASK) != 0) {
-            generatedTempFiles |= GETTER_FOR_INTERFACE_MASK;
-            generatedTempFiles |= SETTER_FOR_INTERFACE_MASK;
+        if ((javaFileInfo.getGeneratedFileTypes() & GENERATE_TYPE_CLASS) != 0) {
+            setTypeTempFiles(new TempJavaTypeFragmentFiles(javaFileInfo));
         }
 
         /**
-         * Initialize getterImpl, setterImpl and attributes when generation file
-         * type matches to builder class mask.
+         * Creates enumeration class file.
          */
-        if ((genFileType & BUILDER_CLASS_MASK) != 0) {
-            generatedTempFiles |= ATTRIBUTES_MASK;
-            generatedTempFiles |= GETTER_FOR_CLASS_MASK;
-            generatedTempFiles |= SETTER_FOR_CLASS_MASK;
+        if ((javaFileInfo.getGeneratedFileTypes() & GENERATE_ENUM_CLASS) != 0) {
+            setEnumerationTempFiles(new TempJavaEnumerationFragmentFiles(javaFileInfo));
+        }
+
+        if ((javaFileInfo.getGeneratedFileTypes() & GENERATE_RPC_INTERFACE) != 0) {
+            setServiceTempFiles(new TempJavaServiceFragmentFiles(javaFileInfo));
+        }
+    }
+
+    /**
+     * Retrieves the temp file handle for bean file generation.
+     *
+     * @return temp file handle for bean file generation
+     */
+    public TempJavaBeanFragmentFiles getBeanTempFiles() {
+        return beanTempFiles;
+    }
+
+    /**
+     * Sets temp file handle for bean file generation.
+     *
+     * @param beanTempFiles temp file handle for bean file generation
+     */
+    public void setBeanTempFiles(TempJavaBeanFragmentFiles beanTempFiles) {
+        this.beanTempFiles = beanTempFiles;
+    }
+
+
+    /**
+     * Retrieves the temp file handle for data type file generation.
+     *
+     * @return temp file handle for data type file generation
+     */
+    public TempJavaTypeFragmentFiles getTypeTempFiles() {
+        return typeTempFiles;
+    }
+
+
+    /**
+     * Sets temp file handle for data type file generation.
+     *
+     * @param typeTempFiles temp file handle for data type file generation
+     */
+    public void setTypeTempFiles(TempJavaTypeFragmentFiles typeTempFiles) {
+        this.typeTempFiles = typeTempFiles;
+    }
+
+    /**
+     * Retrieves the temp file handle for service file generation.
+     *
+     * @return temp file handle for service file generation
+     */
+    public TempJavaServiceFragmentFiles getServiceTempFiles() {
+        return serviceTempFiles;
+    }
+
+    /**
+     * Sets temp file handle for service file generation.
+     *
+     * @param serviceTempFiles temp file handle for service file generation
+     */
+    public void setServiceTempFiles(TempJavaServiceFragmentFiles serviceTempFiles) {
+        this.serviceTempFiles = serviceTempFiles;
+    }
+
+    /**
+     * Retrieves the temp file handle for enumeration file generation.
+     *
+     * @return temp file handle for enumeration file generation
+     */
+    public TempJavaEnumerationFragmentFiles getEnumerationTempFiles() {
+        return enumerationTempFiles;
+    }
+
+    /**
+     * Sets temp file handle for enumeration file generation.
+     *
+     * @param enumerationTempFiles temp file handle for enumeration file generation
+     */
+    public void setEnumerationTempFiles(
+            TempJavaEnumerationFragmentFiles enumerationTempFiles) {
+        this.enumerationTempFiles = enumerationTempFiles;
+    }
+
+    /**
+     * Constructs java code exit.
+     *
+     * @param fileType generated file type
+     * @param curNode current YANG node
+     * @throws IOException when fails to generate java files
+     */
+    public void generateJavaFile(int fileType, YangNode curNode)
+            throws IOException {
+
+        if (getBeanTempFiles() != null) {
+            getBeanTempFiles().generateJavaFile(fileType, curNode);
         }
 
         /**
-         * Initialize getterImpl, attributes, constructor, hash code, equals and
-         * to strings when generation file type matches to impl class mask.
+         * Creates user defined data type class file.
          */
-        if ((genFileType & IMPL_CLASS_MASK) != 0) {
-            generatedTempFiles |= ATTRIBUTES_MASK;
-            generatedTempFiles |= GETTER_FOR_CLASS_MASK;
-            generatedTempFiles |= CONSTRUCTOR_IMPL_MASK;
-            generatedTempFiles |= HASH_CODE_IMPL_MASK;
-            generatedTempFiles |= EQUALS_IMPL_MASK;
-            generatedTempFiles |= TO_STRING_IMPL_MASK;
+        if (getTypeTempFiles() != null) {
+            getTypeTempFiles().generateJavaFile(fileType, curNode);
         }
 
-        if ((genFileType & GENERATE_RPC_INTERFACE) != 0) {
-            generatedTempFiles |= RPC_IMPL_MASK;
+    }
+
+    /**
+     * Adds the new attribute info to the target generated temporary files.
+     *
+     * @param newAttrInfo the attribute info that needs to be added to temporary
+     * files
+     * @throws IOException IO operation fail
+     */
+    public void addJavaSnippetInfoToApplicableTempFiles(JavaAttributeInfo newAttrInfo)
+            throws IOException {
+
+        if (getBeanTempFiles() != null) {
+            getBeanTempFiles()
+                    .addJavaSnippetInfoToApplicableTempFiles(newAttrInfo);
         }
 
         /**
-         * Initialize getterImpl, attributes,  hash code, equals and
-         * to strings when generation file type matches to typeDef class mask.
+         * Creates user defined data type class file.
          */
-        if ((genFileType & GENERATE_TYPEDEF_CLASS) != 0) {
-            generatedTempFiles |= ATTRIBUTES_MASK;
-            generatedTempFiles |= GETTER_FOR_CLASS_MASK;
-            generatedTempFiles |= HASH_CODE_IMPL_MASK;
-            generatedTempFiles |= EQUALS_IMPL_MASK;
-            generatedTempFiles |= TO_STRING_IMPL_MASK;
-            generatedTempFiles |= OF_STRING_IMPL_MASK;
-            generatedTempFiles |= CONSTRUCTOR_FOR_TYPE_MASK;
-            generatedTempFiles |= FROM_STRING_IMPL_MASK;
-        }
-
-        /**
-         * Initialize getterImpl, attributes, hash code, equals, of string,
-         * constructor, union's to string, from string when generation
-         * file type matches to union class mask.
-         */
-        if ((genFileType & GENERATE_UNION_CLASS) != 0) {
-            generatedTempFiles |= ATTRIBUTES_MASK;
-            generatedTempFiles |= GETTER_FOR_CLASS_MASK;
-            generatedTempFiles |= HASH_CODE_IMPL_MASK;
-            generatedTempFiles |= EQUALS_IMPL_MASK;
-            generatedTempFiles |= OF_STRING_IMPL_MASK;
-            generatedTempFiles |= CONSTRUCTOR_FOR_TYPE_MASK;
-            generatedTempFiles |= TO_STRING_IMPL_MASK;
-            generatedTempFiles |= FROM_STRING_IMPL_MASK;
-        }
-        /**
-         * Initialize enum when generation file type matches to enum class mask.
-         */
-        if ((genFileType & GENERATE_ENUM_CLASS) != 0) {
-            generatedTempFiles |= ENUM_IMPL_MASK;
-        }
-
-        /**
-         * Set temporary file handles.
-         */
-        if ((generatedTempFiles & ATTRIBUTES_MASK) != 0) {
-            setAttributesTempFileHandle(getTemporaryFileHandle(ATTRIBUTE_FILE_NAME));
-        }
-
-        if ((generatedTempFiles & GETTER_FOR_INTERFACE_MASK) != 0) {
-            setGetterInterfaceTempFileHandle(getTemporaryFileHandle(GETTER_METHOD_FILE_NAME));
-        }
-
-        if ((generatedTempFiles & SETTER_FOR_INTERFACE_MASK) != 0) {
-            setSetterInterfaceTempFileHandle(getTemporaryFileHandle(SETTER_METHOD_FILE_NAME));
-        }
-
-        if ((generatedTempFiles & GETTER_FOR_CLASS_MASK) != 0) {
-            setGetterImplTempFileHandle(getTemporaryFileHandle(GETTER_METHOD_IMPL_FILE_NAME));
-        }
-
-        if ((generatedTempFiles & SETTER_FOR_CLASS_MASK) != 0) {
-            setSetterImplTempFileHandle(getTemporaryFileHandle(SETTER_METHOD_IMPL_FILE_NAME));
-        }
-
-        if ((generatedTempFiles & CONSTRUCTOR_IMPL_MASK) != 0) {
-            setConstructorImplTempFileHandle(getTemporaryFileHandle(CONSTRUCTOR_FILE_NAME));
-        }
-
-        if ((generatedTempFiles & HASH_CODE_IMPL_MASK) != 0) {
-            setHashCodeImplTempFileHandle(getTemporaryFileHandle(HASH_CODE_METHOD_FILE_NAME));
-        }
-
-        if ((generatedTempFiles & EQUALS_IMPL_MASK) != 0) {
-            setEqualsImplTempFileHandle(getTemporaryFileHandle(EQUALS_METHOD_FILE_NAME));
-        }
-        if ((generatedTempFiles & TO_STRING_IMPL_MASK) != 0) {
-            setToStringImplTempFileHandle(getTemporaryFileHandle(TO_STRING_METHOD_FILE_NAME));
-        }
-        if ((generatedTempFiles & ENUM_IMPL_MASK) != 0) {
-            setEnumClassTempFileHandle(getTemporaryFileHandle(ENUM_CLASS_TEMP_FILE_NAME));
-        }
-        if ((generatedTempFiles & OF_STRING_IMPL_MASK) != 0) {
-            setOfStringImplTempFileHandle(getTemporaryFileHandle(OF_STRING_METHOD_FILE_NAME));
-        }
-
-        if ((generatedTempFiles & CONSTRUCTOR_FOR_TYPE_MASK) != 0) {
-            setConstructorForTypeTempFileHandle(getTemporaryFileHandle(CONSTRUCTOR_FOR_TYPE_FILE_NAME));
-        }
-
-        if ((generatedTempFiles & FROM_STRING_IMPL_MASK) != 0) {
-            setFromStringImplTempFileHandle(getTemporaryFileHandle(FROM_STRING_METHOD_FILE_NAME));
-        }
-
-        if ((generatedTempFiles & RPC_IMPL_MASK) != 0) {
-            setRpcInterfaceImplTempFileHandle(getTemporaryFileHandle(RPC_FILE_NAME));
+        if (getTypeTempFiles() != null) {
+            getTypeTempFiles()
+                    .addJavaSnippetInfoToApplicableTempFiles(newAttrInfo);
         }
     }
 
     /**
-     * Returns java file handle for interface file.
+     * Adds all the leaves in the current data model node as part of the
+     * generated temporary file.
      *
-     * @return java file handle for interface file
+     * @param curNode java file info of the generated file
+     * @throws IOException IO operation fail
      */
-    private File getInterfaceJavaFileHandle() {
-        return interfaceJavaFileHandle;
-    }
+    public void addCurNodeLeavesInfoToTempFiles(YangNode curNode)
+            throws IOException {
 
-    /**
-     * Sets the java file handle for interface file.
-     *
-     * @param interfaceJavaFileHandle java file handle
-     */
-    private void setInterfaceJavaFileHandle(File interfaceJavaFileHandle) {
-        this.interfaceJavaFileHandle = interfaceJavaFileHandle;
-    }
-
-    /**
-     * Returns java file handle for builder interface file.
-     *
-     * @return java file handle for builder interface file
-     */
-    private File getBuilderInterfaceJavaFileHandle() {
-        return builderInterfaceJavaFileHandle;
-    }
-
-    /**
-     * Sets the java file handle for builder interface file.
-     *
-     * @param builderInterfaceJavaFileHandle java file handle
-     */
-    private void setBuilderInterfaceJavaFileHandle(File builderInterfaceJavaFileHandle) {
-        this.builderInterfaceJavaFileHandle = builderInterfaceJavaFileHandle;
-    }
-
-    /**
-     * Returns java file handle for builder class file.
-     *
-     * @return java file handle for builder class file
-     */
-    private File getBuilderClassJavaFileHandle() {
-        return builderClassJavaFileHandle;
-    }
-
-    /**
-     * Sets the java file handle for builder class file.
-     *
-     * @param builderClassJavaFileHandle java file handle
-     */
-    private void setBuilderClassJavaFileHandle(File builderClassJavaFileHandle) {
-        this.builderClassJavaFileHandle = builderClassJavaFileHandle;
-    }
-
-    /**
-     * Returns java file handle for impl class file.
-     *
-     * @return java file handle for impl class file
-     */
-    private File getImplClassJavaFileHandle() {
-        return implClassJavaFileHandle;
-    }
-
-    /**
-     * Sets the java file handle for impl class file.
-     *
-     * @param implClassJavaFileHandle java file handle
-     */
-    private void setImplClassJavaFileHandle(File implClassJavaFileHandle) {
-        this.implClassJavaFileHandle = implClassJavaFileHandle;
-    }
-
-    /**
-     * Returns java file handle for typedef class file.
-     *
-     * @return java file handle for typedef class file
-     */
-    private File getTypedefClassJavaFileHandle() {
-        return typedefClassJavaFileHandle;
-    }
-
-    /**
-     * Sets the java file handle for typedef class file.
-     *
-     * @param typedefClassJavaFileHandle java file handle
-     */
-    private void setTypedefClassJavaFileHandle(File typedefClassJavaFileHandle) {
-        this.typedefClassJavaFileHandle = typedefClassJavaFileHandle;
-    }
-
-    /**
-     * Returns enum class java file handle.
-     *
-     * @return enum class java file handle
-     */
-    private File getEnumClassJavaFileHandle() {
-        return enumClassJavaFileHandle;
-    }
-
-    /**
-     * Sets enum class java file handle.
-     *
-     * @param enumClassJavaFileHandle enum class java file handle
-     */
-
-    private void setEnumClassJavaFileHandle(File enumClassJavaFileHandle) {
-        this.enumClassJavaFileHandle = enumClassJavaFileHandle;
-    }
-
-    /**
-     * Returns java file handle for type class file.
-     *
-     * @return java file handle for type class file
-     */
-    private File getTypeClassJavaFileHandle() {
-        return typeClassJavaFileHandle;
-    }
-
-    /**
-     * Sets the java file handle for type class file.
-     *
-     * @param typeClassJavaFileHandle type file handle
-     */
-    private void setTypeClassJavaFileHandle(File typeClassJavaFileHandle) {
-        this.typeClassJavaFileHandle = typeClassJavaFileHandle;
-    }
-
-    /**
-     * Returns attribute's temporary file handle.
-     *
-     * @return temporary file handle
-     */
-    public File getAttributesTempFileHandle() {
-        return attributesTempFileHandle;
-    }
-
-    /**
-     * Sets attribute's temporary file handle.
-     *
-     * @param attributeForClass file handle for attribute
-     */
-    private void setAttributesTempFileHandle(File attributeForClass) {
-        attributesTempFileHandle = attributeForClass;
-    }
-
-    /**
-     * Returns getter methods's temporary file handle.
-     *
-     * @return temporary file handle
-     */
-    public File getGetterInterfaceTempFileHandle() {
-        return getterInterfaceTempFileHandle;
-    }
-
-    /**
-     * Sets to getter method's temporary file handle.
-     *
-     * @param getterForInterface file handle for to getter method
-     */
-    private void setGetterInterfaceTempFileHandle(File getterForInterface) {
-        getterInterfaceTempFileHandle = getterForInterface;
-    }
-
-    /**
-     * Returns getter method's impl's temporary file handle.
-     *
-     * @return temporary file handle
-     */
-    public File getGetterImplTempFileHandle() {
-        return getterImplTempFileHandle;
-    }
-
-    /**
-     * Sets to getter method's impl's temporary file handle.
-     *
-     * @param getterImpl file handle for to getter method's impl
-     */
-    private void setGetterImplTempFileHandle(File getterImpl) {
-        getterImplTempFileHandle = getterImpl;
-    }
-
-    /**
-     * Returns setter method's temporary file handle.
-     *
-     * @return temporary file handle
-     */
-    public File getSetterInterfaceTempFileHandle() {
-        return setterInterfaceTempFileHandle;
-    }
-
-    /**
-     * Sets to setter method's temporary file handle.
-     *
-     * @param setterForInterface file handle for to setter method
-     */
-    private void setSetterInterfaceTempFileHandle(File setterForInterface) {
-        setterInterfaceTempFileHandle = setterForInterface;
-    }
-
-    /**
-     * Returns setter method's impl's temporary file handle.
-     *
-     * @return temporary file handle
-     */
-    public File getSetterImplTempFileHandle() {
-        return setterImplTempFileHandle;
-    }
-
-    /**
-     * Sets to setter method's impl's temporary file handle.
-     *
-     * @param setterImpl file handle for to setter method's implementation class
-     */
-    private void setSetterImplTempFileHandle(File setterImpl) {
-        setterImplTempFileHandle = setterImpl;
-    }
-
-    /**
-     * Returns constructor's temporary file handle.
-     *
-     * @return temporary file handle
-     */
-    public File getConstructorImplTempFileHandle() {
-        return constructorImplTempFileHandle;
-    }
-
-    /**
-     * Sets to constructor's temporary file handle.
-     *
-     * @param constructor file handle for to constructor
-     */
-    private void setConstructorImplTempFileHandle(File constructor) {
-        constructorImplTempFileHandle = constructor;
-    }
-
-    /**
-     * Returns hash code method's temporary file handle.
-     *
-     * @return temporary file handle
-     */
-    public File getHashCodeImplTempFileHandle() {
-        return hashCodeImplTempFileHandle;
-    }
-
-    /**
-     * Sets hash code method's temporary file handle.
-     *
-     * @param hashCodeMethod file handle for hash code method
-     */
-    private void setHashCodeImplTempFileHandle(File hashCodeMethod) {
-        hashCodeImplTempFileHandle = hashCodeMethod;
-    }
-
-    /**
-     * Returns equals mehtod's temporary file handle.
-     *
-     * @return temporary file handle
-     */
-    public File getEqualsImplTempFileHandle() {
-        return equalsImplTempFileHandle;
-    }
-
-    /**
-     * Sets equals method's temporary file handle.
-     *
-     * @param equalsMethod file handle for to equals method
-     */
-    private void setEqualsImplTempFileHandle(File equalsMethod) {
-        equalsImplTempFileHandle = equalsMethod;
-    }
-
-    /**
-     * Returns rpc method's temporary file handle.
-     *
-     * @return temporary file handle
-     */
-    public File getRpcInterfaceImplTempFileHandle() {
-        return rpcInterfaceImplTempFileHandle;
-    }
-
-    /**
-     * Sets rpc method's temporary file handle.
-     *
-     * @param rpcInterfaceImplTempFileHandle file handle for to rpc method
-     */
-    public void setRpcInterfaceImplTempFileHandle(File rpcInterfaceImplTempFileHandle) {
-        this.rpcInterfaceImplTempFileHandle = rpcInterfaceImplTempFileHandle;
-    }
-
-    /**
-     * Returns rpc method's java file handle.
-     *
-     * @return java file handle
-     */
-    public File getRpcInterfaceJavaFileHandle() {
-        return rpcInterfaceJavaFileHandle;
-    }
-
-    /**
-     * Sets rpc method's java file handle.
-     *
-     * @param rpcInterfaceJavaFileHandle file handle for to rpc method
-     */
-    public void setRpcInterfaceJavaFileHandle(File rpcInterfaceJavaFileHandle) {
-        this.rpcInterfaceJavaFileHandle = rpcInterfaceJavaFileHandle;
-    }
-
-    /**
-     * Returns to string method's temporary file handle.
-     *
-     * @return temporary file handle
-     */
-    public File getToStringImplTempFileHandle() {
-        return toStringImplTempFileHandle;
-    }
-
-    /**
-     * Sets to string method's temporary file handle.
-     *
-     * @param toStringMethod file handle for to string method
-     */
-    private void setToStringImplTempFileHandle(File toStringMethod) {
-        toStringImplTempFileHandle = toStringMethod;
-    }
-
-    /**
-     * Returns temporary file handle for enum class file.
-     *
-     * @return temporary file handle for enum class file
-     */
-    public File getEnumClassTempFileHandle() {
-        return enumClassTempFileHandle;
-    }
-
-    /**
-     * Sets temporary file handle for enum class file.
-     *
-     * @param enumClassTempFileHandle temporary file handle for enum class file
-     */
-
-    private void setEnumClassTempFileHandle(File enumClassTempFileHandle) {
-        this.enumClassTempFileHandle = enumClassTempFileHandle;
-    }
-
-    /**
-     * Returns of string method's temporary file handle.
-     *
-     * @return of string method's temporary file handle
-     */
-    public File getOfStringImplTempFileHandle() {
-        return ofStringImplTempFileHandle;
-    }
-
-    /**
-     * Set of string method's temporary file handle.
-     *
-     * @param ofStringImplTempFileHandle of string method's temporary file handle
-     */
-    private void setOfStringImplTempFileHandle(File ofStringImplTempFileHandle) {
-        this.ofStringImplTempFileHandle = ofStringImplTempFileHandle;
-    }
-
-    /**
-     * Returns type class constructor method's temporary file handle.
-     *
-     * @return type class constructor method's temporary file handle
-     */
-    public File getConstructorForTypeTempFileHandle() {
-        return constructorForTypeTempFileHandle;
-    }
-
-    /**
-     * Sets type class constructor method's temporary file handle.
-     *
-     * @param constructorForTypeTempFileHandle type class constructor method's temporary file handle
-     */
-    private void setConstructorForTypeTempFileHandle(File constructorForTypeTempFileHandle) {
-        this.constructorForTypeTempFileHandle = constructorForTypeTempFileHandle;
-    }
-
-    /**
-     * Returns from string method's temporary file handle.
-     *
-     * @return from string method's temporary file handle
-     */
-    public File getFromStringImplTempFileHandle() {
-        return fromStringImplTempFileHandle;
-    }
-
-    /**
-     * Sets from string method's temporary file handle.
-     *
-     * @param fromStringImplTempFileHandle from string method's temporary file handle
-     */
-    private void setFromStringImplTempFileHandle(File fromStringImplTempFileHandle) {
-        this.fromStringImplTempFileHandle = fromStringImplTempFileHandle;
-    }
-
-    /**
-     * Returns java attribute info.
-     *
-     * @return java attribute info
-     */
-    private JavaAttributeInfo getNewAttrInfo() {
-        return newAttrInfo;
-    }
-
-    /**
-     * Sets java attribute info.
-     *
-     * @param newAttrInfo java attribute info
-     */
-    private void setNewAttrInfo(JavaAttributeInfo newAttrInfo) {
-
-        if (newAttrInfo != null) {
-            isAttributePresent = true;
+        if (getBeanTempFiles() != null) {
+            getBeanTempFiles().addCurNodeLeavesInfoToTempFiles(curNode);
         }
-        this.newAttrInfo = newAttrInfo;
+
     }
 
     /**
-     * Returns current YANG node.
+     * Add all the type in the current data model node as part of the
+     * generated temporary file.
      *
-     * @return current YANG node
+     * @param yangTypeContainer YANG java data model node which has type info, eg union / typedef
+     * @throws IOException IO operation fail
      */
-    private YangNode getCurYangNode() {
-        return curYangNode;
-    }
+    public void addTypeInfoToTempFiles(YangTypeContainer yangTypeContainer)
+            throws IOException {
 
-    /**
-     * Sets current YANG node.
-     *
-     * @param curYangNode YANG node
-     */
-    private void setCurYangNode(YangNode curYangNode) {
-        this.curYangNode = curYangNode;
-    }
-
-    /**
-     * Returns enum's value.
-     *
-     * @return enum's value
-     */
-    public int getEnumValue() {
-        return enumValue;
-    }
-
-    /**
-     * Sets enum's value.
-     *
-     * @param enumValue enum's value
-     */
-    public void setEnumValue(int enumValue) {
-        this.enumValue = enumValue;
-    }
-
-    /**
-     * Returns list of classes to be extended by generated files.
-     *
-     * @return list of classes to be extended by generated files
-     */
-    private List<String> getExtendsList() {
-        return extendsList;
-    }
-
-    /**
-     * Sets class to be extended by generated file.
-     *
-     * @param extendsList list of classes to be extended
-     */
-
-    private void setExtendsList(List<String> extendsList) {
-        this.extendsList = extendsList;
+        if (getTypeTempFiles() != null) {
+            getTypeTempFiles()
+                    .addTypeInfoToTempFiles(yangTypeContainer);
+        }
     }
 
     /**
@@ -1054,112 +249,17 @@
     }
 
     /**
-     * Adds of string for type.
-     *
-     * @param attr attribute info
-     * @throws IOException when fails to append to temporary file
-     */
-    private void addOfStringMethod(JavaAttributeInfo attr) throws IOException {
-        appendToFile(getOfStringImplTempFileHandle(), getOfMethodStringAndJavaDoc(attr, generatedJavaClassName)
-                + NEW_LINE);
-    }
-
-    /**
-     * Adds type constructor.
-     *
-     * @param attr attribute info
-     * @throws IOException when fails to append to temporary file
-     */
-    private void addTypeConstructor(JavaAttributeInfo attr) throws IOException {
-        appendToFile(getConstructorForTypeTempFileHandle(), getTypeConstructorStringAndJavaDoc(attr,
-                generatedJavaClassName) + NEW_LINE);
-    }
-
-    /**
-     * Adds attribute for class.
-     *
-     * @param attr attribute info
-     * @throws IOException when fails to append to temporary file
-     */
-    private void addAttribute(JavaAttributeInfo attr) throws IOException {
-        appendToFile(getAttributesTempFileHandle(), parseAttribute(attr) + FOUR_SPACE_INDENTATION);
-    }
-
-    /**
-     * Adds getter for interface.
-     *
-     * @param attr attribute info
-     * @throws IOException when fails to append to temporary file
-     */
-    private void addGetterForInterface(JavaAttributeInfo attr) throws IOException {
-        appendToFile(getGetterInterfaceTempFileHandle(), getGetterString(attr) + NEW_LINE);
-    }
-
-    /**
-     * Adds getter method's impl for class.
-     *
-     * @param attr        attribute info
-     * @param genFiletype generated file type
-     * @throws IOException when fails to append to temporary file
-     */
-    private void addGetterImpl(JavaAttributeInfo attr, int genFiletype) throws IOException {
-
-        if ((genFiletype & BUILDER_CLASS_MASK) != 0) {
-            appendToFile(getGetterImplTempFileHandle(), getOverRideString() + getGetterForClass(attr) + NEW_LINE);
-        } else {
-            appendToFile(getGetterImplTempFileHandle(), getJavaDoc(GETTER_METHOD, attr.getAttributeName(), false)
-                    + getGetterForClass(attr) + NEW_LINE);
-        }
-    }
-
-    /**
-     * Adds setter for interface.
-     *
-     * @param attr attribute info
-     * @throws IOException when fails to append to temporary file
-     */
-    private void addSetterForInterface(JavaAttributeInfo attr) throws IOException {
-        appendToFile(getSetterInterfaceTempFileHandle(),
-                getSetterString(attr, generatedJavaClassName) + NEW_LINE);
-    }
-
-    /**
-     * Adds setter's implementation for class.
-     *
-     * @param attr attribute info
-     * @throws IOException when fails to append to temporary file
-     */
-    private void addSetterImpl(JavaAttributeInfo attr) throws IOException {
-        appendToFile(getSetterImplTempFileHandle(),
-                getOverRideString() + getSetterForClass(attr, generatedJavaClassName) + NEW_LINE);
-    }
-
-    /**
      * Adds build method for interface.
      *
      * @return build method for interface
-     */
-    public String addBuildMethodForInterface() {
-        return parseBuilderInterfaceBuildMethodString(generatedJavaClassName);
-    }
-
-    /**
-     * Adds build method's implementation for class.
-     *
-     * @return build method implementation for class
-     */
-    public String addBuildMethodImpl() {
-        return getBuildString(generatedJavaClassName) + NEW_LINE;
-    }
-
-    /**
-     * Adds constructor for class.
-     *
-     * @param attr attribute info
      * @throws IOException when fails to append to temporary file
      */
-    private void addConstructor(JavaAttributeInfo attr) throws IOException {
-        appendToFile(getConstructorImplTempFileHandle(), getConstructor(generatedJavaClassName, attr));
+    public String addBuildMethodForInterface()
+            throws IOException {
+        if (getBeanTempFiles() != null) {
+            return getBeanTempFiles().addBuildMethodForInterface();
+        }
+        throw new TranslatorException("build method only supported for bean class");
     }
 
     /**
@@ -1168,337 +268,61 @@
      * @param modifier modifier for constructor.
      * @param toAppend string which need to be appended with the class name
      * @return default constructor for class
-     */
-    public String addDefaultConstructor(String modifier, String toAppend) {
-        return NEW_LINE + getDefaultConstructorString(generatedJavaClassName + toAppend, modifier);
-    }
-
-    /**
-     * Adds default constructor for class.
-     *
-     * @return default constructor for class
-     */
-    public String addOfMethod() {
-        return getJavaDoc(OF_METHOD, generatedJavaClassName, false)
-                + getOfMethod(generatedJavaClassName, newAttrInfo);
-    }
-
-    /**
-     * Adds hash code method for class.
-     *
-     * @param attr attribute info
-     * @throws IOException when fails to append to temporary file
-     */
-    private void addHashCodeMethod(JavaAttributeInfo attr) throws IOException {
-        appendToFile(getHashCodeImplTempFileHandle(), getHashCodeMethod(attr) + NEW_LINE);
-    }
-
-    /**
-     * Adds equals method for class.
-     *
-     * @param attr attribute info
-     * @throws IOException when fails to append to temporary file
-     */
-    private void addEqualsMethod(JavaAttributeInfo attr) throws IOException {
-        appendToFile(getEqualsImplTempFileHandle(), getEqualsMethod(attr) + NEW_LINE);
-    }
-
-    /**
-     * Adds ToString method for class.
-     *
-     * @param attr attribute info
-     * @throws IOException when fails to append to temporary file
-     */
-    private void addToStringMethod(JavaAttributeInfo attr) throws IOException {
-        appendToFile(getToStringImplTempFileHandle(), getToStringMethod(attr) + NEW_LINE);
-    }
-
-    /**
-     * Adds enum class attributes to temporary file.
-     *
-     * @param curEnum current YANG enum
-     * @throws IOException when fails to do IO operations.
-     */
-    private void addAttributesForEnumClass(JavaAttributeInfo curEnumInfo) throws IOException {
-        appendToFile(getEnumClassTempFileHandle(),
-                generateEnumAttributeString(curEnumInfo.getAttributeName(), getEnumValue()));
-    }
-
-    /**
-     * Add from string method for union class.
-     *
-     * @param javaAttributeInfo       type attribute info
-     * @param fromStringAttributeInfo from string attribute info
-     * @throws IOException when fails to append to temporary file
-     */
-    private void addFromStringMethod(JavaAttributeInfo javaAttributeInfo,
-                                     JavaAttributeInfo fromStringAttributeInfo) throws IOException {
-        appendToFile(getFromStringImplTempFileHandle(), getFromStringMethod(javaAttributeInfo,
-                fromStringAttributeInfo) + NEW_LINE);
-    }
-
-    /**
-     * Adds rpc string information to applicable temp file.
-     *
-     * @param javaAttributeInfoOfInput  rpc's input node attribute info
-     * @param javaAttributeInfoOfOutput rpc's output node attribute info
-     * @param rpcName                   name of the rpc function
-     * @throws IOException IO operation fail
-     */
-    private void addRpcString(JavaAttributeInfo javaAttributeInfoOfInput, JavaAttributeInfo javaAttributeInfoOfOutput,
-                              String rpcName) throws IOException {
-        String rpcInput = "";
-        String rpcOutput = "void";
-        if (javaAttributeInfoOfInput != null) {
-            rpcInput = javaAttributeInfoOfInput.getAttributeName();
-        }
-        if (javaAttributeInfoOfOutput != null) {
-            rpcOutput = javaAttributeInfoOfOutput.getAttributeName();
-        }
-        appendToFile(getRpcInterfaceImplTempFileHandle(), generateJavaDocForRpc(rpcName, rpcInput, rpcOutput) +
-                getRpcStringMethod(rpcName, rpcInput, rpcOutput) + NEW_LINE);
-    }
-
-    /**
-     * Returns a temporary file handle for the specific file type.
-     *
-     * @param fileName file name
-     * @return temporary file handle
-     * @throws IOException when fails to create new file handle
-     */
-    private File getTemporaryFileHandle(String fileName) throws IOException {
-
-        String path = getTempDirPath();
-        File dir = new File(path);
-        if (!dir.exists()) {
-            dir.mkdirs();
-        }
-
-        File file = new File(path + fileName + TEMP_FILE_EXTENSION);
-        if (!file.exists()) {
-            file.createNewFile();
-        }
-        return file;
-    }
-
-    /**
-     * Returns a temporary file handle for the specific file type.
-     *
-     * @param fileName file name
-     * @return temporary file handle
-     * @throws IOException when fails to create new file handle
-     */
-    private File getJavaFileHandle(String fileName) throws IOException {
-        return getFileObject(getDirPath(), fileName, JAVA_FILE_EXTENSION, getJavaFileInfo());
-    }
-
-    /**
-     * Returns data from the temporary files.
-     *
-     * @param file temporary file handle
-     * @return stored data from temporary files
-     * @throws IOException when failed to get data from the given file
-     */
-    public String getTemporaryDataFromFileHandle(File file) throws IOException {
-
-        String path = getTempDirPath();
-        if (new File(path + file.getName()).exists()) {
-            return readAppendFile(path + file.getName(), EMPTY_STRING);
-        } else {
-            throw new IOException("Unable to get data from the given "
-                    + file.getName() + " file for " + generatedJavaClassName + PERIOD);
-        }
-    }
-
-    /**
-     * Returns temporary directory path.
-     *
-     * @return directory path
-     */
-    private String getTempDirPath() {
-        return getPackageDirPathFromJavaJPackage(absoluteDirPath) + SLASH + generatedJavaClassName
-                + TEMP_FOLDER_NAME_SUFIX + SLASH;
-    }
-
-    /**
-     * Parses attribute to get the attribute string.
-     *
-     * @param attr attribute info
-     * @return attribute string
-     */
-    private String parseAttribute(JavaAttributeInfo attr) {
-
-        /*
-         * TODO: check if this utility needs to be called or move to the caller
-         */
-        String attributeName = getCamelCase(getSmallCase(attr.getAttributeName()), null);
-        if (attr.isQualifiedName()) {
-            return getJavaAttributeDefination(attr.getImportInfo().getPkgInfo(), attr.getImportInfo().getClassInfo(),
-                    attributeName, attr.isListAttr());
-        } else {
-            return getJavaAttributeDefination(null, attr.getImportInfo().getClassInfo(), attributeName,
-                    attr.isListAttr());
-        }
-    }
-
-    /**
-     * Appends content to temporary file.
-     *
-     * @param file temporary file
-     * @param data data to be appended
      * @throws IOException when fails to append to file
      */
-    private void appendToFile(File file, String data) throws IOException {
-
-        try {
-            insertDataIntoJavaFile(file, data);
-        } catch (IOException ex) {
-            throw new IOException("failed to write in temp file.");
+    public String addDefaultConstructor(String modifier, String toAppend)
+            throws IOException {
+        if (getTypeTempFiles() != null) {
+            return getTypeTempFiles()
+                    .addDefaultConstructor(modifier, toAppend);
         }
+
+        if (getBeanTempFiles() != null) {
+            return getBeanTempFiles().addDefaultConstructor(modifier, toAppend);
+        }
+
+        throw new TranslatorException("default constructor should not be added");
+    }
+
+
+    /**
+     * Adds build method's implementation for class.
+     *
+     * @return build method implementation for class
+     * @throws IOException when fails to append to temporary file
+     */
+    public String addBuildMethodImpl()
+            throws IOException {
+        if (getBeanTempFiles() != null) {
+            return getBeanTempFiles().addBuildMethodImpl();
+        }
+
+        throw new TranslatorException("build should not be added");
     }
 
     /**
-     * Adds current node info as and attribute to the parent generated file.
+     * Removes all temporary file handles.
      *
-     * @param curNode current node which needs to be added as an attribute in
-     *                the parent generated code
-     * @param isList  is list construct
-     * @throws IOException IO operation exception
+     * @param isErrorOccurred when translator fails to generate java files we need to close
+     * all open file handles include temporary files and java files.
+     * @throws IOException when failed to delete the temporary files
      */
-    public void addCurNodeInfoInParentTempFile(YangNode curNode,
-                                               boolean isList) throws IOException {
+    public void close(boolean isErrorOccurred)
+            throws IOException {
 
-        YangNode parent = getParentNodeInGenCode(curNode);
-        if (!(parent instanceof JavaCodeGenerator)) {
-            throw new TranslatorException("missing parent node to contain current node info in generated file");
-        }
-        JavaAttributeInfo javaAttributeInfo = getCurNodeAsAttributeInParent(curNode,
-                parent, isList);
-
-        if (!(parent instanceof HasTempJavaCodeFragmentFiles)) {
-            throw new TranslatorException("missing parent temp file handle");
-        }
-        ((HasTempJavaCodeFragmentFiles) parent)
-                .getTempJavaCodeFragmentFiles()
-                .addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo);
-    }
-
-    /**
-     * Adds parent's info to current node import list.
-     *
-     * @param curNode current node for which import list needs to be updated
-     */
-    public void addParentInfoInCurNodeTempFile(YangNode curNode) {
-        caseImportInfo = new JavaQualifiedTypeInfo();
-        YangNode parent = getParentNodeInGenCode(curNode);
-        if (!(parent instanceof JavaCodeGenerator)) {
-            throw new TranslatorException("missing parent node to contain current node info in generated file");
+        if (getBeanTempFiles() != null) {
+            getBeanTempFiles().close(isErrorOccurred);
         }
 
-        if (!(curNode instanceof HasJavaFileInfo)) {
-            throw new TranslatorException("missing java file information to get the package details "
-                    + "of attribute corresponding to child node");
+        if (getTypeTempFiles() != null) {
+            getTypeTempFiles().close(isErrorOccurred);
         }
 
-        caseImportInfo.setClassInfo(getCaptialCase(getCamelCase(parent.getName(), null)));
-        caseImportInfo.setPkgInfo(((HasJavaFileInfo) parent).getJavaFileInfo().getPackage());
-        ((HasJavaImportData) curNode).getJavaImportData().addImportInfo(curNode, caseImportInfo);
-    }
-
-    /**
-     * Adds leaf attributes in generated files.
-     *
-     * @param listOfLeaves list of YANG leaf
-     * @param curNode      current data model node
-     * @throws IOException IO operation fail
-     */
-    private void addLeavesInfoToTempFiles(List<YangLeaf> listOfLeaves,
-                                          YangNode curNode) throws IOException {
-
-        if (listOfLeaves != null) {
-            for (YangLeaf leaf : listOfLeaves) {
-                JavaAttributeInfo javaAttributeInfo = getAttributeInfoOfLeaf(curNode,
-                        leaf.getDataType(),
-                        leaf.getLeafName(), false);
-                addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo);
-            }
+        if (getEnumerationTempFiles() != null) {
+            getEnumerationTempFiles().close(isErrorOccurred);
         }
     }
 
-    /**
-     * Adds leaf list's attributes in generated files.
-     *
-     * @param listOfLeafList list of YANG leaves
-     * @param curNode        cached file handle
-     * @throws IOException IO operation fail
-     */
-    private void addLeafListInfoToTempFiles(List<YangLeafList> listOfLeafList,
-                                            YangNode curNode) throws IOException {
-
-        if (listOfLeafList != null) {
-
-            /*
-             * Check if the attribute is of type list, then the java.lang.list
-             * needs to be imported.
-             */
-            if (!listOfLeafList.isEmpty()) {
-                if (!(curNode instanceof HasJavaImportData)) {
-                    throw new TranslatorException("missing import info in current data model node");
-
-                }
-                ((HasJavaImportData) curNode).getJavaImportData()
-                        .setIfListImported(true);
-
-            }
-
-            for (YangLeafList leafList : listOfLeafList) {
-                JavaAttributeInfo javaAttributeInfo = getAttributeInfoOfLeaf(
-                        curNode, leafList.getDataType(), leafList.getLeafName(),
-                        true);
-                addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo);
-            }
-        }
-    }
-
-    /**
-     * Adds all the leaves in the current data model node as part of the
-     * generated temporary file.
-     *
-     * @param curNode java file info of the generated file
-     * @throws IOException IO operation fail
-     */
-    public void addCurNodeLeavesInfoToTempFiles(YangNode curNode) throws IOException {
-
-        if (curNode instanceof YangLeavesHolder) {
-            YangLeavesHolder leavesHolder = (YangLeavesHolder) curNode;
-            addLeavesInfoToTempFiles(leavesHolder.getListOfLeaf(), curNode);
-            addLeafListInfoToTempFiles(leavesHolder.getListOfLeafList(), curNode);
-        }
-    }
-
-    /**
-     * Add all the type in the current data model node as part of the
-     * generated temporary file.
-     *
-     * @param hasType YANG java data model node which has type info, eg union / typedef
-     * @throws IOException IO operation fail
-     */
-    public void addTypeInfoToTempFiles(HasType hasType) throws IOException {
-
-        List<YangType<?>> typeList = hasType.getTypeList();
-        if (typeList != null) {
-            for (YangType<?> yangType : typeList) {
-                JavaAttributeInfo javaAttributeInfo = getAttributeInfoOfType((YangNode) hasType,
-                        yangType, getTypeName(yangType.getDataTypeName()), false);
-                addJavaSnippetInfoToApplicableTempFiles((YangNode) hasType, javaAttributeInfo);
-            }
-        }
-    }
-
-    private String getTypeName(String dataTypeName) {
-        return dataTypeName;
-        //TODO: implement the method.
-    }
 
     /**
      * Adds enum attributes to temporary files.
@@ -1506,403 +330,15 @@
      * @param curNode current YANG node
      * @throws IOException when fails to do IO operations
      */
-    public void addEnumAttributeToTempFiles(YangNode curNode) throws IOException {
-
-        if (curNode instanceof YangEnumeration) {
-            Set<YangEnum> enumSet = ((YangEnumeration) curNode).getEnumSet();
-            for (YangEnum curEnum : enumSet) {
-                JavaAttributeInfo javaAttributeInfo = getAttributeInfoOfEnumAttribute(curNode, curEnum.getNamedValue());
-                setEnumValue(curEnum.getValue());
-                addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo);
-            }
-        } else {
-            throw new TranslatorException("curnode should be of type enum.");
-        }
-    }
-
-    /**
-     * Adds the new attribute info to the target generated temporary files for union class.
-     *
-     * @param hasType           the node for which the type is being added as an attribute
-     * @param javaAttributeInfo the attribute info that needs to be added to temporary
-     *                          files
-     * @throws IOException IO operation fail
-     */
-    private void addJavaSnippetInfoToApplicableTempFiles(YangNode hasType, JavaAttributeInfo javaAttributeInfo)
+    public void addEnumAttributeToTempFiles(YangNode curNode)
             throws IOException {
 
-        JavaAttributeInfo fromStringAttributeInfo = getFromStringAttributeInfo(hasType, javaAttributeInfo);
-
-        if ((generatedTempFiles & FROM_STRING_IMPL_MASK) != 0) {
-            addFromStringMethod(javaAttributeInfo, fromStringAttributeInfo);
+        if (getEnumerationTempFiles() != null) {
+            getEnumerationTempFiles().addEnumAttributeToTempFiles(curNode);
+            return;
         }
-        addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo);
+
+        throw new TranslatorException("build should not be added");
     }
 
-    /**
-     * Adds the JAVA rpc snippet information.
-     *
-     * @param javaAttributeInfoOfInput  rpc's input node attribute info
-     * @param javaAttributeInfoOfOutput rpc's output node attribute info
-     * @param rpcName                   name of the rpc function
-     * @throws IOException IO operation fail
-     */
-    public void addJavaSnippetInfoToApplicableTempFiles(JavaAttributeInfo javaAttributeInfoOfInput,
-                                                        JavaAttributeInfo javaAttributeInfoOfOutput,
-                                                        String rpcName) throws IOException {
-        if ((generatedTempFiles & RPC_IMPL_MASK) != 0) {
-            addRpcString(javaAttributeInfoOfInput, javaAttributeInfoOfOutput, rpcName);
-        }
-    }
-
-    /**
-     * Adds the new attribute info to the target generated temporary files.
-     *
-     * @param newAttrInfo the attribute info that needs to be added to temporary
-     *                    files
-     * @throws IOException IO operation fail
-     */
-    void addJavaSnippetInfoToApplicableTempFiles(JavaAttributeInfo newAttrInfo)
-            throws IOException {
-
-        setNewAttrInfo(newAttrInfo);
-        if (isAttributePresent) {
-            if ((generatedTempFiles & ATTRIBUTES_MASK) != 0) {
-                addAttribute(newAttrInfo);
-            }
-
-            if ((generatedTempFiles & GETTER_FOR_INTERFACE_MASK) != 0) {
-                addGetterForInterface(newAttrInfo);
-            }
-
-            if ((generatedTempFiles & SETTER_FOR_INTERFACE_MASK) != 0) {
-                addSetterForInterface(newAttrInfo);
-            }
-
-            if ((generatedTempFiles & GETTER_FOR_CLASS_MASK) != 0) {
-                addGetterImpl(newAttrInfo, generatedJavaFiles);
-            }
-
-            if ((generatedTempFiles & SETTER_FOR_CLASS_MASK) != 0) {
-                addSetterImpl(newAttrInfo);
-            }
-
-            if ((generatedTempFiles & CONSTRUCTOR_IMPL_MASK) != 0) {
-                addConstructor(newAttrInfo);
-            }
-
-            if ((generatedTempFiles & HASH_CODE_IMPL_MASK) != 0) {
-                addHashCodeMethod(newAttrInfo);
-            }
-
-            if ((generatedTempFiles & EQUALS_IMPL_MASK) != 0) {
-                addEqualsMethod(newAttrInfo);
-            }
-
-            if ((generatedTempFiles & TO_STRING_IMPL_MASK) != 0) {
-                addToStringMethod(newAttrInfo);
-            }
-
-            if ((generatedTempFiles & ENUM_IMPL_MASK) != 0) {
-                addAttributesForEnumClass(newAttrInfo);
-            }
-
-            if ((generatedTempFiles & OF_STRING_IMPL_MASK) != 0) {
-                addOfStringMethod(newAttrInfo);
-            }
-
-            if ((generatedTempFiles & CONSTRUCTOR_FOR_TYPE_MASK) != 0) {
-                addTypeConstructor(newAttrInfo);
-            }
-
-        }
-    }
-
-    /**
-     * Returns java file info.
-     *
-     * @return java file info
-     */
-    private JavaFileInfo getJavaFileInfo() {
-        return ((HasJavaFileInfo) getCurYangNode()).getJavaFileInfo();
-    }
-
-    /**
-     * Returns java class name.
-     *
-     * @param suffix for the class name based on the file type
-     * @return java class name
-     */
-    private String getJavaClassName(String suffix) {
-        return getCaptialCase(getJavaFileInfo().getJavaName()) + suffix;
-    }
-
-    /**
-     * Returns the directory path.
-     *
-     * @return directory path
-     */
-    private String getDirPath() {
-        return getJavaFileInfo().getPackageFilePath();
-    }
-
-    /**
-     * Constructs java code exit.
-     *
-     * @param fileType generated file type
-     * @param curNode  current YANG node
-     * @throws IOException when fails to generate java files
-     */
-    public void generateJavaFile(int fileType, YangNode curNode) throws IOException {
-
-        setCurYangNode(curNode);
-        List<String> imports = new ArrayList<>();
-        if (curNode instanceof HasJavaImportData && isAttributePresent) {
-            imports = ((HasJavaImportData) curNode).getJavaImportData().getImports(getNewAttrInfo());
-        }
-
-        /**
-         * Prepares java file generator for extends list.
-         */
-        prepareJavaFileGeneratorForExtendsList(getExtendsList());
-        if (curNode.getNodeType().equals(MODULE_NODE)) {
-            createPackage(absoluteDirPath, getJavaFileInfo().getJavaName());
-        } else {
-            createPackage(absoluteDirPath, ((HasJavaFileInfo) curNode.getParent()).getJavaFileInfo().getJavaName()
-                    + PACKAGE_INFO_JAVADOC_OF_CHILD);
-        }
-        /**
-         * Generate java code.
-         */
-        if ((fileType & INTERFACE_MASK) != 0 | (fileType & BUILDER_INTERFACE_MASK) != 0) {
-
-            /**
-             * Adds import for case.
-             */
-            if (curNode instanceof YangCase) {
-                List<String> importData = ((HasJavaImportData) curNode).getJavaImportData().getImports();
-                for (String  importInfo : importData) {
-                    if (!imports.contains(importInfo)) {
-                        imports.add(importInfo);
-                    }
-                }
-            }
-
-            /**
-             * Adds import for HasAugmentation class.
-             */
-            if (isHasAugmentationExtended(getExtendsList())) {
-                addHasAugmentationImport(curNode, imports, true);
-            }
-
-            if (isAugmentedInfoExtended(getExtendsList())) {
-                addAugmentedInfoImport(curNode, imports, true);
-            }
-
-            /**
-             * Create interface file.
-             */
-            setInterfaceJavaFileHandle(getJavaFileHandle(getJavaClassName(INTERFACE_FILE_NAME_SUFFIX)));
-            setInterfaceJavaFileHandle(
-                    generateInterfaceFile(getInterfaceJavaFileHandle(), imports, curNode, isAttributePresent));
-            /**
-             * Create builder interface file.
-             */
-            if ((fileType & BUILDER_INTERFACE_MASK) != 0) {
-
-                setBuilderInterfaceJavaFileHandle(
-                        getJavaFileHandle(getJavaClassName(BUILDER_INTERFACE_FILE_NAME_SUFFIX)));
-                setBuilderInterfaceJavaFileHandle(
-                        generateBuilderInterfaceFile(getBuilderInterfaceJavaFileHandle(), curNode, isAttributePresent));
-                /**
-                 * Append builder interface file to interface file and close it.
-                 */
-                mergeJavaFiles(getBuilderInterfaceJavaFileHandle(), getInterfaceJavaFileHandle());
-            }
-            insertDataIntoJavaFile(getInterfaceJavaFileHandle(), getJavaClassDefClose());
-
-            if (isHasAugmentationExtended(getExtendsList())) {
-                addHasAugmentationImport(curNode, imports, false);
-            }
-            if (isAugmentedInfoExtended(getExtendsList())) {
-                addAugmentedInfoImport(curNode, imports, false);
-            }
-
-            if (curNode instanceof YangCase) {
-                removeCaseImport(imports);
-            }
-        }
-
-        if ((fileType & BUILDER_CLASS_MASK) != 0 | (fileType & IMPL_CLASS_MASK) != 0) {
-
-            if (isAttributePresent) {
-                addImportsToStringAndHasCodeMethods(curNode, imports);
-            }
-            if (isHasAugmentationExtended(getExtendsList())) {
-                addAugmentedInfoImport(curNode, imports, true);
-                addArrayListImport(curNode, imports, true);
-            }
-
-            /**
-             * Create builder class file.
-             */
-            setBuilderClassJavaFileHandle(getJavaFileHandle(getJavaClassName(BUILDER_CLASS_FILE_NAME_SUFFIX)));
-            setBuilderClassJavaFileHandle(
-                    generateBuilderClassFile(getBuilderClassJavaFileHandle(), imports, curNode, isAttributePresent));
-            /**
-             * Create impl class file.
-             */
-            if ((fileType & IMPL_CLASS_MASK) != 0) {
-                setImplClassJavaFileHandle(getJavaFileHandle(getJavaClassName(IMPL_CLASS_FILE_NAME_SUFFIX)));
-                setImplClassJavaFileHandle(
-                        generateImplClassFile(getImplClassJavaFileHandle(), curNode, isAttributePresent));
-                /**
-                 * Append impl class to builder class and close it.
-                 */
-                mergeJavaFiles(getImplClassJavaFileHandle(), getBuilderClassJavaFileHandle());
-            }
-            insertDataIntoJavaFile(getBuilderClassJavaFileHandle(), getJavaClassDefClose());
-        }
-
-        /**
-         * Creates type def class file.
-         */
-        if ((fileType & GENERATE_TYPEDEF_CLASS) != 0) {
-            addImportsToStringAndHasCodeMethods(curNode, imports);
-            setTypedefClassJavaFileHandle(getJavaFileHandle(getJavaClassName(TYPEDEF_CLASS_FILE_NAME_SUFFIX)));
-            setTypedefClassJavaFileHandle(generateTypeDefClassFile(getTypedefClassJavaFileHandle(), curNode, imports));
-        }
-
-        /**
-         * Creates type class file.
-         */
-        if ((fileType & GENERATE_UNION_CLASS) != 0) {
-            addImportsToStringAndHasCodeMethods(curNode, imports);
-            setTypeClassJavaFileHandle(getJavaFileHandle(getJavaClassName(UNION_TYPE_CLASS_FILE_NAME_SUFFIX)));
-            setTypeClassJavaFileHandle(generateUnionClassFile(getTypeClassJavaFileHandle(), curNode, imports));
-        }
-
-        /**
-         * Creates type enum class file.
-         */
-        if ((fileType & GENERATE_ENUM_CLASS) != 0) {
-            setEnumClassJavaFileHandle(getJavaFileHandle(getJavaClassName(ENUM_CLASS_FILE_NAME_SUFFIX)));
-            setEnumClassJavaFileHandle(generateEnumClassFile(getEnumClassJavaFileHandle(), curNode));
-        }
-
-        /**
-         * Creates rpc interface file.
-         */
-        if ((fileType & GENERATE_RPC_INTERFACE) != 0) {
-            setRpcInterfaceJavaFileHandle(getJavaFileHandle(getJavaClassName(RPC_INTERFACE_FILE_NAME_SUFFIX)));
-            setRpcInterfaceJavaFileHandle(generateRpcInterfaceFile(getRpcInterfaceJavaFileHandle(), curNode, imports));
-        }
-
-        /**
-         * Close all the file handles.
-         */
-        close(false);
-    }
-
-    /**
-     * Removes case import info from import list.
-     *
-     * @param imports list of imports
-     * @return import for class
-     */
-    private List<String> removeCaseImport(List<String> imports) {
-        if (imports != null && caseImportInfo != null) {
-            String caseImport = IMPORT + caseImportInfo.getPkgInfo() + PERIOD + caseImportInfo.getClassInfo() +
-                    SEMI_COLAN + NEW_LINE;
-            imports.remove(caseImport);
-        }
-        return imports;
-    }
-
-    /**
-     * Removes all temporary file handles.
-     *
-     * @param isErrorOccurred when translator fails to generate java files we need to close
-     *                        all open file handles include temporary files and java files.
-     * @throws IOException when failed to delete the temporary files
-     */
-    public void close(boolean isErrorOccurred) throws IOException {
-
-        boolean isError = isErrorOccurred;
-        /**
-         * Close all java file handles and when error occurs delete the files.
-         */
-        if ((generatedJavaFiles & INTERFACE_MASK) != 0) {
-            closeFile(getInterfaceJavaFileHandle(), isError);
-        }
-        if ((generatedJavaFiles & BUILDER_CLASS_MASK) != 0) {
-            closeFile(getBuilderClassJavaFileHandle(), isError);
-        }
-        if ((generatedJavaFiles & BUILDER_INTERFACE_MASK) != 0) {
-            closeFile(getBuilderInterfaceJavaFileHandle(), true);
-        }
-        if ((generatedJavaFiles & IMPL_CLASS_MASK) != 0) {
-            closeFile(getImplClassJavaFileHandle(), true);
-        }
-        if ((generatedJavaFiles & GENERATE_TYPEDEF_CLASS) != 0) {
-            closeFile(getTypedefClassJavaFileHandle(), isError);
-        }
-        if ((generatedJavaFiles & GENERATE_ENUM_CLASS) != 0) {
-            closeFile(getEnumClassJavaFileHandle(), isError);
-        }
-        if ((generatedJavaFiles & GENERATE_UNION_CLASS) != 0) {
-            closeFile(getTypeClassJavaFileHandle(), isError);
-        }
-        if ((generatedJavaFiles & GENERATE_RPC_INTERFACE) != 0) {
-            closeFile(getRpcInterfaceJavaFileHandle(), isError);
-        }
-
-        /**
-         * Close all temporary file handles and delete the files.
-         */
-        if ((generatedTempFiles & GETTER_FOR_INTERFACE_MASK) != 0) {
-            closeFile(getGetterInterfaceTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & GETTER_FOR_CLASS_MASK) != 0) {
-            closeFile(getGetterImplTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & SETTER_FOR_INTERFACE_MASK) != 0) {
-            closeFile(getSetterInterfaceTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & SETTER_FOR_CLASS_MASK) != 0) {
-            closeFile(getSetterImplTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & CONSTRUCTOR_IMPL_MASK) != 0) {
-            closeFile(getConstructorImplTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & ATTRIBUTES_MASK) != 0) {
-            closeFile(getAttributesTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & HASH_CODE_IMPL_MASK) != 0) {
-            closeFile(getHashCodeImplTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & TO_STRING_IMPL_MASK) != 0) {
-            closeFile(getToStringImplTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & EQUALS_IMPL_MASK) != 0) {
-            closeFile(getEqualsImplTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & ENUM_IMPL_MASK) != 0) {
-            closeFile(getEnumClassTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & CONSTRUCTOR_FOR_TYPE_MASK) != 0) {
-            closeFile(getConstructorForTypeTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & OF_STRING_IMPL_MASK) != 0) {
-            closeFile(getOfStringImplTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & FROM_STRING_IMPL_MASK) != 0) {
-            closeFile(getFromStringImplTempFileHandle(), true);
-        }
-        if ((generatedTempFiles & RPC_IMPL_MASK) != 0) {
-            closeFile(getRpcInterfaceImplTempFileHandle(), true);
-        }
-        clean(getTempDirPath());
-        generatedTempFiles = 0;
-    }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasTempJavaCodeFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFilesContainer.java
similarity index 94%
rename from utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasTempJavaCodeFragmentFiles.java
rename to utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFilesContainer.java
index 9b67ccf..1bbf349 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/HasTempJavaCodeFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFilesContainer.java
@@ -18,7 +18,7 @@
 /**
  * Represents Has temporary file handle.
  */
-public interface HasTempJavaCodeFragmentFiles {
+public interface TempJavaCodeFragmentFilesContainer {
 
     /**
      * Returns the temporary file handle.
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEnumerationFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEnumerationFragmentFiles.java
new file mode 100644
index 0000000..4537b2f
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEnumerationFragmentFiles.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yangutils.translator.tojava;
+
+import java.io.IOException;
+
+/**
+ * Represents implementation of java code fragments temporary implementations.
+ */
+public class TempJavaEnumerationFragmentFiles
+        extends TempJavaFragmentFiles {
+
+    /**
+     * Creates an instance of temporary java code fragment.
+     *
+     * @param javaFileInfo generated java file info
+     * @throws IOException when fails to create new file handle
+     */
+    public TempJavaEnumerationFragmentFiles(JavaFileInfo javaFileInfo)
+            throws IOException {
+        super(javaFileInfo);
+    }
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
new file mode 100644
index 0000000..24fd71d
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
@@ -0,0 +1,1978 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yangutils.translator.tojava;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.onosproject.yangutils.datamodel.YangTypeContainer;
+import org.onosproject.yangutils.datamodel.YangCase;
+import org.onosproject.yangutils.datamodel.YangEnum;
+import org.onosproject.yangutils.datamodel.YangEnumeration;
+import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.datamodel.YangLeavesHolder;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangRpc;
+import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.translator.exception.TranslatorException;
+import org.onosproject.yangutils.translator.tojava.javamodel.JavaLeafInfoContainer;
+import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaType;
+
+import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ENUM_CLASS;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_RPC_INTERFACE;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_TYPEDEF_CLASS;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.IMPL_CLASS_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.INTERFACE_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.ATTRIBUTES_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.CONSTRUCTOR_FOR_TYPE_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.CONSTRUCTOR_IMPL_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.ENUM_IMPL_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.EQUALS_IMPL_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.FROM_STRING_IMPL_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.GETTER_FOR_CLASS_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.GETTER_FOR_INTERFACE_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.HASH_CODE_IMPL_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.OF_STRING_IMPL_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.RPC_IMPL_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_CLASS_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK;
+import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData;
+import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedInfoOfFromString;
+import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.generateEnumAttributeString;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaAttributeDefination;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaClassDefClose;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateBuilderClassFile;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateBuilderInterfaceFile;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateEnumClassFile;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateImplClassFile;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateInterfaceFile;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateRpcInterfaceFile;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateTypeDefClassFile;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateUnionClassFile;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getFileObject;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getParentNodeInGenCode;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuildString;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getConstructor;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getDefaultConstructorString;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getEqualsMethod;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getFromStringMethod;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getGetterForClass;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getGetterString;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getHashCodeMethod;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getOfMethod;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getOfMethodStringAndJavaDoc;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getOverRideString;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getRpcStringMethod;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getSetterForClass;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getSetterString;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getToStringMethod;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getTypeConstructorStringAndJavaDoc;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.parseBuilderInterfaceBuildMethodString;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addArrayListImport;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addAugmentedInfoImport;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addHasAugmentationImport;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils
+        .addImportsToStringAndHasCodeMethods;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.closeFile;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.isAugmentedInfoExtended;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils
+        .isHasAugmentationExtended;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils
+        .prepareJavaFileGeneratorForExtendsList;
+import static org.onosproject.yangutils.utils.UtilConstants.BUILDER;
+import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
+import static org.onosproject.yangutils.utils.UtilConstants.FOUR_SPACE_INDENTATION;
+import static org.onosproject.yangutils.utils.UtilConstants.IMPL;
+import static org.onosproject.yangutils.utils.UtilConstants.IMPORT;
+import static org.onosproject.yangutils.utils.UtilConstants.INTERFACE;
+import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
+import static org.onosproject.yangutils.utils.UtilConstants.PACKAGE_INFO_JAVADOC_OF_CHILD;
+import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
+import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN;
+import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
+import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage;
+import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.readAppendFile;
+import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.GETTER_METHOD;
+import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.OF_METHOD;
+import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.generateJavaDocForRpc;
+import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.clean;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.insertDataIntoJavaFile;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.mergeJavaFiles;
+
+/**
+ * Represents implementation of java code fragments temporary implementations.
+ */
+public class TempJavaFragmentFiles {
+    /**
+     * Information about the java files being generated.
+     */
+    private JavaFileInfo javaFileInfo;
+    /**
+     * Imported class info.
+     */
+    private JavaImportData javaImportData;
+    /**
+     * The variable which guides the types of temporary files generated using
+     * the temporary generated file types mask.
+     */
+    private int generatedTempFiles;
+    /**
+     * Absolute path where the target java file needs to be generated.
+     */
+    private String absoluteDirPath;
+    /**
+     * Contains all the class name which will be extended by generated files.
+     */
+    private List<String> extendsList = new ArrayList<>();
+    /**
+     * File type extension for java classes.
+     */
+    private static final String JAVA_FILE_EXTENSION = ".java";
+    /**
+     * File type extension for temporary classes.
+     */
+    private static final String TEMP_FILE_EXTENSION = ".tmp";
+    /**
+     * Folder suffix for temporary files folder.
+     */
+    private static final String TEMP_FOLDER_NAME_SUFIX = "-Temp";
+    /**
+     * File name for getter method.
+     */
+    private static final String GETTER_METHOD_FILE_NAME = "GetterMethod";
+    /**
+     * File name for getter method implementation.
+     */
+    private static final String GETTER_METHOD_IMPL_FILE_NAME = "GetterMethodImpl";
+    /**
+     * File name for setter method.
+     */
+    private static final String SETTER_METHOD_FILE_NAME = "SetterMethod";
+    /**
+     * File name for setter method implementation.
+     */
+    private static final String SETTER_METHOD_IMPL_FILE_NAME = "SetterMethodImpl";
+    /**
+     * File name for constructor.
+     */
+    private static final String CONSTRUCTOR_FILE_NAME = "Constructor";
+    /**
+     * File name for attributes.
+     */
+    private static final String ATTRIBUTE_FILE_NAME = "Attributes";
+    /**
+     * File name for to string method.
+     */
+    private static final String TO_STRING_METHOD_FILE_NAME = "ToString";
+    /**
+     * File name for hash code method.
+     */
+    private static final String HASH_CODE_METHOD_FILE_NAME = "HashCode";
+    /**
+     * File name for equals method.
+     */
+    private static final String EQUALS_METHOD_FILE_NAME = "Equals";
+    /**
+     * File name for of string method.
+     */
+    private static final String OF_STRING_METHOD_FILE_NAME = "OfString";
+    /**
+     * File name for temporary enum class.
+     */
+    private static final String ENUM_CLASS_TEMP_FILE_NAME = "EnumClass";
+    /**
+     * File name for construction for special type like union, typedef.
+     */
+    private static final String CONSTRUCTOR_FOR_TYPE_FILE_NAME = "ConstructorForType";
+    /**
+     * File name for from string method.
+     */
+    private static final String FROM_STRING_METHOD_FILE_NAME = "FromString";
+    /**
+     * File name for interface java file name suffix.
+     */
+    private static final String INTERFACE_FILE_NAME_SUFFIX = EMPTY_STRING;
+    /**
+     * File name for builder interface file name suffix.
+     */
+    private static final String BUILDER_INTERFACE_FILE_NAME_SUFFIX = BUILDER + INTERFACE;
+    /**
+     * File name for builder class file name suffix.
+     */
+    private static final String BUILDER_CLASS_FILE_NAME_SUFFIX = BUILDER;
+    /**
+     * File name for impl class file name suffix.
+     */
+    private static final String IMPL_CLASS_FILE_NAME_SUFFIX = IMPL;
+    /**
+     * File name for typedef class file name suffix.
+     */
+    private static final String TYPEDEF_CLASS_FILE_NAME_SUFFIX = EMPTY_STRING;
+    /**
+     * File name for enum class file name suffix.
+     */
+    private static final String ENUM_CLASS_FILE_NAME_SUFFIX = EMPTY_STRING;
+    /**
+     * File name for rpc method.
+     */
+    private static final String RPC_FILE_NAME = "Rpc";
+    /**
+     * File name for generated class file for special type like union, typedef
+     * suffix.
+     */
+    private static final String RPC_INTERFACE_FILE_NAME_SUFFIX = "Service";
+    /**
+     * File name for generated class file for special type like union, typedef
+     * suffix.
+     */
+    private static final String UNION_TYPE_CLASS_FILE_NAME_SUFFIX = EMPTY_STRING;
+    /**
+     * Java file handle for interface file.
+     */
+    private File interfaceJavaFileHandle;
+    /**
+     * Java file handle for builder interface file.
+     */
+    private File builderInterfaceJavaFileHandle;
+    /**
+     * Java file handle for builder class file.
+     */
+    private File builderClassJavaFileHandle;
+    /**
+     * Java file handle for impl class file.
+     */
+    private File implClassJavaFileHandle;
+    /**
+     * Java file handle for typedef class file.
+     */
+    private File typedefClassJavaFileHandle;
+    /**
+     * Java file handle for type class like union, typedef file.
+     */
+    private File typeClassJavaFileHandle;
+    /**
+     * Temporary file handle for attribute.
+     */
+    private File attributesTempFileHandle;
+    /**
+     * Temporary file handle for getter of interface.
+     */
+    private File getterInterfaceTempFileHandle;
+    /**
+     * Temporary file handle for getter of class.
+     */
+    private File getterImplTempFileHandle;
+    /**
+     * Temporary file handle for setter of interface.
+     */
+    private File setterInterfaceTempFileHandle;
+    /**
+     * Temporary file handle for setter of class.
+     */
+    private File setterImplTempFileHandle;
+    /**
+     * Temporary file handle for constructor of class.
+     */
+    private File constructorImplTempFileHandle;
+    /**
+     * Temporary file handle for hash code method of class.
+     */
+    private File hashCodeImplTempFileHandle;
+    /**
+     * Temporary file handle for equals method of class.
+     */
+    private File equalsImplTempFileHandle;
+    /**
+     * Temporary file handle for to string method of class.
+     */
+    private File toStringImplTempFileHandle;
+    /**
+     * Temporary file handle for enum class file.
+     */
+    private File enumClassTempFileHandle;
+    /**
+     * Temporary file handle for of string method of class.
+     */
+    private File ofStringImplTempFileHandle;
+    /**
+     * Temporary file handle for constructor for type class.
+     */
+    private File constructorForTypeTempFileHandle;
+    /**
+     * Temporary file handle for from string method of class.
+     */
+    private File fromStringImplTempFileHandle;
+    /**
+     * Temporary file handle for rpc interface.
+     */
+    private File rpcInterfaceImplTempFileHandle;
+    /**
+     * Java file handle for rpc interface file.
+     */
+    private File rpcInterfaceJavaFileHandle;
+    /**
+     * Import info for case.
+     */
+    private JavaQualifiedTypeInfo caseImportInfo;
+    /**
+     * Is attribute added.
+     */
+    private boolean isAttributePresent = false;
+    /**
+     * Current enum's value.
+     */
+    private int enumValue;
+    /*
+     * Java file handle for enum class.
+     */
+    private File enumClassJavaFileHandle;
+
+    /**
+     * Returns enum class java file handle.
+     *
+     * @return enum class java file handle
+     */
+    private File getEnumClassJavaFileHandle() {
+        return enumClassJavaFileHandle;
+    }
+
+    /**
+     * Sets enum class java file handle.
+     *
+     * @param enumClassJavaFileHandle enum class java file handle
+     */
+    private void setEnumClassJavaFileHandle(File enumClassJavaFileHandle) {
+        this.enumClassJavaFileHandle = enumClassJavaFileHandle;
+    }
+
+    /**
+     * Returns enum's value.
+     *
+     * @return enum's value
+     */
+    private int getEnumValue() {
+        return enumValue;
+    }
+
+    /**
+     * Sets enum's value.
+     *
+     * @param enumValue enum's value
+     */
+    private void setEnumValue(int enumValue) {
+        this.enumValue = enumValue;
+    }
+
+    /**
+     * Retrieves the absolute path where the file needs to be generated.
+     *
+     * @return absolute path where the file needs to be generated
+     */
+    private String getAbsoluteDirPath() {
+        return absoluteDirPath;
+    }
+
+    /**
+     * Sets absolute path where the file needs to be generated.
+     *
+     * @param absoluteDirPath absolute path where the file needs to be
+     * generated.
+     */
+    private void setAbsoluteDirPath(String absoluteDirPath) {
+        this.absoluteDirPath = absoluteDirPath;
+    }
+
+    /**
+     * Sets the generated java file information.
+     *
+     * @param javaFileInfo generated java file information
+     */
+    public void setJavaFileInfo(JavaFileInfo javaFileInfo) {
+        this.javaFileInfo = javaFileInfo;
+    }
+
+    /**
+     * Retrieves the generated java file information.
+     *
+     * @return generated java file information
+     */
+    public JavaFileInfo getJavaFileInfo() {
+        return javaFileInfo;
+    }
+
+    /**
+     * Retrieves the generated temp files.
+     *
+     * @return generated temp files
+     */
+    private int getGeneratedTempFiles() {
+        return generatedTempFiles;
+    }
+
+    /**
+     * Sets generated file files.
+     */
+    private void clearGeneratedTempFiles() {
+        generatedTempFiles = 0;
+    }
+
+    /**
+     * Sets generated file files.
+     *
+     * @param generatedTempFile generated file
+     */
+    private void addGeneratedTempFile(int generatedTempFile) {
+        generatedTempFiles |= generatedTempFile;
+    }
+
+    /**
+     * Retrieves the generated Java files.
+     *
+     * @return generated Java files
+     */
+    private int getGeneratedJavaFiles() {
+        return getJavaFileInfo().getGeneratedFileTypes();
+    }
+
+    /**
+     * Retrieves the mapped Java class name.
+     *
+     * @return mapped Java class name
+     */
+    private String getGeneratedJavaClassName() {
+        return getJavaFileInfo().getJavaName();
+    }
+
+    /**
+     * Retrieves the import data for the generated Java file.
+     *
+     * @return import data for the generated Java file
+     */
+    public JavaImportData getJavaImportData() {
+        return javaImportData;
+    }
+
+    /**
+     * Sets import data for the generated Java file.
+     *
+     * @param javaImportData import data for the generated Java file
+     */
+    private void setJavaImportData(JavaImportData javaImportData) {
+        this.javaImportData = javaImportData;
+    }
+
+    /**
+     * Creates an instance of temporary java code fragment.
+     *
+     * @param javaFileInfo generated java file information
+     * @throws IOException when fails to create new file handle
+     */
+    TempJavaFragmentFiles(JavaFileInfo javaFileInfo)
+            throws IOException {
+        setExtendsList(new ArrayList<>());
+        setJavaImportData(new JavaImportData());
+        setJavaFileInfo(javaFileInfo);
+        clearGeneratedTempFiles();
+        setAbsoluteDirPath(getAbsolutePackagePath(getJavaFileInfo().getBaseCodeGenPath(),
+                getJavaFileInfo().getPackageFilePath()));
+        /**
+         * Initialize getter when generation file type matches to interface
+         * mask.
+         */
+        if ((getGeneratedJavaFiles() & INTERFACE_MASK) != 0) {
+            addGeneratedTempFile(GETTER_FOR_INTERFACE_MASK);
+        }
+        /**
+         * Initialize getter and setter when generation file type matches to
+         * builder interface mask.
+         */
+        if ((getGeneratedJavaFiles() & BUILDER_INTERFACE_MASK) != 0) {
+            addGeneratedTempFile(GETTER_FOR_INTERFACE_MASK);
+            addGeneratedTempFile(SETTER_FOR_INTERFACE_MASK);
+        }
+        /**
+         * Initialize getterImpl, setterImpl and attributes when generation file
+         * type matches to builder class mask.
+         */
+        if ((getGeneratedJavaFiles() & BUILDER_CLASS_MASK) != 0) {
+            addGeneratedTempFile(ATTRIBUTES_MASK);
+            addGeneratedTempFile(GETTER_FOR_CLASS_MASK);
+            addGeneratedTempFile(SETTER_FOR_CLASS_MASK);
+        }
+        /**
+         * Initialize getterImpl, attributes, constructor, hash code, equals and
+         * to strings when generation file type matches to impl class mask.
+         */
+        if ((getGeneratedJavaFiles() & IMPL_CLASS_MASK) != 0) {
+            addGeneratedTempFile(ATTRIBUTES_MASK);
+            addGeneratedTempFile(GETTER_FOR_CLASS_MASK);
+            addGeneratedTempFile(CONSTRUCTOR_IMPL_MASK);
+            addGeneratedTempFile(HASH_CODE_IMPL_MASK);
+            addGeneratedTempFile(EQUALS_IMPL_MASK);
+            addGeneratedTempFile(TO_STRING_IMPL_MASK);
+        }
+        if ((getGeneratedJavaFiles() & GENERATE_RPC_INTERFACE) != 0) {
+            addGeneratedTempFile(RPC_IMPL_MASK);
+        }
+        /**
+         * Initialize getterImpl, attributes, hash code, equals and to strings
+         * when generation file type matches to typeDef class mask.
+         */
+        if ((getGeneratedJavaFiles() & GENERATE_TYPEDEF_CLASS) != 0) {
+            addGeneratedTempFile(ATTRIBUTES_MASK);
+            addGeneratedTempFile(GETTER_FOR_CLASS_MASK);
+            addGeneratedTempFile(HASH_CODE_IMPL_MASK);
+            addGeneratedTempFile(EQUALS_IMPL_MASK);
+            addGeneratedTempFile(TO_STRING_IMPL_MASK);
+            addGeneratedTempFile(OF_STRING_IMPL_MASK);
+            addGeneratedTempFile(CONSTRUCTOR_FOR_TYPE_MASK);
+            addGeneratedTempFile(FROM_STRING_IMPL_MASK);
+        }
+        /**
+         * Initialize getterImpl, attributes, hash code, equals, of string,
+         * constructor, union's to string, from string when generation file type
+         * matches to union class mask.
+         */
+        if ((getGeneratedJavaFiles() & GENERATE_UNION_CLASS) != 0) {
+            addGeneratedTempFile(ATTRIBUTES_MASK);
+            addGeneratedTempFile(GETTER_FOR_CLASS_MASK);
+            addGeneratedTempFile(HASH_CODE_IMPL_MASK);
+            addGeneratedTempFile(EQUALS_IMPL_MASK);
+            addGeneratedTempFile(OF_STRING_IMPL_MASK);
+            addGeneratedTempFile(CONSTRUCTOR_FOR_TYPE_MASK);
+            addGeneratedTempFile(TO_STRING_IMPL_MASK);
+            addGeneratedTempFile(FROM_STRING_IMPL_MASK);
+        }
+        /**
+         * Initialize enum when generation file type matches to enum class mask.
+         */
+        if ((getGeneratedJavaFiles() & GENERATE_ENUM_CLASS) != 0) {
+            addGeneratedTempFile(ENUM_IMPL_MASK);
+        }
+        /**
+         * Set temporary file handles.
+         */
+        if ((getGeneratedTempFiles() & ATTRIBUTES_MASK) != 0) {
+            setAttributesTempFileHandle(getTemporaryFileHandle(ATTRIBUTE_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & GETTER_FOR_INTERFACE_MASK) != 0) {
+            setGetterInterfaceTempFileHandle(getTemporaryFileHandle(GETTER_METHOD_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & SETTER_FOR_INTERFACE_MASK) != 0) {
+            setSetterInterfaceTempFileHandle(getTemporaryFileHandle(SETTER_METHOD_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & GETTER_FOR_CLASS_MASK) != 0) {
+            setGetterImplTempFileHandle(getTemporaryFileHandle(GETTER_METHOD_IMPL_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & SETTER_FOR_CLASS_MASK) != 0) {
+            setSetterImplTempFileHandle(getTemporaryFileHandle(SETTER_METHOD_IMPL_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & CONSTRUCTOR_IMPL_MASK) != 0) {
+            setConstructorImplTempFileHandle(getTemporaryFileHandle(CONSTRUCTOR_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & HASH_CODE_IMPL_MASK) != 0) {
+            setHashCodeImplTempFileHandle(getTemporaryFileHandle(HASH_CODE_METHOD_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & EQUALS_IMPL_MASK) != 0) {
+            setEqualsImplTempFileHandle(getTemporaryFileHandle(EQUALS_METHOD_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & TO_STRING_IMPL_MASK) != 0) {
+            setToStringImplTempFileHandle(getTemporaryFileHandle(TO_STRING_METHOD_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & ENUM_IMPL_MASK) != 0) {
+            setEnumClassTempFileHandle(getTemporaryFileHandle(ENUM_CLASS_TEMP_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & OF_STRING_IMPL_MASK) != 0) {
+            setOfStringImplTempFileHandle(getTemporaryFileHandle(OF_STRING_METHOD_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & CONSTRUCTOR_FOR_TYPE_MASK) != 0) {
+            setConstructorForTypeTempFileHandle(getTemporaryFileHandle(CONSTRUCTOR_FOR_TYPE_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & FROM_STRING_IMPL_MASK) != 0) {
+            setFromStringImplTempFileHandle(getTemporaryFileHandle(FROM_STRING_METHOD_FILE_NAME));
+        }
+        if ((getGeneratedTempFiles() & RPC_IMPL_MASK) != 0) {
+            setRpcInterfaceImplTempFileHandle(getTemporaryFileHandle(RPC_FILE_NAME));
+        }
+    }
+
+    /**
+     * Returns java file handle for interface file.
+     *
+     * @return java file handle for interface file
+     */
+    private File getInterfaceJavaFileHandle() {
+        return interfaceJavaFileHandle;
+    }
+
+    /**
+     * Sets the java file handle for interface file.
+     *
+     * @param interfaceJavaFileHandle java file handle
+     */
+    private void setInterfaceJavaFileHandle(File interfaceJavaFileHandle) {
+        this.interfaceJavaFileHandle = interfaceJavaFileHandle;
+    }
+
+    /**
+     * Returns java file handle for builder interface file.
+     *
+     * @return java file handle for builder interface file
+     */
+    private File getBuilderInterfaceJavaFileHandle() {
+        return builderInterfaceJavaFileHandle;
+    }
+
+    /**
+     * Sets the java file handle for builder interface file.
+     *
+     * @param builderInterfaceJavaFileHandle java file handle
+     */
+    private void setBuilderInterfaceJavaFileHandle(File builderInterfaceJavaFileHandle) {
+        this.builderInterfaceJavaFileHandle = builderInterfaceJavaFileHandle;
+    }
+
+    /**
+     * Returns java file handle for builder class file.
+     *
+     * @return java file handle for builder class file
+     */
+    private File getBuilderClassJavaFileHandle() {
+        return builderClassJavaFileHandle;
+    }
+
+    /**
+     * Sets the java file handle for builder class file.
+     *
+     * @param builderClassJavaFileHandle java file handle
+     */
+    private void setBuilderClassJavaFileHandle(File builderClassJavaFileHandle) {
+        this.builderClassJavaFileHandle = builderClassJavaFileHandle;
+    }
+
+    /**
+     * Returns java file handle for impl class file.
+     *
+     * @return java file handle for impl class file
+     */
+    private File getImplClassJavaFileHandle() {
+        return implClassJavaFileHandle;
+    }
+
+    /**
+     * Sets the java file handle for impl class file.
+     *
+     * @param implClassJavaFileHandle java file handle
+     */
+    private void setImplClassJavaFileHandle(File implClassJavaFileHandle) {
+        this.implClassJavaFileHandle = implClassJavaFileHandle;
+    }
+
+    /**
+     * Returns java file handle for typedef class file.
+     *
+     * @return java file handle for typedef class file
+     */
+    private File getTypedefClassJavaFileHandle() {
+        return typedefClassJavaFileHandle;
+    }
+
+    /**
+     * Sets the java file handle for typedef class file.
+     *
+     * @param typedefClassJavaFileHandle java file handle
+     */
+    private void setTypedefClassJavaFileHandle(File typedefClassJavaFileHandle) {
+        this.typedefClassJavaFileHandle = typedefClassJavaFileHandle;
+    }
+
+    /**
+     * Returns java file handle for type class file.
+     *
+     * @return java file handle for type class file
+     */
+    private File getTypeClassJavaFileHandle() {
+        return typeClassJavaFileHandle;
+    }
+
+    /**
+     * Sets the java file handle for type class file.
+     *
+     * @param typeClassJavaFileHandle type file handle
+     */
+    private void setTypeClassJavaFileHandle(File typeClassJavaFileHandle) {
+        this.typeClassJavaFileHandle = typeClassJavaFileHandle;
+    }
+
+    /**
+     * Returns attribute's temporary file handle.
+     *
+     * @return temporary file handle
+     */
+    public File getAttributesTempFileHandle() {
+        return attributesTempFileHandle;
+    }
+
+    /**
+     * Sets attribute's temporary file handle.
+     *
+     * @param attributeForClass file handle for attribute
+     */
+    private void setAttributesTempFileHandle(File attributeForClass) {
+        attributesTempFileHandle = attributeForClass;
+    }
+
+    /**
+     * Returns getter methods's temporary file handle.
+     *
+     * @return temporary file handle
+     */
+    public File getGetterInterfaceTempFileHandle() {
+        return getterInterfaceTempFileHandle;
+    }
+
+    /**
+     * Sets to getter method's temporary file handle.
+     *
+     * @param getterForInterface file handle for to getter method
+     */
+    private void setGetterInterfaceTempFileHandle(File getterForInterface) {
+        getterInterfaceTempFileHandle = getterForInterface;
+    }
+
+    /**
+     * Returns getter method's impl's temporary file handle.
+     *
+     * @return temporary file handle
+     */
+    public File getGetterImplTempFileHandle() {
+        return getterImplTempFileHandle;
+    }
+
+    /**
+     * Sets to getter method's impl's temporary file handle.
+     *
+     * @param getterImpl file handle for to getter method's impl
+     */
+    private void setGetterImplTempFileHandle(File getterImpl) {
+        getterImplTempFileHandle = getterImpl;
+    }
+
+    /**
+     * Returns setter method's temporary file handle.
+     *
+     * @return temporary file handle
+     */
+    public File getSetterInterfaceTempFileHandle() {
+        return setterInterfaceTempFileHandle;
+    }
+
+    /**
+     * Sets to setter method's temporary file handle.
+     *
+     * @param setterForInterface file handle for to setter method
+     */
+    private void setSetterInterfaceTempFileHandle(File setterForInterface) {
+        setterInterfaceTempFileHandle = setterForInterface;
+    }
+
+    /**
+     * Returns setter method's impl's temporary file handle.
+     *
+     * @return temporary file handle
+     */
+    public File getSetterImplTempFileHandle() {
+        return setterImplTempFileHandle;
+    }
+
+    /**
+     * Sets to setter method's impl's temporary file handle.
+     *
+     * @param setterImpl file handle for to setter method's implementation class
+     */
+    private void setSetterImplTempFileHandle(File setterImpl) {
+        setterImplTempFileHandle = setterImpl;
+    }
+
+    /**
+     * Returns constructor's temporary file handle.
+     *
+     * @return temporary file handle
+     */
+    public File getConstructorImplTempFileHandle() {
+        return constructorImplTempFileHandle;
+    }
+
+    /**
+     * Sets to constructor's temporary file handle.
+     *
+     * @param constructor file handle for to constructor
+     */
+    private void setConstructorImplTempFileHandle(File constructor) {
+        constructorImplTempFileHandle = constructor;
+    }
+
+    /**
+     * Returns hash code method's temporary file handle.
+     *
+     * @return temporary file handle
+     */
+    public File getHashCodeImplTempFileHandle() {
+        return hashCodeImplTempFileHandle;
+    }
+
+    /**
+     * Sets hash code method's temporary file handle.
+     *
+     * @param hashCodeMethod file handle for hash code method
+     */
+    private void setHashCodeImplTempFileHandle(File hashCodeMethod) {
+        hashCodeImplTempFileHandle = hashCodeMethod;
+    }
+
+    /**
+     * Returns equals mehtod's temporary file handle.
+     *
+     * @return temporary file handle
+     */
+    public File getEqualsImplTempFileHandle() {
+        return equalsImplTempFileHandle;
+    }
+
+    /**
+     * Sets equals method's temporary file handle.
+     *
+     * @param equalsMethod file handle for to equals method
+     */
+    private void setEqualsImplTempFileHandle(File equalsMethod) {
+        equalsImplTempFileHandle = equalsMethod;
+    }
+
+    /**
+     * Returns rpc method's temporary file handle.
+     *
+     * @return temporary file handle
+     */
+    public File getRpcInterfaceImplTempFileHandle() {
+        return rpcInterfaceImplTempFileHandle;
+    }
+
+    /**
+     * Sets rpc method's temporary file handle.
+     *
+     * @param rpcInterfaceImplTempFileHandle file handle for to rpc method
+     */
+    private void setRpcInterfaceImplTempFileHandle(File rpcInterfaceImplTempFileHandle) {
+        this.rpcInterfaceImplTempFileHandle = rpcInterfaceImplTempFileHandle;
+    }
+
+    /**
+     * Returns rpc method's java file handle.
+     *
+     * @return java file handle
+     */
+    private File getRpcInterfaceJavaFileHandle() {
+        return rpcInterfaceJavaFileHandle;
+    }
+
+    /**
+     * Sets rpc method's java file handle.
+     *
+     * @param rpcInterfaceJavaFileHandle file handle for to rpc method
+     */
+    private void setRpcInterfaceJavaFileHandle(File rpcInterfaceJavaFileHandle) {
+        this.rpcInterfaceJavaFileHandle = rpcInterfaceJavaFileHandle;
+    }
+
+    /**
+     * Returns to string method's temporary file handle.
+     *
+     * @return temporary file handle
+     */
+    public File getToStringImplTempFileHandle() {
+        return toStringImplTempFileHandle;
+    }
+
+    /**
+     * Sets to string method's temporary file handle.
+     *
+     * @param toStringMethod file handle for to string method
+     */
+    private void setToStringImplTempFileHandle(File toStringMethod) {
+        toStringImplTempFileHandle = toStringMethod;
+    }
+
+    /**
+     * Returns temporary file handle for enum class file.
+     *
+     * @return temporary file handle for enum class file
+     */
+    public File getEnumClassTempFileHandle() {
+        return enumClassTempFileHandle;
+    }
+
+    /**
+     * Sets temporary file handle for enum class file.
+     *
+     * @param enumClassTempFileHandle temporary file handle for enum class file
+     */
+    private void setEnumClassTempFileHandle(File enumClassTempFileHandle) {
+        this.enumClassTempFileHandle = enumClassTempFileHandle;
+    }
+
+    /**
+     * Returns of string method's temporary file handle.
+     *
+     * @return of string method's temporary file handle
+     */
+    public File getOfStringImplTempFileHandle() {
+        return ofStringImplTempFileHandle;
+    }
+
+    /**
+     * Set of string method's temporary file handle.
+     *
+     * @param ofStringImplTempFileHandle of string method's temporary file
+     * handle
+     */
+    private void setOfStringImplTempFileHandle(File ofStringImplTempFileHandle) {
+        this.ofStringImplTempFileHandle = ofStringImplTempFileHandle;
+    }
+
+    /**
+     * Returns type class constructor method's temporary file handle.
+     *
+     * @return type class constructor method's temporary file handle
+     */
+    public File getConstructorForTypeTempFileHandle() {
+        return constructorForTypeTempFileHandle;
+    }
+
+    /**
+     * Sets type class constructor method's temporary file handle.
+     *
+     * @param constructorForTypeTempFileHandle type class constructor method's
+     * temporary file handle
+     */
+    private void setConstructorForTypeTempFileHandle(File constructorForTypeTempFileHandle) {
+        this.constructorForTypeTempFileHandle = constructorForTypeTempFileHandle;
+    }
+
+    /**
+     * Returns from string method's temporary file handle.
+     *
+     * @return from string method's temporary file handle
+     */
+    public File getFromStringImplTempFileHandle() {
+        return fromStringImplTempFileHandle;
+    }
+
+    /**
+     * Sets from string method's temporary file handle.
+     *
+     * @param fromStringImplTempFileHandle from string method's temporary file
+     * handle
+     */
+    private void setFromStringImplTempFileHandle(File fromStringImplTempFileHandle) {
+        this.fromStringImplTempFileHandle = fromStringImplTempFileHandle;
+    }
+
+    /**
+     * Returns list of classes to be extended by generated files.
+     *
+     * @return list of classes to be extended by generated files
+     */
+    private List<String> getExtendsList() {
+        return extendsList;
+    }
+
+    /**
+     * Sets class to be extended by generated file.
+     *
+     * @param extendsList list of classes to be extended
+     */
+    private void setExtendsList(List<String> extendsList) {
+        this.extendsList = extendsList;
+    }
+
+    /**
+     * Adds class to the extends list.
+     *
+     * @param extend class to be extended
+     */
+    public void addToExtendsList(String extend) {
+        getExtendsList().add(extend);
+    }
+
+    /**
+     * Adds of string for type.
+     *
+     * @param attr attribute info
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addOfStringMethod(JavaAttributeInfo attr)
+            throws IOException {
+        appendToFile(getOfStringImplTempFileHandle(), getOfMethodStringAndJavaDoc(attr,
+                getGeneratedJavaClassName())
+                + NEW_LINE);
+    }
+
+    /**
+     * Adds type constructor.
+     *
+     * @param attr attribute info
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addTypeConstructor(JavaAttributeInfo attr)
+            throws IOException {
+        appendToFile(getConstructorForTypeTempFileHandle(), getTypeConstructorStringAndJavaDoc(attr,
+                getGeneratedJavaClassName()) + NEW_LINE);
+    }
+
+    /**
+     * Adds attribute for class.
+     *
+     * @param attr attribute info
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addAttribute(JavaAttributeInfo attr)
+            throws IOException {
+        appendToFile(getAttributesTempFileHandle(), parseAttribute(attr) + FOUR_SPACE_INDENTATION);
+    }
+
+    /**
+     * Adds getter for interface.
+     *
+     * @param attr attribute info
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addGetterForInterface(JavaAttributeInfo attr)
+            throws IOException {
+        appendToFile(getGetterInterfaceTempFileHandle(), getGetterString(attr) + NEW_LINE);
+    }
+
+    /**
+     * Adds getter method's impl for class.
+     *
+     * @param attr attribute info
+     * @param genFiletype generated file type
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addGetterImpl(JavaAttributeInfo attr, int genFiletype)
+            throws IOException {
+        if ((genFiletype & BUILDER_CLASS_MASK) != 0) {
+            appendToFile(getGetterImplTempFileHandle(), getOverRideString() + getGetterForClass(attr) + NEW_LINE);
+        } else {
+            appendToFile(getGetterImplTempFileHandle(), getJavaDoc(GETTER_METHOD, attr.getAttributeName(), false)
+                    + getGetterForClass(attr) + NEW_LINE);
+        }
+    }
+
+    /**
+     * Adds setter for interface.
+     *
+     * @param attr attribute info
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addSetterForInterface(JavaAttributeInfo attr)
+            throws IOException {
+        appendToFile(getSetterInterfaceTempFileHandle(),
+                getSetterString(attr, getGeneratedJavaClassName()) + NEW_LINE);
+    }
+
+    /**
+     * Adds setter's implementation for class.
+     *
+     * @param attr attribute info
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addSetterImpl(JavaAttributeInfo attr)
+            throws IOException {
+        appendToFile(getSetterImplTempFileHandle(),
+                getOverRideString() + getSetterForClass(attr, getGeneratedJavaClassName()) + NEW_LINE);
+    }
+
+    /**
+     * Adds build method for interface.
+     *
+     * @return build method for interface
+     * @throws IOException when fails to append to temporary file
+     */
+    String addBuildMethodForInterface()
+            throws IOException {
+        return parseBuilderInterfaceBuildMethodString(getGeneratedJavaClassName());
+    }
+
+    /**
+     * Adds build method's implementation for class.
+     *
+     * @return build method implementation for class
+     * @throws IOException when fails to append to temporary file
+     */
+    String addBuildMethodImpl()
+            throws IOException {
+        return getBuildString(getGeneratedJavaClassName()) + NEW_LINE;
+    }
+
+    /**
+     * Adds constructor for class.
+     *
+     * @param attr attribute info
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addConstructor(JavaAttributeInfo attr)
+            throws IOException {
+        appendToFile(getConstructorImplTempFileHandle(), getConstructor(getGeneratedJavaClassName(), attr));
+    }
+
+    /**
+     * Adds default constructor for class.
+     *
+     * @param modifier modifier for constructor.
+     * @param toAppend string which need to be appended with the class name
+     * @return default constructor for class
+     * @throws IOException when fails to append to file
+     */
+    String addDefaultConstructor(String modifier, String toAppend)
+            throws IOException {
+        return NEW_LINE + getDefaultConstructorString(getGeneratedJavaClassName() + toAppend, modifier);
+    }
+
+    /**
+     * Adds default constructor for class.
+     *
+     * @return default constructor for class
+     * @throws IOException when fails to append to file
+     */
+    public String addOfMethod()
+            throws IOException {
+        return getJavaDoc(OF_METHOD, getGeneratedJavaClassName(), false)
+                + getOfMethod(getGeneratedJavaClassName(), null);
+    }
+
+    /**
+     * Adds hash code method for class.
+     *
+     * @param attr attribute info
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addHashCodeMethod(JavaAttributeInfo attr)
+            throws IOException {
+        appendToFile(getHashCodeImplTempFileHandle(), getHashCodeMethod(attr) + NEW_LINE);
+    }
+
+    /**
+     * Adds equals method for class.
+     *
+     * @param attr attribute info
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addEqualsMethod(JavaAttributeInfo attr)
+            throws IOException {
+        appendToFile(getEqualsImplTempFileHandle(), getEqualsMethod(attr) + NEW_LINE);
+    }
+
+    /**
+     * Adds ToString method for class.
+     *
+     * @param attr attribute info
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addToStringMethod(JavaAttributeInfo attr)
+            throws IOException {
+        appendToFile(getToStringImplTempFileHandle(), getToStringMethod(attr) + NEW_LINE);
+    }
+
+    /**
+     * Adds enum class attributes to temporary file.
+     *
+     * @param curEnumInfo current YANG enum
+     * @throws IOException when fails to do IO operations.
+     */
+    private void addAttributesForEnumClass(JavaAttributeInfo curEnumInfo)
+            throws IOException {
+        appendToFile(getEnumClassTempFileHandle(),
+                generateEnumAttributeString(curEnumInfo.getAttributeName(), getEnumValue()));
+    }
+
+    /**
+     * Add from string method for union class.
+     *
+     * @param javaAttributeInfo type attribute info
+     * @param fromStringAttributeInfo from string attribute info
+     * @throws IOException when fails to append to temporary file
+     */
+    private void addFromStringMethod(JavaAttributeInfo javaAttributeInfo,
+            JavaAttributeInfo fromStringAttributeInfo)
+            throws IOException {
+        appendToFile(getFromStringImplTempFileHandle(), getFromStringMethod(javaAttributeInfo,
+                fromStringAttributeInfo) + NEW_LINE);
+    }
+
+    /**
+     * Adds rpc string information to applicable temp file.
+     *
+     * @param javaAttributeInfoOfInput rpc's input node attribute info
+     * @param javaAttributeInfoOfOutput rpc's output node attribute info
+     * @param rpcName name of the rpc function
+     * @throws IOException IO operation fail
+     */
+    private void addRpcString(JavaAttributeInfo javaAttributeInfoOfInput, JavaAttributeInfo javaAttributeInfoOfOutput,
+            String rpcName)
+            throws IOException {
+        String rpcInput = "";
+        String rpcOutput = "void";
+        if (javaAttributeInfoOfInput != null) {
+            rpcInput = javaAttributeInfoOfInput.getAttributeName();
+        }
+        if (javaAttributeInfoOfOutput != null) {
+            rpcOutput = javaAttributeInfoOfOutput.getAttributeName();
+        }
+        appendToFile(getRpcInterfaceImplTempFileHandle(), generateJavaDocForRpc(rpcName, rpcInput, rpcOutput) +
+                getRpcStringMethod(rpcName, rpcInput, rpcOutput) + NEW_LINE);
+    }
+
+    /**
+     * Returns a temporary file handle for the specific file type.
+     *
+     * @param fileName file name
+     * @return temporary file handle
+     * @throws IOException when fails to create new file handle
+     */
+    private File getTemporaryFileHandle(String fileName)
+            throws IOException {
+        String path = getTempDirPath();
+        File dir = new File(path);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+        File file = new File(path + fileName + TEMP_FILE_EXTENSION);
+        if (!file.exists()) {
+            file.createNewFile();
+        }
+        return file;
+    }
+
+    /**
+     * Returns a temporary file handle for the specific file type.
+     *
+     * @param fileName file name
+     * @return temporary file handle
+     * @throws IOException when fails to create new file handle
+     */
+    private File getJavaFileHandle(String fileName)
+            throws IOException {
+        createPackage(getAbsoluteDirPath(), getJavaFileInfo().getJavaName());
+        return getFileObject(getDirPath(), fileName, JAVA_FILE_EXTENSION, getJavaFileInfo());
+    }
+
+    /**
+     * Returns data from the temporary files.
+     *
+     * @param file temporary file handle
+     * @return stored data from temporary files
+     * @throws IOException when failed to get data from the given file
+     */
+    public String getTemporaryDataFromFileHandle(File file)
+            throws IOException {
+        String path = getTempDirPath();
+        if (new File(path + file.getName()).exists()) {
+            return readAppendFile(path + file.getName(), EMPTY_STRING);
+        } else {
+            throw new IOException("Unable to get data from the given "
+                    + file.getName() + " file for " + getGeneratedJavaClassName() + PERIOD);
+        }
+    }
+
+    /**
+     * Returns temporary directory path.
+     *
+     * @return directory path
+     */
+    private String getTempDirPath() {
+        return getPackageDirPathFromJavaJPackage(getAbsoluteDirPath()) + SLASH + getGeneratedJavaClassName()
+                + TEMP_FOLDER_NAME_SUFIX + SLASH;
+    }
+
+    /**
+     * Parses attribute to get the attribute string.
+     *
+     * @param attr attribute info
+     * @return attribute string
+     */
+    private String parseAttribute(JavaAttributeInfo attr) {
+        /*
+         * TODO: check if this utility needs to be called or move to the caller
+         */
+        String attributeName = getCamelCase(getSmallCase(attr.getAttributeName()), null);
+        if (attr.isQualifiedName()) {
+            return getJavaAttributeDefination(attr.getImportInfo().getPkgInfo(), attr.getImportInfo().getClassInfo(),
+                    attributeName, attr.isListAttr());
+        } else {
+            return getJavaAttributeDefination(null, attr.getImportInfo().getClassInfo(), attributeName,
+                    attr.isListAttr());
+        }
+    }
+
+    /**
+     * Appends content to temporary file.
+     *
+     * @param file temporary file
+     * @param data data to be appended
+     * @throws IOException when fails to append to file
+     */
+    private void appendToFile(File file, String data)
+            throws IOException {
+        try {
+            insertDataIntoJavaFile(file, data);
+        } catch (IOException ex) {
+            throw new IOException("failed to write in temp file.");
+        }
+    }
+
+    /**
+     * Adds current node info as and attribute to the parent generated file.
+     *
+     * @param curNode current node which needs to be added as an attribute in
+     * the parent generated code
+     * @param isList is list construct
+     * @throws IOException IO operation exception
+     */
+    public static void addCurNodeInfoInParentTempFile(YangNode curNode,
+            boolean isList)
+            throws IOException {
+        YangNode parent = getParentNodeInGenCode(curNode);
+        if (!(parent instanceof JavaCodeGenerator)) {
+            throw new TranslatorException("missing parent node to contain current node info in generated file");
+        }
+        JavaAttributeInfo javaAttributeInfo = getCurNodeAsAttributeInParent(curNode,
+                parent, isList);
+        if (!(parent instanceof TempJavaCodeFragmentFilesContainer)) {
+            throw new TranslatorException("missing parent temp file handle");
+        }
+        ((TempJavaCodeFragmentFilesContainer) parent)
+                .getTempJavaCodeFragmentFiles().getBeanTempFiles()
+                .addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo);
+    }
+
+    /**
+     * Creates an attribute info object corresponding to a data model node and
+     * return it.
+     *
+     * @param curNode current data model node for which the java code generation
+     * is being handled
+     * @param parentNode parent node in which the current node is an attribute
+     * @param isListNode is the current added attribute needs to be a list
+     * @return AttributeInfo attribute details required to add in temporary
+     * files
+     */
+    public static JavaAttributeInfo getCurNodeAsAttributeInParent(
+            YangNode curNode, YangNode parentNode, boolean isListNode) {
+        String curNodeName = ((JavaFileInfoContainer) curNode).getJavaFileInfo().getJavaName();
+        /*
+         * Get the import info corresponding to the attribute for import in
+         * generated java files or qualified access
+         */
+        JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(parentNode,
+                curNodeName);
+        if (!(parentNode instanceof TempJavaCodeFragmentFilesContainer)) {
+            throw new TranslatorException("Parent node does not have file info");
+        }
+
+        TempJavaFragmentFiles tempJavaFragmentFiles;
+        if (parentNode instanceof YangRpc) {
+            tempJavaFragmentFiles = ((TempJavaCodeFragmentFilesContainer) parentNode)
+                    .getTempJavaCodeFragmentFiles()
+                    .getServiceTempFiles();
+        } else {
+            tempJavaFragmentFiles = ((TempJavaCodeFragmentFilesContainer) parentNode)
+                    .getTempJavaCodeFragmentFiles()
+                    .getBeanTempFiles();
+        }
+        JavaImportData parentImportData = tempJavaFragmentFiles.getJavaImportData();
+        boolean isQualified = parentImportData.addImportInfo(qualifiedTypeInfo);
+        return getAttributeInfoForTheData(qualifiedTypeInfo, curNodeName, null, isQualified, isListNode);
+    }
+
+    /**
+     * Adds parent's info to current node import list.
+     *
+     * @param curNode current node for which import list needs to be updated
+     */
+    public void addParentInfoInCurNodeTempFile(YangNode curNode) {
+        caseImportInfo = new JavaQualifiedTypeInfo();
+        YangNode parent = getParentNodeInGenCode(curNode);
+        if (!(parent instanceof JavaCodeGenerator)) {
+            throw new TranslatorException("missing parent node to contain current node info in generated file");
+        }
+        if (!(curNode instanceof JavaFileInfoContainer)) {
+            throw new TranslatorException("missing java file information to get the package details "
+                    + "of attribute corresponding to child node");
+        }
+        caseImportInfo.setClassInfo(getCaptialCase(getCamelCase(parent.getName(), null)));
+        caseImportInfo.setPkgInfo(((JavaFileInfoContainer) parent).getJavaFileInfo().getPackage());
+        ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                .getBeanTempFiles().getJavaImportData().addImportInfo(caseImportInfo);
+    }
+
+    /**
+     * Adds leaf attributes in generated files.
+     *
+     * @param listOfLeaves list of YANG leaf
+     * @throws IOException IO operation fail
+     */
+    private void addLeavesInfoToTempFiles(List<YangLeaf> listOfLeaves)
+            throws IOException {
+        if (listOfLeaves != null) {
+            for (YangLeaf leaf : listOfLeaves) {
+                if (!(leaf instanceof JavaLeafInfoContainer)) {
+                    throw new TranslatorException("Leaf does not have java information");
+                }
+                JavaLeafInfoContainer javaLeaf = (JavaLeafInfoContainer) leaf;
+                javaLeaf.updateJavaQualifiedInfo();
+                JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(
+                        javaLeaf.getJavaQualifiedInfo(),
+                        javaLeaf.getName(), javaLeaf.getDataType(),
+                        getIsQualifiedAccessOrAddToImportList(javaLeaf.getJavaQualifiedInfo()),
+                        false);
+                addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo);
+            }
+        }
+    }
+
+    /**
+     * Adds leaf list's attributes in generated files.
+     *
+     * @param listOfLeafList list of YANG leaves
+     * @throws IOException IO operation fail
+     */
+    private void addLeafListInfoToTempFiles(List<YangLeafList> listOfLeafList)
+            throws IOException {
+        if (listOfLeafList != null) {
+            for (YangLeafList leafList : listOfLeafList) {
+                if (!(leafList instanceof JavaLeafInfoContainer)) {
+                    throw new TranslatorException("Leaf-list does not have java information");
+                }
+                JavaLeafInfoContainer javaLeaf = (JavaLeafInfoContainer) leafList;
+                javaLeaf.updateJavaQualifiedInfo();
+                JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(
+                        javaLeaf.getJavaQualifiedInfo(),
+                        javaLeaf.getName(), javaLeaf.getDataType(),
+                        getIsQualifiedAccessOrAddToImportList(javaLeaf.getJavaQualifiedInfo()),
+                        true);
+                addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo);
+            }
+        }
+    }
+
+    /**
+     * Adds all the leaves in the current data model node as part of the
+     * generated temporary file.
+     *
+     * @param curNode java file info of the generated file
+     * @throws IOException IO operation fail
+     */
+    void addCurNodeLeavesInfoToTempFiles(YangNode curNode)
+            throws IOException {
+        if (!(curNode instanceof YangLeavesHolder)) {
+            throw new TranslatorException("Data model node does not have any leaves");
+        }
+        YangLeavesHolder leavesHolder = (YangLeavesHolder) curNode;
+        addLeavesInfoToTempFiles(leavesHolder.getListOfLeaf());
+        addLeafListInfoToTempFiles(leavesHolder.getListOfLeafList());
+    }
+
+    /**
+     * Add all the type in the current data model node as part of the generated
+     * temporary file.
+     *
+     * @param yangTypeContainer YANG java data model node which has type info, eg union /
+     * typedef
+     * @throws IOException IO operation fail
+     */
+    public void addTypeInfoToTempFiles(YangTypeContainer yangTypeContainer)
+            throws IOException {
+        List<YangType<?>> typeList = yangTypeContainer.getTypeList();
+        if (typeList != null) {
+            for (YangType<?> yangType : typeList) {
+                if (!(yangType instanceof YangJavaType)) {
+                    throw new TranslatorException("Type does not have Java info");
+                }
+                YangJavaType<?> javaType = (YangJavaType<?>) yangType;
+                javaType.updateJavaQualifiedInfo();
+                JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(
+                        javaType.getJavaQualifiedInfo(),
+                        javaType.getDataTypeName(), javaType,
+                        getIsQualifiedAccessOrAddToImportList(javaType.getJavaQualifiedInfo()),
+                        false);
+                addJavaSnippetInfoToApplicableTempFiles((YangNode) yangTypeContainer, javaAttributeInfo);
+            }
+        }
+    }
+
+    /**
+     * Adds enum attributes to temporary files.
+     *
+     * @param curNode current YANG node
+     * @throws IOException when fails to do IO operations
+     */
+    public void addEnumAttributeToTempFiles(YangNode curNode)
+            throws IOException {
+        if (curNode instanceof YangEnumeration) {
+            Set<YangEnum> enumSet = ((YangEnumeration) curNode).getEnumSet();
+            /*
+             * Get the import info corresponding to the attribute for import in
+             * generated java files or qualified access
+             */
+            JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode,
+                    getJavaFileInfo().getJavaName());
+            for (YangEnum curEnum : enumSet) {
+                JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(qualifiedTypeInfo,
+                        curEnum.getNamedValue(), null, false, false);
+                setEnumValue(curEnum.getValue());
+                addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo);
+            }
+        } else {
+            throw new TranslatorException("current node should be of type enum.");
+        }
+    }
+
+    /**
+     * Adds the new attribute info to the target generated temporary files for
+     * union class.
+     *
+     * @param hasType the node for which the type is being added as an attribute
+     * @param javaAttributeInfo the attribute info that needs to be added to
+     * temporary files
+     * @throws IOException IO operation fail
+     */
+    private void addJavaSnippetInfoToApplicableTempFiles(YangNode hasType, JavaAttributeInfo javaAttributeInfo)
+            throws IOException {
+        JavaQualifiedTypeInfo qualifiedInfoOfFromString = getQualifiedInfoOfFromString(javaAttributeInfo);
+        /*
+         * Create a new java attribute info with qualified information of
+         * wrapper classes.
+         */
+        JavaAttributeInfo fromStringAttributeInfo = getAttributeInfoForTheData(qualifiedInfoOfFromString,
+                javaAttributeInfo.getAttributeName(),
+                javaAttributeInfo.getAttributeType(),
+                getIsQualifiedAccessOrAddToImportList(qualifiedInfoOfFromString), false);
+        if ((getGeneratedTempFiles() & FROM_STRING_IMPL_MASK) != 0) {
+            addFromStringMethod(javaAttributeInfo, fromStringAttributeInfo);
+        }
+        addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo);
+    }
+
+    /**
+     * Adds the JAVA rpc snippet information.
+     *
+     * @param javaAttributeInfoOfInput rpc's input node attribute info
+     * @param javaAttributeInfoOfOutput rpc's output node attribute info
+     * @param rpcName name of the rpc function
+     * @throws IOException IO operation fail
+     */
+    public void addJavaSnippetInfoToApplicableTempFiles(JavaAttributeInfo javaAttributeInfoOfInput,
+            JavaAttributeInfo javaAttributeInfoOfOutput,
+            String rpcName)
+            throws IOException {
+        if ((getGeneratedTempFiles() & RPC_IMPL_MASK) != 0) {
+            addRpcString(javaAttributeInfoOfInput, javaAttributeInfoOfOutput, rpcName);
+        }
+    }
+
+    /**
+     * Adds the new attribute info to the target generated temporary files.
+     *
+     * @param newAttrInfo the attribute info that needs to be added to temporary
+     * files
+     * @throws IOException IO operation fail
+     */
+    void addJavaSnippetInfoToApplicableTempFiles(JavaAttributeInfo newAttrInfo)
+            throws IOException {
+        isAttributePresent = true;
+        if ((getGeneratedTempFiles() & ATTRIBUTES_MASK) != 0) {
+            addAttribute(newAttrInfo);
+        }
+        if ((getGeneratedTempFiles() & GETTER_FOR_INTERFACE_MASK) != 0) {
+            addGetterForInterface(newAttrInfo);
+        }
+        if ((getGeneratedTempFiles() & SETTER_FOR_INTERFACE_MASK) != 0) {
+            addSetterForInterface(newAttrInfo);
+        }
+        if ((getGeneratedTempFiles() & GETTER_FOR_CLASS_MASK) != 0) {
+            addGetterImpl(newAttrInfo, getGeneratedJavaFiles());
+        }
+        if ((getGeneratedTempFiles() & SETTER_FOR_CLASS_MASK) != 0) {
+            addSetterImpl(newAttrInfo);
+        }
+        if ((getGeneratedTempFiles() & CONSTRUCTOR_IMPL_MASK) != 0) {
+            addConstructor(newAttrInfo);
+        }
+        if ((getGeneratedTempFiles() & HASH_CODE_IMPL_MASK) != 0) {
+            addHashCodeMethod(newAttrInfo);
+        }
+        if ((getGeneratedTempFiles() & EQUALS_IMPL_MASK) != 0) {
+            addEqualsMethod(newAttrInfo);
+        }
+        if ((getGeneratedTempFiles() & TO_STRING_IMPL_MASK) != 0) {
+            addToStringMethod(newAttrInfo);
+        }
+        if ((getGeneratedTempFiles() & ENUM_IMPL_MASK) != 0) {
+            addAttributesForEnumClass(newAttrInfo);
+        }
+        if ((getGeneratedTempFiles() & OF_STRING_IMPL_MASK) != 0) {
+            addOfStringMethod(newAttrInfo);
+        }
+        if ((getGeneratedTempFiles() & CONSTRUCTOR_FOR_TYPE_MASK) != 0) {
+            addTypeConstructor(newAttrInfo);
+        }
+    }
+
+    /**
+     * Returns java class name.
+     *
+     * @param suffix for the class name based on the file type
+     * @return java class name
+     */
+    private String getJavaClassName(String suffix) {
+        return getCaptialCase(getJavaFileInfo().getJavaName()) + suffix;
+    }
+
+    /**
+     * Returns the directory path.
+     *
+     * @return directory path
+     */
+    private String getDirPath() {
+        return getJavaFileInfo().getPackageFilePath();
+    }
+
+    /**
+     * Constructs java code exit.
+     *
+     * @param fileType generated file type
+     * @param curNode current YANG node
+     * @throws IOException when fails to generate java files
+     */
+    public void generateJavaFile(int fileType, YangNode curNode)
+            throws IOException {
+        List<String> imports = new ArrayList<>();
+        if (isAttributePresent) {
+            imports = getJavaImportData().getImports();
+        }
+        /**
+         * Prepares java file generator for extends list.
+         */
+        prepareJavaFileGeneratorForExtendsList(getExtendsList());
+        if (curNode.getNodeType().equals(MODULE_NODE)) {
+            createPackage(absoluteDirPath, getJavaFileInfo().getJavaName());
+        } else {
+            createPackage(absoluteDirPath, ((JavaFileInfoContainer) curNode.getParent()).getJavaFileInfo().getJavaName()
+                    + PACKAGE_INFO_JAVADOC_OF_CHILD);
+        }
+        /**
+         * Generate java code.
+         */
+        if ((fileType & INTERFACE_MASK) != 0 | (fileType & BUILDER_INTERFACE_MASK) != 0) {
+            /**
+             * Adds import for case.
+             */
+            if (curNode instanceof YangCase) {
+                List<String> importData = ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                        .getBeanTempFiles().getJavaImportData().getImports();
+                for (String importInfo : importData) {
+                    if (!imports.contains(importInfo)) {
+                        imports.add(importInfo);
+                    }
+                }
+            }
+            /**
+             * Adds import for HasAugmentation class.
+             */
+            if (isHasAugmentationExtended(getExtendsList())) {
+                addHasAugmentationImport(curNode, imports, true);
+            }
+            if (isAugmentedInfoExtended(getExtendsList())) {
+                addAugmentedInfoImport(curNode, imports, true);
+            }
+            /**
+             * Create interface file.
+             */
+            setInterfaceJavaFileHandle(getJavaFileHandle(getJavaClassName(INTERFACE_FILE_NAME_SUFFIX)));
+            setInterfaceJavaFileHandle(
+                    generateInterfaceFile(getInterfaceJavaFileHandle(), imports, curNode, isAttributePresent));
+            /**
+             * Create builder interface file.
+             */
+            if ((fileType & BUILDER_INTERFACE_MASK) != 0) {
+                setBuilderInterfaceJavaFileHandle(
+                        getJavaFileHandle(getJavaClassName(BUILDER_INTERFACE_FILE_NAME_SUFFIX)));
+                setBuilderInterfaceJavaFileHandle(
+                        generateBuilderInterfaceFile(getBuilderInterfaceJavaFileHandle(), curNode, isAttributePresent));
+                /**
+                 * Append builder interface file to interface file and close it.
+                 */
+                mergeJavaFiles(getBuilderInterfaceJavaFileHandle(), getInterfaceJavaFileHandle());
+            }
+            insertDataIntoJavaFile(getInterfaceJavaFileHandle(), getJavaClassDefClose());
+            if (isHasAugmentationExtended(getExtendsList())) {
+                addHasAugmentationImport(curNode, imports, false);
+            }
+            if (isAugmentedInfoExtended(getExtendsList())) {
+                addAugmentedInfoImport(curNode, imports, false);
+            }
+            if (curNode instanceof YangCase) {
+                removeCaseImport(imports);
+            }
+        }
+        if ((fileType & BUILDER_CLASS_MASK) != 0 | (fileType & IMPL_CLASS_MASK) != 0) {
+            if (isAttributePresent) {
+                addImportsToStringAndHasCodeMethods(curNode, imports);
+            }
+            if (isHasAugmentationExtended(getExtendsList())) {
+                addAugmentedInfoImport(curNode, imports, true);
+                addArrayListImport(curNode, imports, true);
+            }
+            /**
+             * Create builder class file.
+             */
+            setBuilderClassJavaFileHandle(getJavaFileHandle(getJavaClassName(BUILDER_CLASS_FILE_NAME_SUFFIX)));
+            setBuilderClassJavaFileHandle(
+                    generateBuilderClassFile(getBuilderClassJavaFileHandle(), imports, curNode, isAttributePresent));
+            /**
+             * Create impl class file.
+             */
+            if ((fileType & IMPL_CLASS_MASK) != 0) {
+                setImplClassJavaFileHandle(getJavaFileHandle(getJavaClassName(IMPL_CLASS_FILE_NAME_SUFFIX)));
+                setImplClassJavaFileHandle(
+                        generateImplClassFile(getImplClassJavaFileHandle(), curNode, isAttributePresent));
+                /**
+                 * Append impl class to builder class and close it.
+                 */
+                mergeJavaFiles(getImplClassJavaFileHandle(), getBuilderClassJavaFileHandle());
+            }
+            insertDataIntoJavaFile(getBuilderClassJavaFileHandle(), getJavaClassDefClose());
+        }
+        /**
+         * Creates type def class file.
+         */
+        if ((fileType & GENERATE_TYPEDEF_CLASS) != 0) {
+            addImportsToStringAndHasCodeMethods(curNode, imports);
+            setTypedefClassJavaFileHandle(getJavaFileHandle(getJavaClassName(TYPEDEF_CLASS_FILE_NAME_SUFFIX)));
+            setTypedefClassJavaFileHandle(generateTypeDefClassFile(getTypedefClassJavaFileHandle(), curNode, imports));
+        }
+        /**
+         * Creates type class file.
+         */
+        if ((fileType & GENERATE_UNION_CLASS) != 0) {
+            addImportsToStringAndHasCodeMethods(curNode, imports);
+            setTypeClassJavaFileHandle(getJavaFileHandle(getJavaClassName(UNION_TYPE_CLASS_FILE_NAME_SUFFIX)));
+            setTypeClassJavaFileHandle(generateUnionClassFile(getTypeClassJavaFileHandle(), curNode, imports));
+        }
+        /**
+         * Creates type enum class file.
+         */
+        if ((fileType & GENERATE_ENUM_CLASS) != 0) {
+            setEnumClassJavaFileHandle(getJavaFileHandle(getJavaClassName(ENUM_CLASS_FILE_NAME_SUFFIX)));
+            setEnumClassJavaFileHandle(generateEnumClassFile(getEnumClassJavaFileHandle(), curNode));
+        }
+        /**
+         * Creates rpc interface file.
+         */
+        if ((fileType & GENERATE_RPC_INTERFACE) != 0) {
+            setRpcInterfaceJavaFileHandle(getJavaFileHandle(getJavaClassName(RPC_INTERFACE_FILE_NAME_SUFFIX)));
+            setRpcInterfaceJavaFileHandle(generateRpcInterfaceFile(getRpcInterfaceJavaFileHandle(), curNode, imports));
+        }
+        /**
+         * Close all the file handles.
+         */
+        close(false);
+    }
+
+    /**
+     * Removes case import info from import list.
+     *
+     * @param imports list of imports
+     * @return import for class
+     */
+    private List<String> removeCaseImport(List<String> imports) {
+        if (imports != null && caseImportInfo != null) {
+            String caseImport = IMPORT + caseImportInfo.getPkgInfo() + PERIOD + caseImportInfo.getClassInfo() +
+                    SEMI_COLAN + NEW_LINE;
+            imports.remove(caseImport);
+        }
+        return imports;
+    }
+
+    /**
+     * Removes all temporary file handles.
+     *
+     * @param isErrorOccurred when translator fails to generate java files we
+     * need to close all open file handles include temporary files
+     * and java files.
+     * @throws IOException when failed to delete the temporary files
+     */
+    public void close(boolean isErrorOccurred)
+            throws IOException {
+        boolean isError = isErrorOccurred;
+        /**
+         * Close all java file handles and when error occurs delete the files.
+         */
+        if ((getGeneratedJavaFiles() & INTERFACE_MASK) != 0) {
+            closeFile(getInterfaceJavaFileHandle(), isError);
+        }
+        if ((getGeneratedJavaFiles() & BUILDER_CLASS_MASK) != 0) {
+            closeFile(getBuilderClassJavaFileHandle(), isError);
+        }
+        if ((getGeneratedJavaFiles() & BUILDER_INTERFACE_MASK) != 0) {
+            closeFile(getBuilderInterfaceJavaFileHandle(), true);
+        }
+        if ((getGeneratedJavaFiles() & IMPL_CLASS_MASK) != 0) {
+            closeFile(getImplClassJavaFileHandle(), true);
+        }
+        if ((getGeneratedJavaFiles() & GENERATE_TYPEDEF_CLASS) != 0) {
+            closeFile(getTypedefClassJavaFileHandle(), isError);
+        }
+        if ((getGeneratedJavaFiles() & GENERATE_ENUM_CLASS) != 0) {
+            closeFile(getEnumClassJavaFileHandle(), isError);
+        }
+        if ((getGeneratedJavaFiles() & GENERATE_UNION_CLASS) != 0) {
+            closeFile(getTypeClassJavaFileHandle(), isError);
+        }
+        if ((getGeneratedJavaFiles() & GENERATE_RPC_INTERFACE) != 0) {
+            closeFile(getRpcInterfaceJavaFileHandle(), isError);
+        }
+        /**
+         * Close all temporary file handles and delete the files.
+         */
+        if ((getGeneratedTempFiles() & GETTER_FOR_INTERFACE_MASK) != 0) {
+            closeFile(getGetterInterfaceTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & GETTER_FOR_CLASS_MASK) != 0) {
+            closeFile(getGetterImplTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & SETTER_FOR_INTERFACE_MASK) != 0) {
+            closeFile(getSetterInterfaceTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & SETTER_FOR_CLASS_MASK) != 0) {
+            closeFile(getSetterImplTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & CONSTRUCTOR_IMPL_MASK) != 0) {
+            closeFile(getConstructorImplTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & ATTRIBUTES_MASK) != 0) {
+            closeFile(getAttributesTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & HASH_CODE_IMPL_MASK) != 0) {
+            closeFile(getHashCodeImplTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & TO_STRING_IMPL_MASK) != 0) {
+            closeFile(getToStringImplTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & EQUALS_IMPL_MASK) != 0) {
+            closeFile(getEqualsImplTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & ENUM_IMPL_MASK) != 0) {
+            closeFile(getEnumClassTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & CONSTRUCTOR_FOR_TYPE_MASK) != 0) {
+            closeFile(getConstructorForTypeTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & OF_STRING_IMPL_MASK) != 0) {
+            closeFile(getOfStringImplTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & FROM_STRING_IMPL_MASK) != 0) {
+            closeFile(getFromStringImplTempFileHandle(), true);
+        }
+        if ((getGeneratedTempFiles() & RPC_IMPL_MASK) != 0) {
+            closeFile(getRpcInterfaceImplTempFileHandle(), true);
+        }
+        clean(getTempDirPath());
+        clearGeneratedTempFiles();
+    }
+
+    /**
+     * Returns if the attribute needs to be accessed in a qualified manner or
+     * not, if it needs to be imported, then the same needs to be done.
+     *
+     * @param importInfo import info for the current attribute being added
+     * @return status of the qualified access to the attribute
+     */
+    public boolean getIsQualifiedAccessOrAddToImportList(
+            JavaQualifiedTypeInfo importInfo) {
+        boolean isImportPkgEqualCurNodePkg;
+        if (importInfo.getClassInfo().contentEquals(
+                getGeneratedJavaClassName())) {
+            /*
+             * if the current class name is same as the attribute class name,
+             * then the attribute must be accessed in a qualified manner.
+             */
+            return true;
+        } else if (importInfo.getPkgInfo() != null) {
+            /*
+             * If the attribute type is having the package info, it is contender
+             * for import list and also need to check if it needs to be a
+             * qualified access.
+             */
+            isImportPkgEqualCurNodePkg = isImportPkgEqualCurNodePkg(importInfo);
+            if (!isImportPkgEqualCurNodePkg) {
+                /*
+                 * If the package of the attribute added is not same as the
+                 * current class package, then it must either be imported for
+                 * access or it must be a qualified access.
+                 */
+                boolean isImportAdded = getJavaImportData().addImportInfo(importInfo);
+                if (!isImportAdded) {
+                    /*
+                     * If the attribute type info is not imported, then it must
+                     * be a qualified access.
+                     */
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Checks if the import info is same as the package of the current generated
+     * java file.
+     *
+     * @param importInfo import info for an attribute
+     * @return true if the import info is same as the current nodes package
+     * false otherwise
+     */
+    public boolean isImportPkgEqualCurNodePkg(JavaQualifiedTypeInfo importInfo) {
+        return getJavaFileInfo().getPackage()
+                .contentEquals(importInfo.getPkgInfo());
+    }
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java
new file mode 100644
index 0000000..00f372f
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.translator.tojava;
+
+import java.io.IOException;
+
+/**
+ * Represents implementation of java service code fragments temporary implementations.
+ */
+public class TempJavaServiceFragmentFiles
+        extends TempJavaFragmentFiles {
+
+    /**
+     * Creates an instance of temporary java code fragment.
+     *
+     * @param javaFileInfo generated file information
+     * @throws IOException when fails to create new file handle
+     */
+    public TempJavaServiceFragmentFiles(JavaFileInfo javaFileInfo)
+            throws IOException {
+        super(javaFileInfo);
+    }
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java
new file mode 100644
index 0000000..88336f9
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.translator.tojava;
+
+import java.io.IOException;
+
+/**
+ * Represents implementation of java data type code fragments temporary implementations.
+ */
+public class TempJavaTypeFragmentFiles
+        extends TempJavaFragmentFiles {
+
+    /**
+     * Creates an instance of temporary java code fragment.
+     *
+     * @param javaFileInfo generated java file info
+     * @throws IOException when fails to create new file handle
+     */
+    public TempJavaTypeFragmentFiles(JavaFileInfo javaFileInfo)
+            throws IOException {
+        super(javaFileInfo);
+    }
+
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaCodeGeneratorInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaCodeGeneratorInfo.java
index 5335ff4..8dc0db5 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaCodeGeneratorInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaCodeGeneratorInfo.java
@@ -16,9 +16,8 @@
 
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
-import org.onosproject.yangutils.translator.tojava.HasJavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.HasJavaImportData;
-import org.onosproject.yangutils.translator.tojava.HasTempJavaCodeFragmentFiles;
+import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
+import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer;
 
 /**
  * Represents YANG java info containing interface for java code generator, java
@@ -26,5 +25,6 @@
  * interface serves as a generic interface and help to unify the generate code
  * entry function.
  */
-public interface JavaCodeGeneratorInfo extends HasJavaFileInfo, HasTempJavaCodeFragmentFiles, HasJavaImportData {
+public interface JavaCodeGeneratorInfo
+        extends JavaFileInfoContainer, TempJavaCodeFragmentFilesContainer {
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaLeafInfoContainer.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaLeafInfoContainer.java
new file mode 100644
index 0000000..be005e4
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaLeafInfoContainer.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yangutils.translator.tojava.javamodel;
+
+import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoContainer;
+import org.onosproject.yangutils.translator.tojava.utils.YangToJavaNamingConflictUtil;
+
+
+/**
+ * Represent java based identification of the YANG leaves.
+ */
+public interface JavaLeafInfoContainer
+        extends JavaQualifiedTypeInfoContainer {
+    /**
+     * Retreives the data type of the leaf.
+     *
+     * @return data type of the leaf
+     */
+    YangType<?> getDataType();
+
+    /**
+     * Retreives the name of the leaf.
+     *
+     * @return name of the leaf
+     */
+    String getName();
+
+    /**
+     * Retreives the java name of the leaf.
+     *
+     * @param conflictResolveConfig user config to resolve conflicts
+     * @return name of the leaf
+     */
+    String getJavaName(YangToJavaNamingConflictUtil conflictResolveConfig);
+
+
+    /**
+     * Identifies if object is a leaf-list.
+     *
+     * @return true if leaf-list false otherwise
+     */
+    boolean isLeafList();
+
+    /**
+     * updates the qualified info.
+     */
+    void updateJavaQualifiedInfo();
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasType.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaQualifiedTypeResolver.java
similarity index 62%
copy from utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasType.java
copy to utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaQualifiedTypeResolver.java
index e7a5c73..22970a9 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/HasType.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaQualifiedTypeResolver.java
@@ -13,20 +13,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+package org.onosproject.yangutils.translator.tojava.javamodel;
 
-package org.onosproject.yangutils.datamodel;
+import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoContainer;
 
-import java.util.List;
 
 /**
- * Represents the holder with type(s).
+ * Represent java based identification of the YANG leaves.
  */
-public interface HasType {
+public interface JavaQualifiedTypeResolver
+        extends JavaQualifiedTypeInfoContainer {
 
     /**
-     * Returns type list.
-     *
-     * @return type list
+     * updates the qualified access details of the type.
      */
-    List<YangType<?>> getTypeList();
+    void updateJavaQualifiedInfo();
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaAugment.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaAugment.java
index 9425e40..dbe006c 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaAugment.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaAugment.java
@@ -21,17 +21,18 @@
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
-import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode;
+import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfAugmentableNode;
 
 /**
  * Represents augment information extended to support java code generation.
  */
-public class YangJavaAugment extends YangAugment implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaAugment
+        extends YangAugment
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains the information of the java file being generated.
@@ -39,12 +40,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -56,7 +51,6 @@
     public YangJavaAugment() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
     }
 
@@ -85,27 +79,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *            file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -133,8 +106,9 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
-        generateCodeOfNode(this, yangPlugin, false);
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
+        generateCodeOfAugmentableNode(this, yangPlugin);
     }
 
     /**
@@ -143,7 +117,8 @@
      * @throws IOException when failed to do IO operations
      */
     @Override
-    public void generateCodeExit() throws IOException {
+    public void generateCodeExit()
+            throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaCase.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaCase.java
index 8729f17..6d1ac21 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaCase.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaCase.java
@@ -16,21 +16,23 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+
 import org.onosproject.yangutils.datamodel.YangCase;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
-import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode;
+import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfAugmentableNode;
 
 /**
  * Represents case information extended to support java code generation.
  */
-public class YangJavaCase extends YangCase implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaCase
+        extends YangCase
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains the information of the java file being generated.
@@ -38,12 +40,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -55,7 +51,6 @@
     public YangJavaCase() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
     }
 
@@ -83,27 +78,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *            file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -131,15 +105,17 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
-        generateCodeOfNode(this, yangPlugin, false);
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
+        generateCodeOfAugmentableNode(this, yangPlugin);
     }
 
     /**
      * Creates a java file using the YANG case info.
      */
     @Override
-    public void generateCodeExit() throws IOException  {
+    public void generateCodeExit()
+            throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaChoice.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaChoice.java
index 0299e6c..cc12782 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaChoice.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaChoice.java
@@ -16,21 +16,23 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+
 import org.onosproject.yangutils.datamodel.YangChoice;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
+import org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.INTERFACE_MASK;
-import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode;
 
 /**
  * Represents choice information extended to support java code generation.
  */
-public class YangJavaChoice extends YangChoice implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaChoice
+        extends YangChoice
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains the information of the java file being generated.
@@ -38,12 +40,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -55,7 +51,6 @@
     public YangJavaChoice() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(INTERFACE_MASK);
     }
 
@@ -83,27 +78,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *            file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -131,15 +105,17 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
-        generateCodeOfNode(this, yangPlugin, false);
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
+        YangJavaModelUtils.generateCodeAndUpdateInParent(this, yangPlugin, false);
     }
 
     /**
      * Creates a java file using the YANG choice info.
      */
     @Override
-    public void generateCodeExit() throws IOException {
+    public void generateCodeExit()
+            throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(INTERFACE_MASK, this);
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaContainer.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaContainer.java
index 5099c85..0222e12 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaContainer.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaContainer.java
@@ -16,21 +16,23 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+
 import org.onosproject.yangutils.datamodel.YangContainer;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
-import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode;
+import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeAndUpdateInParent;
 
 /**
  * Represents container information extended to support java code generation.
  */
-public class YangJavaContainer extends YangContainer implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaContainer
+        extends YangContainer
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains the information of the java file being generated.
@@ -38,12 +40,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -55,7 +51,6 @@
     public YangJavaContainer() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
     }
 
@@ -83,27 +78,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *            file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -131,8 +105,9 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
-        generateCodeOfNode(this, yangPlugin, false);
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
+        generateCodeAndUpdateInParent(this, yangPlugin, false);
     }
 
     /**
@@ -141,7 +116,8 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeExit() throws IOException {
+    public void generateCodeExit()
+            throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
     }
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java
index ccb82c6..a11fb2c 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java
@@ -17,11 +17,11 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+
 import org.onosproject.yangutils.datamodel.YangEnumeration;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
@@ -31,7 +31,9 @@
 /**
  * Represents YANG java enumeration information extended to support java code generation.
  */
-public class YangJavaEnumeration extends YangEnumeration implements JavaCodeGenerator, JavaCodeGeneratorInfo {
+public class YangJavaEnumeration
+        extends YangEnumeration
+        implements JavaCodeGenerator, JavaCodeGeneratorInfo {
 
     /**
      * Contains the information of the java file being generated.
@@ -39,12 +41,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -56,7 +52,6 @@
     public YangJavaEnumeration() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_ENUM_CLASS);
     }
 
@@ -86,29 +81,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *                       file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -138,7 +110,8 @@
      * @throws IOException IO operations fails
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
         generateCodeOfNode(this, yangPlugin);
     }
 
@@ -148,7 +121,8 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeExit() throws IOException {
+    public void generateCodeExit()
+            throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_ENUM_CLASS, this);
     }
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java
index 058bfbf..f29934f 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java
@@ -16,131 +16,34 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
-import org.onosproject.yangutils.datamodel.YangGrouping;
-import org.onosproject.yangutils.translator.exception.TranslatorException;
-import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
-import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
-import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
-import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
-import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode;
+import org.onosproject.yangutils.datamodel.YangGrouping;
+import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
+import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
 /**
  * Represents grouping information extended to support java code generation.
  */
-public class YangJavaGrouping extends YangGrouping implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaGrouping
+        extends YangGrouping
+        implements JavaCodeGenerator {
 
     /**
-     * Contains the information of the java file being generated.
-     */
-    private JavaFileInfo javaFileInfo;
-
-    /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
-     * File handle to maintain temporary java code fragments as per the code
-     * snippet types.
-     */
-    private TempJavaCodeFragmentFiles tempFileHandle;
-
-    /**
-     * Creates YANG java grouping object.
+     * Creates YANG Java grouping object.
      */
     public YangJavaGrouping() {
         super();
-        setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
-        getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
     }
 
-    /**
-     * Returns the generated java file information.
-     *
-     * @return generated java file information
-     */
     @Override
-    public JavaFileInfo getJavaFileInfo() {
-        if (javaFileInfo == null) {
-            throw new TranslatorException("Missing java info in java datamodel node");
-        }
-        return javaFileInfo;
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
+        /*Do nothing, the uses will copy the contents to the used location*/
     }
 
-    /**
-     * Sets the java file info object.
-     *
-     * @param javaInfo java file info object
-     */
     @Override
-    public void setJavaFileInfo(JavaFileInfo javaInfo) {
-        javaFileInfo = javaInfo;
-    }
-
-    /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *            file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
-     * Returns the temporary file handle.
-     *
-     * @return temporary file handle
-     */
-    @Override
-    public TempJavaCodeFragmentFiles getTempJavaCodeFragmentFiles() {
-        return tempFileHandle;
-    }
-
-    /**
-     * Sets temporary file handle.
-     *
-     * @param fileHandle temporary file handle
-     */
-    @Override
-    public void setTempJavaCodeFragmentFiles(TempJavaCodeFragmentFiles fileHandle) {
-        tempFileHandle = fileHandle;
-    }
-
-    /**
-     * Prepare the information for java code generation corresponding to YANG
-     * grouping info.
-     *
-     * @param yangPlugin YANG plugin config
-     * @throws IOException IO operation fail
-     */
-    @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
-        generateCodeOfNode(this, yangPlugin, false);
-    }
-
-    /**
-     * Creates a java file using the YANG grouping info.
-     */
-    @Override
-    public void generateCodeExit() {
-        // TODO Auto-generated method stub
-
+    public void generateCodeExit()
+            throws IOException {
+        /*Do nothing, the uses will copy the contents to the used location*/
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaInput.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaInput.java
index 14e2cdf..0f07262 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaInput.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaInput.java
@@ -17,11 +17,11 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+
 import org.onosproject.yangutils.datamodel.YangInput;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
@@ -31,7 +31,9 @@
 /**
  * Represents input information extended to support java code generation.
  */
-public class YangJavaInput extends YangInput implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaInput
+        extends YangInput
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains information of the java file being generated.
@@ -39,12 +41,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -56,7 +52,6 @@
     public YangJavaInput() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
     }
 
@@ -84,27 +79,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *                       file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -132,7 +106,8 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
         generateCodeOfNode(this, yangPlugin);
     }
 
@@ -142,7 +117,8 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeExit() throws IOException {
+    public void generateCodeExit()
+            throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeaf.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeaf.java
index 1ff57f4..61e8e9c 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeaf.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeaf.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Open Networking Laboratory
+ * Copyright 2016-present Open Networking Laboratory
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,19 +16,23 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import org.onosproject.yangutils.datamodel.YangLeaf;
-import org.onosproject.yangutils.translator.tojava.HasJavaQualifiedTypeInfo;
 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
+import org.onosproject.yangutils.translator.tojava.utils.YangToJavaNamingConflictUtil;
+
+import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.updateLeavesJavaQualifiedInfo;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
 
 /**
- * Maintains java information corresponding to the YANG leaf.
+ * Represents java information corresponding to the YANG leaf.
  */
-public class YangJavaLeaf extends YangLeaf
-        implements HasJavaQualifiedTypeInfo {
+public class YangJavaLeaf
+        extends YangLeaf
+        implements JavaLeafInfoContainer {
 
     private JavaQualifiedTypeInfo javaQualifiedAccess;
 
     /**
-     * Create a YANG leaf object with java qualified access details.
+     * Returns a new YANG leaf object with java qualified access details.
      */
     public YangJavaLeaf() {
         super();
@@ -46,4 +50,17 @@
 
     }
 
+    public String getJavaName(YangToJavaNamingConflictUtil conflictResolveConfig) {
+        return getCamelCase(getName(), conflictResolveConfig);
+    }
+
+    @Override
+    public boolean isLeafList() {
+        return false;
+    }
+
+    @Override
+    public void updateJavaQualifiedInfo() {
+        updateLeavesJavaQualifiedInfo(this);
+    }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeafList.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeafList.java
new file mode 100644
index 0000000..2d7e5bb
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeafList.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yangutils.translator.tojava.javamodel;
+
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
+import org.onosproject.yangutils.translator.tojava.utils.YangToJavaNamingConflictUtil;
+
+import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.updateLeavesJavaQualifiedInfo;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
+
+/**
+ * Represents java information corresponding to the YANG leaf-list.
+ */
+public class YangJavaLeafList
+        extends YangLeafList
+        implements JavaLeafInfoContainer {
+    private JavaQualifiedTypeInfo javaQualifiedAccess;
+
+    /**
+     * Returns a new YANG leaf object with java qualified access details.
+     */
+    public YangJavaLeafList() {
+        super();
+        setJavaQualifiedInfo(new JavaQualifiedTypeInfo());
+    }
+
+    @Override
+    public String getJavaName(YangToJavaNamingConflictUtil conflictResolveConfig) {
+        return getCamelCase(getName(), conflictResolveConfig);
+    }
+
+    @Override
+    public boolean isLeafList() {
+        return true;
+    }
+
+    @Override
+    public void updateJavaQualifiedInfo() {
+        updateLeavesJavaQualifiedInfo(this);
+    }
+
+    @Override
+    public JavaQualifiedTypeInfo getJavaQualifiedInfo() {
+        return javaQualifiedAccess;
+    }
+
+    @Override
+    public void setJavaQualifiedInfo(JavaQualifiedTypeInfo typeInfo) {
+        javaQualifiedAccess = typeInfo;
+    }
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaList.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaList.java
index c828faa..08351d2 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaList.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaList.java
@@ -16,21 +16,23 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+
 import org.onosproject.yangutils.datamodel.YangList;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
-import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode;
+import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeAndUpdateInParent;
 
 /**
  * Represents YANG list information extended to support java code generation.
  */
-public class YangJavaList extends YangList implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaList
+        extends YangList
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains the information of the java file being generated.
@@ -38,12 +40,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -55,7 +51,6 @@
     public YangJavaList() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
     }
 
@@ -83,27 +78,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *            file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -131,8 +105,9 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
-        generateCodeOfNode(this, yangPlugin, true);
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
+        generateCodeAndUpdateInParent(this, yangPlugin, true);
     }
 
     /**
@@ -141,7 +116,8 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeExit() throws IOException {
+    public void generateCodeExit()
+            throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModule.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModule.java
index 7670b31..8f71c0a 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModule.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModule.java
@@ -16,22 +16,25 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+
 import org.onosproject.yangutils.datamodel.YangModule;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_MANAGER_WITH_RPC;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
 
 /**
  * Represents module information extended to support java code generation.
  */
-public class YangJavaModule extends YangModule implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaModule
+        extends YangModule
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains the information of the java file being generated.
@@ -39,12 +42,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -56,7 +53,6 @@
     public YangJavaModule() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_MANAGER_WITH_RPC);
     }
 
@@ -84,27 +80,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *                       file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -131,7 +106,8 @@
      * @throws IOException when fails to generate the source files
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
         String modulePkg = getRootPackage(getVersion(), getNameSpace().getUri(), getRevision().getRevDate());
         YangJavaModelUtils.generateCodeOfRootNode(this, yangPlugin, modulePkg);
     }
@@ -140,7 +116,8 @@
      * Creates a java file using the YANG module info.
      */
     @Override
-    public void generateCodeExit() throws IOException {
-        getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_MANAGER_WITH_RPC, this);
+    public void generateCodeExit()
+            throws IOException {
+        getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaNotification.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaNotification.java
index 0452dd4..5d4e2d5 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaNotification.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaNotification.java
@@ -20,28 +20,19 @@
 
 import org.onosproject.yangutils.datamodel.YangNotification;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
-import org.onosproject.yangutils.translator.tojava.HasJavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.HasJavaImportData;
-import org.onosproject.yangutils.translator.tojava.HasTempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCurNodePackage;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
-import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
 
 /**
  * Represents notification information extended to support java code generation.
  */
-public class YangJavaNotification extends YangNotification
-        implements JavaCodeGenerator, HasJavaFileInfo,
-        HasJavaImportData, HasTempJavaCodeFragmentFiles {
+public class YangJavaNotification
+        extends YangNotification
+        implements JavaCodeGenerator, JavaCodeGeneratorInfo {
 
     /**
      * Contains information of the java file being generated.
@@ -49,12 +40,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -66,7 +51,6 @@
     public YangJavaNotification() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
     }
 
@@ -95,27 +79,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *            file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -143,25 +106,10 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
 
-        getJavaFileInfo().setJavaName(getCaptialCase(getCamelCase(getName(), yangPlugin.getConflictResolver())));
-        getJavaFileInfo().setPackage(getCurNodePackage(this));
-        getJavaFileInfo().setPackageFilePath(
-                getPackageDirPathFromJavaJPackage(getJavaFileInfo().getPackage()));
-        getJavaFileInfo().setBaseCodeGenPath(yangPlugin.getCodeGenDir());
-
-        String absolutePath = getAbsolutePackagePath(
-                getJavaFileInfo().getBaseCodeGenPath(),
-                getJavaFileInfo().getPackageFilePath());
-
-        setTempJavaCodeFragmentFiles(new TempJavaCodeFragmentFiles(
-                getJavaFileInfo().getGeneratedFileTypes(), absolutePath,
-                getJavaFileInfo().getJavaName()));
-
-        getTempJavaCodeFragmentFiles().addCurNodeLeavesInfoToTempFiles(this);
-
-        getTempJavaCodeFragmentFiles().addCurNodeInfoInParentTempFile(this, false);
+        //TODO: implement the event listener for notifications.
     }
 
     /**
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaOutput.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaOutput.java
index db29d57..0c5ddcf 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaOutput.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaOutput.java
@@ -17,11 +17,11 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+
 import org.onosproject.yangutils.datamodel.YangOutput;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
@@ -31,7 +31,9 @@
 /**
  * Represents output information extended to support java code generation.
  */
-public class YangJavaOutput extends YangOutput implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaOutput
+        extends YangOutput
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains information of the java file being generated.
@@ -39,12 +41,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -56,7 +52,6 @@
     public YangJavaOutput() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
     }
 
@@ -84,27 +79,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *                       file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -132,8 +106,10 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
         generateCodeOfNode(this, yangPlugin);
+
     }
 
     /**
@@ -142,7 +118,8 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeExit() throws IOException {
+    public void generateCodeExit()
+            throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java
index 1f138ea..7a7c96a 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java
@@ -17,27 +17,31 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
-import org.onosproject.yangutils.datamodel.HasRpcNotification;
+
+import org.onosproject.yangutils.datamodel.RpcNotificationContainer;
 import org.onosproject.yangutils.datamodel.YangInput;
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.datamodel.YangOutput;
 import org.onosproject.yangutils.datamodel.YangRpc;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
-import org.onosproject.yangutils.translator.tojava.HasJavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.HasTempJavaCodeFragmentFiles;
+import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer;
 import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
+import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
-import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getCurNodeAsAttributeInParent;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_RPC_INTERFACE;
+import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.getCurNodeAsAttributeInParent;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getParentNodeInGenCode;
 import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.updatePackageInfo;
 
 /**
  * Represents rpc information extended to support java code generation.
  */
-public class YangJavaRpc extends YangRpc implements JavaCodeGenerator, HasJavaFileInfo {
+public class YangJavaRpc
+        extends YangRpc
+        implements JavaCodeGenerator, JavaCodeGeneratorInfo {
 
     /**
      * Contains the information of the java file being generated.
@@ -45,35 +49,57 @@
     private JavaFileInfo javaFileInfo;
 
     /**
+     * Temproary file for code generation.
+     */
+    private TempJavaCodeFragmentFiles tempJavaCodeFragmentFiles;
+
+    /**
      * Creates an instance of YANG java rpc.
      */
     public YangJavaRpc() {
         super();
         setJavaFileInfo(new JavaFileInfo());
+        getJavaFileInfo().setGeneratedFileTypes(GENERATE_RPC_INTERFACE);
+        try {
+            setTempJavaCodeFragmentFiles(new TempJavaCodeFragmentFiles(getJavaFileInfo()));
+        } catch (IOException e) {
+            throw new RuntimeException("Failed to create temporary RPC file handle");
+        }
     }
 
     /**
      * Prepares the information for java code generation corresponding to YANG
-     * rpc info.
+     * RPC info.
      *
      * @param yangPlugin YANG plugin config
      * @throws IOException IO operations fails
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
 
-        if (!(this instanceof YangNode)) {
+        if (!(this instanceof JavaCodeGeneratorInfo)) {
             // TODO:throw exception
         }
 
         // Add package information for rpc and create corresponding folder.
-        updatePackageInfo(this, yangPlugin);
+        updatePackageInfo((JavaCodeGeneratorInfo) this, yangPlugin);
 
+    }
+
+    /**
+     * Creates a java file using the YANG RPC info.
+     *
+     * @throws IOException IO operations fails
+     */
+    @Override
+    public void generateCodeExit()
+            throws IOException {
         // Get the parent module/sub-module.
         YangNode parent = getParentNodeInGenCode((YangNode) this);
 
         // Parent should be holder of rpc or notification.
-        if (!(parent instanceof HasRpcNotification)) {
+        if (!(parent instanceof RpcNotificationContainer)) {
             throw new TranslatorException("parent node of rpc can only be module or sub-module");
         }
 
@@ -89,35 +115,26 @@
         YangNode yangNode = this.getChild();
         while (yangNode != null) {
             if (yangNode instanceof YangInput) {
-                javaAttributeInfoOfInput = getCurNodeAsAttributeInParent(parent, false, yangNode.getName());
+                javaAttributeInfoOfInput = getCurNodeAsAttributeInParent(yangNode, this, false);
             } else if (yangNode instanceof YangOutput) {
-                javaAttributeInfoOfOutput = getCurNodeAsAttributeInParent(parent, false, yangNode.getName());
+                javaAttributeInfoOfOutput = getCurNodeAsAttributeInParent(yangNode, this, false);
             } else {
                 // TODO throw exception
             }
             yangNode = yangNode.getNextSibling();
         }
 
-        if (!(parent instanceof HasTempJavaCodeFragmentFiles)) {
+        if (!(parent instanceof TempJavaCodeFragmentFilesContainer)) {
             throw new TranslatorException("missing parent temp file handle");
         }
 
         /*
          * Add the rpc information to the parent's service temp file.
          */
-        ((HasTempJavaCodeFragmentFiles) parent)
-                .getTempJavaCodeFragmentFiles()
+        ((TempJavaCodeFragmentFilesContainer) parent)
+                .getTempJavaCodeFragmentFiles().getServiceTempFiles()
                 .addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfoOfInput, javaAttributeInfoOfOutput,
                         ((YangNode) this).getName());
-    }
-
-    /**
-     * Creates a java file using the YANG rpc info.
-     *
-     * @throws IOException IO operations fails
-     */
-    @Override
-    public void generateCodeExit() throws IOException {
         // No file will be generated during RPC exit.
     }
 
@@ -144,5 +161,15 @@
     public void setJavaFileInfo(JavaFileInfo javaInfo) {
         javaFileInfo = javaInfo;
     }
+
+    @Override
+    public TempJavaCodeFragmentFiles getTempJavaCodeFragmentFiles() {
+        return tempJavaCodeFragmentFiles;
+    }
+
+    @Override
+    public void setTempJavaCodeFragmentFiles(TempJavaCodeFragmentFiles fileHandle) {
+        tempJavaCodeFragmentFiles = fileHandle;
+    }
 }
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModule.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModule.java
index 8bf7592..89ff0c9 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModule.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModule.java
@@ -16,12 +16,12 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+
 import org.onosproject.yangutils.datamodel.YangBelongsTo;
 import org.onosproject.yangutils.datamodel.YangSubModule;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
@@ -32,7 +32,9 @@
 /**
  * Represents sub module information extended to support java code generation.
  */
-public class YangJavaSubModule extends YangSubModule implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaSubModule
+        extends YangSubModule
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains the information of the java file being generated.
@@ -40,12 +42,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -57,7 +53,6 @@
     public YangJavaSubModule() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_MANAGER_WITH_RPC);
     }
 
@@ -85,27 +80,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *                       file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -129,7 +103,7 @@
      * Returns the name space of the module to which the sub module belongs to.
      *
      * @param belongsToInfo Information of the module to which the sub module
-     *                      belongs
+     * belongs
      * @return the name space string of the module.
      */
     private String getNameSpaceFromModule(YangBelongsTo belongsToInfo) {
@@ -145,7 +119,8 @@
      * @throws IOException IO operation fail
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
         String subModulePkg = getRootPackage(getVersion(), getNameSpaceFromModule(getBelongsTo()),
                 getRevision().getRevDate());
         YangJavaModelUtils.generateCodeOfRootNode(this, yangPlugin, subModulePkg);
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaType.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaType.java
new file mode 100644
index 0000000..18bbc1a
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaType.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yangutils.translator.tojava.javamodel;
+
+import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.translator.exception.TranslatorException;
+import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
+import org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType;
+
+/**
+ * Represents java information corresponding to the YANG type.
+ */
+public class YangJavaType<T>
+        extends YangType<T>
+        implements JavaQualifiedTypeResolver {
+
+    private JavaQualifiedTypeInfo javaQualifiedAccess;
+
+    /**
+     * Create a YANG leaf object with java qualified access details.
+     */
+    public YangJavaType() {
+        super();
+        setJavaQualifiedInfo(new JavaQualifiedTypeInfo());
+    }
+
+    @Override
+    public void updateJavaQualifiedInfo() {
+        JavaQualifiedTypeInfo importInfo = getJavaQualifiedInfo();
+
+        /*
+         * Type is added as an attribute in the class.
+         */
+        String className = AttributesJavaDataType.getJavaImportClass(this, false);
+        if (className != null) {
+            /*
+             * Corresponding to the attribute type a class needs to be imported,
+             * since it can be a derived type or a usage of wrapper classes.
+             */
+            importInfo.setClassInfo(className);
+            String classPkg = AttributesJavaDataType.getJavaImportPackage(this,
+                    false, className);
+            if (classPkg == null) {
+                throw new TranslatorException("import package cannot be null when the class is used");
+            }
+            importInfo.setPkgInfo(classPkg);
+        } else {
+            /*
+             * The attribute does not need a class to be imported, for example
+             * built in java types.
+             */
+            String dataTypeName = AttributesJavaDataType.getJavaDataType(this);
+            if (dataTypeName == null) {
+                throw new TranslatorException("not supported data type");
+            }
+            importInfo.setClassInfo(dataTypeName);
+        }
+    }
+
+    @Override
+    public JavaQualifiedTypeInfo getJavaQualifiedInfo() {
+        return javaQualifiedAccess;
+    }
+
+    @Override
+    public void setJavaQualifiedInfo(JavaQualifiedTypeInfo typeInfo) {
+        javaQualifiedAccess = typeInfo;
+    }
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaTypeDef.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaTypeDef.java
index b7efb5f..bbec876 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaTypeDef.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaTypeDef.java
@@ -16,11 +16,11 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+
 import org.onosproject.yangutils.datamodel.YangTypeDef;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
@@ -30,7 +30,9 @@
 /**
  * Represents type define information extended to support java code generation.
  */
-public class YangJavaTypeDef extends YangTypeDef implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaTypeDef
+        extends YangTypeDef
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains the information of the java file being generated.
@@ -38,12 +40,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -55,7 +51,6 @@
     public YangJavaTypeDef() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_TYPEDEF_CLASS);
     }
 
@@ -84,27 +79,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *                       file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -132,8 +106,9 @@
      * @throws IOException IO operations fails
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
-        generateCodeOfNode(this, yangPlugin, false);
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
+        generateCodeOfNode(this, yangPlugin);
     }
 
     /**
@@ -142,7 +117,8 @@
      * @throws IOException IO operations fails
      */
     @Override
-    public void generateCodeExit() throws IOException {
+    public void generateCodeExit()
+            throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_TYPEDEF_CLASS, this);
     }
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUnion.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUnion.java
index 7af19c6..5c3a144 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUnion.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUnion.java
@@ -16,10 +16,10 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+
 import org.onosproject.yangutils.datamodel.YangUnion;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
@@ -29,7 +29,9 @@
 /**
  * Represents union information extended to support java code generation.
  */
-public class YangJavaUnion extends YangUnion implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaUnion
+        extends YangUnion
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains the information of the java file being generated.
@@ -37,12 +39,6 @@
     private JavaFileInfo javaFileInfo;
 
     /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
-
-    /**
      * File handle to maintain temporary java code fragments as per the code
      * snippet types.
      */
@@ -54,7 +50,6 @@
     public YangJavaUnion() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
         getJavaFileInfo().setGeneratedFileTypes(GENERATE_UNION_CLASS);
     }
 
@@ -82,27 +77,6 @@
     }
 
     /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *                       file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
-    }
-
-    /**
      * Returns the temporary file handle.
      *
      * @return temporary file handle
@@ -134,7 +108,8 @@
      * @throws IOException IO operations fails
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws IOException {
         generateCodeOfNode(this, yangPlugin);
     }
 
@@ -144,7 +119,8 @@
      * @throws IOException IO operations fails
      */
     @Override
-    public void generateCodeExit() throws IOException {
+    public void generateCodeExit()
+            throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_UNION_CLASS, this);
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUses.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUses.java
index 2cbb551..725f0f5 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUses.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUses.java
@@ -16,89 +16,21 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import org.onosproject.yangutils.datamodel.YangUses;
-import org.onosproject.yangutils.translator.exception.TranslatorException;
-import org.onosproject.yangutils.translator.tojava.HasJavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.HasJavaImportData;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
-import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCurNodePackage;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
-
 /**
  * Represents uses information extended to support java code generation.
  */
-public class YangJavaUses extends YangUses implements JavaCodeGenerator, HasJavaFileInfo, HasJavaImportData {
-
-    /**
-     * Contains the information of the java file being generated.
-     */
-    private JavaFileInfo javaFileInfo;
-
-    /**
-     * Contains information of the imports to be inserted in the java file
-     * generated.
-     */
-    private JavaImportData javaImportData;
+public class YangJavaUses
+        extends YangUses
+        implements JavaCodeGenerator {
 
     /**
      * Creates YANG java uses object.
      */
     public YangJavaUses() {
         super();
-        setJavaFileInfo(new JavaFileInfo());
-        setJavaImportData(new JavaImportData());
-        getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
-    }
-
-    /**
-     * Returns the generated java file information.
-     *
-     * @return generated java file information
-     */
-    @Override
-    public JavaFileInfo getJavaFileInfo() {
-
-        if (javaFileInfo == null) {
-            throw new TranslatorException("Missing java info in java datamodel node");
-        }
-        return javaFileInfo;
-    }
-
-    /**
-     * Sets the java file info object.
-     *
-     * @param javaInfo java file info object
-     */
-    @Override
-    public void setJavaFileInfo(JavaFileInfo javaInfo) {
-        javaFileInfo = javaInfo;
-    }
-
-    /**
-     * Returns the data of java imports to be included in generated file.
-     *
-     * @return data of java imports to be included in generated file
-     */
-    @Override
-    public JavaImportData getJavaImportData() {
-        return javaImportData;
-    }
-
-    /**
-     * Sets the data of java imports to be included in generated file.
-     *
-     * @param javaImportData data of java imports to be included in generated
-     *            file
-     */
-    @Override
-    public void setJavaImportData(JavaImportData javaImportData) {
-        this.javaImportData = javaImportData;
     }
 
     /**
@@ -109,14 +41,7 @@
      */
     @Override
     public void generateCodeEntry(YangPluginConfig yangPlugin) {
-
-        getJavaFileInfo().setJavaName(getCaptialCase(getCamelCase(getName(), yangPlugin.getConflictResolver())));
-        getJavaFileInfo().setPackage(getCurNodePackage(this));
-        getJavaFileInfo().setPackageFilePath(
-                getPackageDirPathFromJavaJPackage(getJavaFileInfo().getPackage()));
-        getJavaFileInfo().setBaseCodeGenPath(yangPlugin.getCodeGenDir());
-        //TODO:addCurNodeLeavesInfoToTempFiles(this);
-        //TODO:addCurNodeInfoInParentTempFile(this, false);
+                /*Do nothing, the uses will copy the contents to the used location*/
     }
 
     /**
@@ -124,7 +49,6 @@
      */
     @Override
     public void generateCodeExit() {
-        // TODO Auto-generated method stub
-
+                /*Do nothing, the uses will copy the contents to the used location*/
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
index e28fa4e..6c91f4f 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
@@ -24,7 +24,7 @@
 import org.onosproject.yangutils.datamodel.YangTypeDef;
 import org.onosproject.yangutils.datamodel.YangUnion;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
-import org.onosproject.yangutils.translator.tojava.HasJavaFileInfo;
+import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeDef;
@@ -109,7 +109,7 @@
      * Returns from string method parsed string.
      *
      * @param targetDataType target data type
-     * @param yangType       YANG type
+     * @param yangType YANG type
      * @return parsed string
      */
     public static String getParseFromStringMethod(String targetDataType, YangType<?> yangType) {
@@ -155,7 +155,7 @@
     /**
      * Returns java import class.
      *
-     * @param yangType   YANG type
+     * @param yangType YANG type
      * @param isListAttr if the attribute need to be a list
      * @return java import class
      */
@@ -183,6 +183,7 @@
                     return BIG_INTEGER;
                 case DECIMAL64:
                     //TODO: DECIMAL64.
+                    break;
                 case STRING:
                     return STRING_DATA_TYPE;
                 case BOOLEAN:
@@ -192,12 +193,16 @@
                             getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(), null));
                 case BITS:
                     //TODO:BITS
+                    break;
                 case BINARY:
                     //TODO:BINARY
+                    break;
                 case LEAFREF:
                     //TODO:LEAFREF
+                    break;
                 case IDENTITYREF:
                     //TODO:IDENTITYREF
+                    break;
                 case EMPTY:
                     return BOOLEAN_WRAPPER;
                 case UNION:
@@ -216,6 +221,7 @@
                     return BIG_INTEGER;
                 case DECIMAL64:
                     //TODO: DECIMAL64.
+                    break;
                 case STRING:
                     return STRING_DATA_TYPE;
                 case ENUMERATION:
@@ -223,33 +229,40 @@
                             getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(), null));
                 case BITS:
                     //TODO:BITS
+                    break;
                 case BINARY:
                     //TODO:BINARY
+                    break;
                 case LEAFREF:
                     //TODO:LEAFREF
+                    break;
                 case IDENTITYREF:
                     //TODO:IDENTITYREF
+                    break;
                 case EMPTY:
                     //TODO:EMPTY
+                    break;
                 case UNION:
                     return getCaptialCase(getCamelCase(((YangJavaUnion) yangType.getDataTypeExtendedInfo()).getName(),
                             null));
                 case INSTANCE_IDENTIFIER:
                     //TODO:INSTANCE_IDENTIFIER
+                    break;
                 case DERIVED:
                     return getCaptialCase(getCamelCase(yangType.getDataTypeName(), null));
                 default:
                     return null;
             }
         }
+        return null;
     }
 
     /**
      * Returns java import package.
      *
-     * @param yangType   YANG type
+     * @param yangType YANG type
      * @param isListAttr if the attribute is of list type
-     * @param classInfo  java import class info
+     * @param classInfo java import class info
      * @return java import package
      */
     public static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr, String classInfo) {
@@ -272,22 +285,29 @@
                     return JAVA_MATH;
                 case DECIMAL64:
                     //TODO: DECIMAL64.
+                    break;
                 case ENUMERATION:
                     return getEnumsPackage(yangType);
                 case BITS:
                     //TODO:BITS
+                    break;
                 case BINARY:
                     //TODO:BINARY
+                    break;
                 case LEAFREF:
                     //TODO:LEAFREF
+                    break;
                 case IDENTITYREF:
                     //TODO:IDENTITYREF
+                    break;
                 case EMPTY:
                     //TODO:EMPTY
+                    break;
                 case UNION:
                     return getUnionPackage(yangType);
                 case INSTANCE_IDENTIFIER:
                     //TODO:INSTANCE_IDENTIFIER
+                    break;
                 case DERIVED:
                     return getTypDefsPackage(yangType);
                 default:
@@ -297,32 +317,41 @@
             switch (type) {
                 case UINT64:
                     //TODO: BIGINTEGER.
+                    break;
                 case DECIMAL64:
                     //TODO: DECIMAL64
+                    break;
                 case STRING:
                     return JAVA_LANG;
                 case ENUMERATION:
                     return getEnumsPackage(yangType);
                 case BITS:
                     //TODO:BITS
+                    break;
                 case BINARY:
                     //TODO:BINARY
+                    break;
                 case LEAFREF:
                     //TODO:LEAFREF
+                    break;
                 case IDENTITYREF:
                     //TODO:IDENTITYREF
+                    break;
                 case EMPTY:
                     //TODO:EMPTY
+                    break;
                 case UNION:
                     return getUnionPackage(yangType);
                 case INSTANCE_IDENTIFIER:
                     //TODO:INSTANCE_IDENTIFIER
+                    break;
                 case DERIVED:
                     return getTypDefsPackage(yangType);
                 default:
                     return null;
             }
         }
+        return null;
     }
 
     /**
@@ -392,10 +421,10 @@
      * @return java package from parent node
      */
     private static String getPackageFromParent(YangNode parent) {
-        if (!(parent instanceof HasJavaFileInfo)) {
+        if (!(parent instanceof JavaFileInfoContainer)) {
             throw new TranslatorException("invalid child node is being processed.");
         }
-        JavaFileInfo parentInfo = ((HasJavaFileInfo) parent).getJavaFileInfo();
+        JavaFileInfo parentInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo();
         return parentInfo.getPackage() + PERIOD + parentInfo.getJavaName().toLowerCase();
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
index ff548fc..1582616 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
@@ -20,10 +20,12 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+
 import org.onosproject.yangutils.datamodel.YangNode;
-import org.onosproject.yangutils.translator.tojava.HasJavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.HasTempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
+import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
+import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer;
+import org.onosproject.yangutils.translator.tojava.javamodel.JavaCodeGeneratorInfo;
 
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK;
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK;
@@ -68,7 +70,8 @@
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getRemoveAugmentationImpl;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getToStringMethodClose;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getToStringMethodOpen;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.isHasAugmentationExtended;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils
+        .isHasAugmentationExtended;
 import static org.onosproject.yangutils.utils.UtilConstants.BUILDER;
 import static org.onosproject.yangutils.utils.UtilConstants.CLOSE_CURLY_BRACKET;
 import static org.onosproject.yangutils.utils.UtilConstants.COMMA;
@@ -148,9 +151,9 @@
     /**
      * Returns generated interface file for current node.
      *
-     * @param file          file
-     * @param imports       imports for the file
-     * @param curNode       current YANG node
+     * @param file file
+     * @param imports imports for the file
+     * @param curNode current YANG node
      * @param isAttrPresent if any attribute is present or not
      * @return interface file
      * @throws IOException when fails to write in file
@@ -158,7 +161,7 @@
     public static File generateInterfaceFile(File file, List<String> imports, YangNode curNode, boolean isAttrPresent)
             throws IOException {
 
-        JavaFileInfo javaFileInfo = ((HasJavaFileInfo) curNode).getJavaFileInfo();
+        JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
 
         String className = getCaptialCase(javaFileInfo.getJavaName());
         String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath();
@@ -173,7 +176,9 @@
                 /**
                  * Getter methods.
                  */
-                insertDataIntoJavaFile(file, getDataFromTempFileHandle(GETTER_FOR_INTERFACE_MASK, curNode));
+                insertDataIntoJavaFile(file, getDataFromTempFileHandle(GETTER_FOR_INTERFACE_MASK,
+                        ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                .getBeanTempFiles()));
             } catch (IOException e) {
                 throw new IOException("No data found in temporary java code fragment files for " + className
                         + " while interface file generation");
@@ -185,8 +190,8 @@
     /**
      * Returns generated builder interface file for current node.
      *
-     * @param file          file
-     * @param curNode       current YANG node
+     * @param file file
+     * @param curNode current YANG node
      * @param isAttrPresent if any attribute is present or not
      * @return builder interface file
      * @throws IOException when fails to write in file
@@ -194,7 +199,7 @@
     public static File generateBuilderInterfaceFile(File file, YangNode curNode, boolean isAttrPresent)
             throws IOException {
 
-        JavaFileInfo javaFileInfo = ((HasJavaFileInfo) curNode).getJavaFileInfo();
+        JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
 
         String className = getCaptialCase(javaFileInfo.getJavaName());
         String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath();
@@ -206,12 +211,16 @@
                 /**
                  * Getter methods.
                  */
-                methods.add(FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(GETTER_FOR_INTERFACE_MASK, curNode));
+                methods.add(FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(GETTER_FOR_INTERFACE_MASK,
+                        ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                .getBeanTempFiles()));
                 /**
                  * Setter methods.
                  */
                 methods.add(NEW_LINE);
-                methods.add(FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(SETTER_FOR_INTERFACE_MASK, curNode));
+                methods.add(FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(SETTER_FOR_INTERFACE_MASK,
+                        ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                .getBeanTempFiles()));
             } catch (IOException e) {
                 throw new IOException("No data found in temporary java code fragment files for " + className
                         + " while builder interface file generation");
@@ -221,7 +230,8 @@
          * Add build method to builder interface file.
          */
         methods.add(
-                ((HasTempJavaCodeFragmentFiles) curNode).getTempJavaCodeFragmentFiles().addBuildMethodForInterface());
+                ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                        .addBuildMethodForInterface());
 
         /**
          * Add getters and setters in builder interface.
@@ -237,17 +247,18 @@
     /**
      * Returns generated builder class file for current node.
      *
-     * @param file          file
-     * @param imports       imports for the file
-     * @param curNode       current YANG node
+     * @param file file
+     * @param imports imports for the file
+     * @param curNode current YANG node
      * @param isAttrPresent if any attribute is present or not
      * @return builder class file
      * @throws IOException when fails to write in file
      */
     public static File generateBuilderClassFile(File file, List<String> imports, YangNode curNode,
-                                                boolean isAttrPresent) throws IOException {
+            boolean isAttrPresent)
+            throws IOException {
 
-        JavaFileInfo javaFileInfo = ((HasJavaFileInfo) curNode).getJavaFileInfo();
+        JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
 
         String className = getCaptialCase(javaFileInfo.getJavaName());
         String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath();
@@ -262,7 +273,9 @@
              */
             try {
                 insertDataIntoJavaFile(file,
-                        NEW_LINE + FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(ATTRIBUTES_MASK, curNode));
+                        NEW_LINE + FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(ATTRIBUTES_MASK,
+                                ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                        .getBeanTempFiles()));
             } catch (IOException e) {
                 throw new IOException("No data found in temporary java code fragment files for " + className
                         + " while builder class file generation");
@@ -272,11 +285,16 @@
                 /**
                  * Getter methods.
                  */
-                methods.add(getDataFromTempFileHandle(GETTER_FOR_CLASS_MASK, curNode));
+                methods.add(getDataFromTempFileHandle(GETTER_FOR_CLASS_MASK,
+                        ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                .getBeanTempFiles()));
                 /**
                  * Setter methods.
                  */
-                methods.add(getDataFromTempFileHandle(SETTER_FOR_CLASS_MASK, curNode) + NEW_LINE);
+                methods.add(getDataFromTempFileHandle(SETTER_FOR_CLASS_MASK,
+                        ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                .getBeanTempFiles()) +
+                        NEW_LINE);
             } catch (IOException e) {
                 throw new IOException("No data found in temporary java code fragment files for " + className
                         + " while builder class file generation");
@@ -287,8 +305,8 @@
         /**
          * Add default constructor and build method impl.
          */
-        methods.add(((HasTempJavaCodeFragmentFiles) curNode).getTempJavaCodeFragmentFiles().addBuildMethodImpl());
-        methods.add(((HasTempJavaCodeFragmentFiles) curNode).getTempJavaCodeFragmentFiles()
+        methods.add(((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().addBuildMethodImpl());
+        methods.add(((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
                 .addDefaultConstructor(PUBLIC, BUILDER));
 
         /**
@@ -303,8 +321,8 @@
     /**
      * Returns generated impl class file for current node.
      *
-     * @param file          file
-     * @param curNode       current YANG node
+     * @param file file
+     * @param curNode current YANG node
      * @param isAttrPresent if any attribute is present or not
      * @return impl class file
      * @throws IOException when fails to write in file
@@ -312,7 +330,7 @@
     public static File generateImplClassFile(File file, YangNode curNode, boolean isAttrPresent)
             throws IOException {
 
-        JavaFileInfo javaFileInfo = ((HasJavaFileInfo) curNode).getJavaFileInfo();
+        JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
 
         String className = getCaptialCase(javaFileInfo.getJavaName());
         String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath();
@@ -326,7 +344,9 @@
              */
             try {
                 insertDataIntoJavaFile(file,
-                        NEW_LINE + FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(ATTRIBUTES_MASK, curNode));
+                        NEW_LINE + FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(ATTRIBUTES_MASK,
+                                ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                        .getBeanTempFiles()));
             } catch (IOException e) {
                 throw new IOException("No data found in temporary java code fragment files for " + className
                         + " while impl class file generation");
@@ -343,22 +363,30 @@
                 /**
                  * Getter methods.
                  */
-                methods.add(getDataFromTempFileHandle(GETTER_FOR_CLASS_MASK, curNode));
+                methods.add(getDataFromTempFileHandle(GETTER_FOR_CLASS_MASK,
+                        ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                .getBeanTempFiles()));
 
                 /**
                  * Hash code method.
                  */
                 methods.add(getHashCodeMethodClose(getHashCodeMethodOpen() + partString(
-                        getDataFromTempFileHandle(HASH_CODE_IMPL_MASK, curNode).replace(NEW_LINE, EMPTY_STRING))));
+                        getDataFromTempFileHandle(HASH_CODE_IMPL_MASK,
+                                ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                        .getBeanTempFiles()).replace(NEW_LINE, EMPTY_STRING))));
                 /**
                  * Equals method.
                  */
                 methods.add(getEqualsMethodClose(
-                        getEqualsMethodOpen(className + IMPL) + getDataFromTempFileHandle(EQUALS_IMPL_MASK, curNode)));
+                        getEqualsMethodOpen(className + IMPL) + getDataFromTempFileHandle(EQUALS_IMPL_MASK,
+                                ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                        .getBeanTempFiles())));
                 /**
                  * To string method.
                  */
-                methods.add(getToStringMethodOpen() + getDataFromTempFileHandle(TO_STRING_IMPL_MASK, curNode)
+                methods.add(getToStringMethodOpen() + getDataFromTempFileHandle(TO_STRING_IMPL_MASK,
+                        ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                .getBeanTempFiles())
                         + getToStringMethodClose());
 
             } catch (IOException e) {
@@ -372,7 +400,8 @@
             /**
              * Constructor.
              */
-            methods.add(getConstructorStart(className) + getDataFromTempFileHandle(CONSTRUCTOR_IMPL_MASK, curNode)
+            methods.add(getConstructorStart(className) + getDataFromTempFileHandle(CONSTRUCTOR_IMPL_MASK,
+                    ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().getBeanTempFiles())
                     + FOUR_SPACE_INDENTATION + CLOSE_CURLY_BRACKET);
         } catch (IOException e) {
             throw new IOException("No data found in temporary java code fragment files for " + className
@@ -402,15 +431,16 @@
     /**
      * Generates class file for type def.
      *
-     * @param file    generated file
+     * @param file generated file
      * @param curNode current YANG node
      * @param imports imports for file
      * @return type def class file
      * @throws IOException when fails to generate class file
      */
-    public static File generateTypeDefClassFile(File file, YangNode curNode, List<String> imports) throws IOException {
+    public static File generateTypeDefClassFile(File file, YangNode curNode, List<String> imports)
+            throws IOException {
 
-        JavaFileInfo javaFileInfo = ((HasJavaFileInfo) curNode).getJavaFileInfo();
+        JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
 
         String className = getCaptialCase(javaFileInfo.getJavaName());
         String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath();
@@ -424,7 +454,9 @@
          */
         try {
             insertDataIntoJavaFile(file,
-                    NEW_LINE + FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(ATTRIBUTES_MASK, curNode));
+                    NEW_LINE + FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(ATTRIBUTES_MASK,
+                            ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                    .getTypeTempFiles()));
         } catch (IOException e) {
             throw new IOException("No data found in temporary java code fragment files for " + className
                     + " while type def class file generation");
@@ -433,7 +465,7 @@
         /**
          * Default constructor.
          */
-        methods.add(((HasTempJavaCodeFragmentFiles) curNode).getTempJavaCodeFragmentFiles()
+        methods.add(((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
                 .addDefaultConstructor(PRIVATE, EMPTY_STRING));
 
         try {
@@ -441,42 +473,51 @@
             /**
              * Type constructor.
              */
-            methods.add(getDataFromTempFileHandle(CONSTRUCTOR_FOR_TYPE_MASK, curNode));
+            methods.add(getDataFromTempFileHandle(CONSTRUCTOR_FOR_TYPE_MASK,
+                    ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().getTypeTempFiles()));
 
             /**
              * Of method.
              */
-            methods.add(getDataFromTempFileHandle(OF_STRING_IMPL_MASK, curNode));
+            methods.add(getDataFromTempFileHandle(OF_STRING_IMPL_MASK,
+                    ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().getTypeTempFiles()));
 
             /**
              * Getter method.
              */
-            methods.add(getDataFromTempFileHandle(GETTER_FOR_CLASS_MASK, curNode));
+            methods.add(getDataFromTempFileHandle(GETTER_FOR_CLASS_MASK,
+                    ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().getTypeTempFiles()));
 
             /**
              * Hash code method.
              */
             methods.add(getHashCodeMethodClose(getHashCodeMethodOpen() + partString(
-                    getDataFromTempFileHandle(HASH_CODE_IMPL_MASK, curNode).replace(NEW_LINE, EMPTY_STRING))));
+                    getDataFromTempFileHandle(HASH_CODE_IMPL_MASK,
+                            ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                    .getTypeTempFiles())
+                            .replace(NEW_LINE, EMPTY_STRING))));
 
             /**
              * Equals method.
              */
             methods.add(getEqualsMethodClose(getEqualsMethodOpen(className + EMPTY_STRING)
-                    + getDataFromTempFileHandle(EQUALS_IMPL_MASK, curNode)));
+                    + getDataFromTempFileHandle(EQUALS_IMPL_MASK,
+                    ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().getTypeTempFiles())));
 
             /**
              * To string method.
              */
-            methods.add(getToStringMethodOpen() + getDataFromTempFileHandle(TO_STRING_IMPL_MASK, curNode)
+            methods.add(getToStringMethodOpen() + getDataFromTempFileHandle(TO_STRING_IMPL_MASK,
+                    ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().getTypeTempFiles())
                     + getToStringMethodClose());
 
+            JavaCodeGeneratorInfo javaGeninfo = (JavaCodeGeneratorInfo) curNode;
             /**
              * From string method.
              */
             methods.add(getFromStringMethodSignature(className)
-                    + getDataFromTempFileHandle(FROM_STRING_IMPL_MASK, curNode)
-                    + getFromStringMethodClose());
+                    + getDataFromTempFileHandle(FROM_STRING_IMPL_MASK, javaGeninfo.getTempJavaCodeFragmentFiles()
+                    .getTypeTempFiles()) + getFromStringMethodClose());
 
         } catch (IOException e) {
             throw new IOException("No data found in temporary java code fragment files for " + className
@@ -494,15 +535,16 @@
     /**
      * Generates class file for union type.
      *
-     * @param file    generated file
+     * @param file generated file
      * @param curNode current YANG node
      * @param imports imports for file
      * @return type def class file
      * @throws IOException when fails to generate class file
      */
-    public static File generateUnionClassFile(File file, YangNode curNode, List<String> imports) throws IOException {
+    public static File generateUnionClassFile(File file, YangNode curNode, List<String> imports)
+            throws IOException {
 
-        JavaFileInfo javaFileInfo = ((HasJavaFileInfo) curNode).getJavaFileInfo();
+        JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
 
         String className = getCaptialCase(javaFileInfo.getJavaName());
         String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath();
@@ -516,7 +558,9 @@
          */
         try {
             insertDataIntoJavaFile(file,
-                    NEW_LINE + FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(ATTRIBUTES_MASK, curNode));
+                    NEW_LINE + FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(ATTRIBUTES_MASK,
+                            ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                    .getTypeTempFiles()));
         } catch (IOException e) {
             throw new IOException("No data found in temporary java code fragment files for " + className
                     + " while union class file generation");
@@ -525,7 +569,7 @@
         /**
          * Default constructor.
          */
-        methods.add(((HasTempJavaCodeFragmentFiles) curNode).getTempJavaCodeFragmentFiles()
+        methods.add(((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
                 .addDefaultConstructor(PRIVATE, EMPTY_STRING));
 
         try {
@@ -533,41 +577,51 @@
             /**
              * Type constructor.
              */
-            methods.add(getDataFromTempFileHandle(CONSTRUCTOR_FOR_TYPE_MASK, curNode));
+            methods.add(getDataFromTempFileHandle(CONSTRUCTOR_FOR_TYPE_MASK,
+                    ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().getTypeTempFiles()));
 
             /**
              * Of string method.
              */
-            methods.add(getDataFromTempFileHandle(OF_STRING_IMPL_MASK, curNode));
+            methods.add(getDataFromTempFileHandle(OF_STRING_IMPL_MASK,
+                    ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().getTypeTempFiles()));
 
             /**
              * Getter method.
              */
-            methods.add(getDataFromTempFileHandle(GETTER_FOR_CLASS_MASK, curNode));
+            methods.add(getDataFromTempFileHandle(GETTER_FOR_CLASS_MASK,
+                    ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().getTypeTempFiles()));
 
             /**
              * Hash code method.
              */
             methods.add(getHashCodeMethodClose(getHashCodeMethodOpen() + partString(
-                    getDataFromTempFileHandle(HASH_CODE_IMPL_MASK, curNode).replace(NEW_LINE, EMPTY_STRING))));
+                    getDataFromTempFileHandle(HASH_CODE_IMPL_MASK,
+                            ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                    .getTypeTempFiles())
+                            .replace(NEW_LINE, EMPTY_STRING))));
 
             /**
              * Equals method.
              */
             methods.add(getEqualsMethodClose(getEqualsMethodOpen(className + EMPTY_STRING)
-                    + getDataFromTempFileHandle(EQUALS_IMPL_MASK, curNode)));
+                    + getDataFromTempFileHandle(EQUALS_IMPL_MASK,
+                    ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().getTypeTempFiles())));
 
             /**
              * To string method.
              */
             methods.add(getToStringMethodOpen() + getOmitNullValueString() +
-                    getDataFromTempFileHandle(TO_STRING_IMPL_MASK, curNode) + getToStringMethodClose());
+                    getDataFromTempFileHandle(TO_STRING_IMPL_MASK,
+                            ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                    .getTypeTempFiles()) + getToStringMethodClose());
 
             /**
              * From string method.
              */
             methods.add(getFromStringMethodSignature(className)
-                    + getDataFromTempFileHandle(FROM_STRING_IMPL_MASK, curNode)
+                    + getDataFromTempFileHandle(FROM_STRING_IMPL_MASK,
+                    ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().getTypeTempFiles())
                     + getFromStringMethodClose());
 
         } catch (IOException e) {
@@ -586,14 +640,15 @@
     /**
      * Generates class file for type enum.
      *
-     * @param file    generated file
+     * @param file generated file
      * @param curNode current YANG node
      * @return class file for type enum
      * @throws IOException when fails to generate class file
      */
-    public static File generateEnumClassFile(File file, YangNode curNode) throws IOException {
+    public static File generateEnumClassFile(File file, YangNode curNode)
+            throws IOException {
 
-        JavaFileInfo javaFileInfo = ((HasJavaFileInfo) curNode).getJavaFileInfo();
+        JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
 
         String className = getCaptialCase(javaFileInfo.getJavaName());
         String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath();
@@ -603,8 +658,10 @@
          * Add attribute strings.
          */
         try {
+            JavaCodeGeneratorInfo javaGeninfo = (JavaCodeGeneratorInfo) curNode;
             insertDataIntoJavaFile(file,
-                    trimAtLast(trimAtLast(getDataFromTempFileHandle(ENUM_IMPL_MASK, curNode), COMMA), NEW_LINE)
+                    trimAtLast(trimAtLast(getDataFromTempFileHandle(ENUM_IMPL_MASK, javaGeninfo
+                            .getTempJavaCodeFragmentFiles().getEnumerationTempFiles()), COMMA), NEW_LINE)
                             + SEMI_COLAN + NEW_LINE);
         } catch (IOException e) {
             throw new IOException("No data found in temporary java code fragment files for " + className
@@ -612,7 +669,8 @@
         }
 
         /**
-         * Add an attribute to get the enum's values.
+         * Add an
+         * attribute to get the enum's values.
          */
         insertDataIntoJavaFile(file, getEnumsValueAttribute(className));
 
@@ -638,15 +696,16 @@
     /**
      * Generates interface file for rpc.
      *
-     * @param file    generated file
+     * @param file generated file
      * @param curNode current YANG node
      * @param imports imports for file
      * @return type def class file
      * @throws IOException when fails to generate class file
      */
-    public static File generateRpcInterfaceFile(File file, YangNode curNode, List<String> imports) throws IOException {
+    public static File generateRpcInterfaceFile(File file, YangNode curNode, List<String> imports)
+            throws IOException {
 
-        JavaFileInfo javaFileInfo = ((HasJavaFileInfo) curNode).getJavaFileInfo();
+        JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
 
         String className = getCaptialCase(javaFileInfo.getJavaName()) + SERVICE_METHOD_STRING;
         String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath();
@@ -657,10 +716,12 @@
 
         try {
 
+            JavaCodeGeneratorInfo javaGeninfo = (JavaCodeGeneratorInfo) curNode;
             /**
              * Rpc methods
              */
-            methods.add(getDataFromTempFileHandle(RPC_IMPL_MASK, curNode));
+            methods.add(getDataFromTempFileHandle(RPC_IMPL_MASK, javaGeninfo.getTempJavaCodeFragmentFiles()
+                    .getServiceTempFiles()));
 
         } catch (IOException e) {
             throw new IOException("No data found in temporary java code fragment files for " + className
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java
index cb1263f..c43346a 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java
@@ -19,10 +19,9 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.List;
-import org.onosproject.yangutils.datamodel.YangNode;
-import org.onosproject.yangutils.translator.tojava.HasTempJavaCodeFragmentFiles;
+
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
+import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles;
 import org.onosproject.yangutils.utils.io.impl.CopyrightHeader;
 import org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType;
 
@@ -39,6 +38,7 @@
 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.CONSTRUCTOR_IMPL_MASK;
 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.ENUM_IMPL_MASK;
 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.EQUALS_IMPL_MASK;
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.FROM_STRING_IMPL_MASK;
 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.GETTER_FOR_CLASS_MASK;
 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.GETTER_FOR_INTERFACE_MASK;
 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.HASH_CODE_IMPL_MASK;
@@ -47,7 +47,6 @@
 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_CLASS_MASK;
 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK;
 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK;
-import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.FROM_STRING_IMPL_MASK;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaClassDefStart;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getJavaPackageFromPackagePath;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase;
@@ -83,10 +82,10 @@
     /**
      * Returns a file object for generated file.
      *
-     * @param fileName  file name
-     * @param filePath  file package path
+     * @param fileName file name
+     * @param filePath file package path
      * @param extension file extension
-     * @param handle    cached file handle
+     * @param handle cached file handle
      * @return file object
      */
     public static File getFileObject(String filePath, String fileName, String extension, JavaFileInfo handle) {
@@ -98,58 +97,59 @@
      * Returns data stored in temporary files.
      *
      * @param generatedTempFiles temporary file types
-     * @param curNode            current YANG node
+     * @param generatedTempFiles temporary file types
+     * @param tempJavaFragmentFiles temp java fragment files
      * @return data stored in temporary files
      * @throws IOException when failed to get the data from temporary file handle
      */
-    public static String getDataFromTempFileHandle(int generatedTempFiles, YangNode curNode) throws IOException {
+    public static String getDataFromTempFileHandle(int generatedTempFiles,
+            TempJavaFragmentFiles tempJavaFragmentFiles)
+            throws IOException {
 
-        TempJavaCodeFragmentFiles tempJavaCodeFragmentFiles = ((HasTempJavaCodeFragmentFiles) curNode)
-                .getTempJavaCodeFragmentFiles();
 
         if ((generatedTempFiles & ATTRIBUTES_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getAttributesTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getAttributesTempFileHandle());
         } else if ((generatedTempFiles & GETTER_FOR_INTERFACE_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getGetterInterfaceTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getGetterInterfaceTempFileHandle());
         } else if ((generatedTempFiles & SETTER_FOR_INTERFACE_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getSetterInterfaceTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getSetterInterfaceTempFileHandle());
         } else if ((generatedTempFiles & GETTER_FOR_CLASS_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getGetterImplTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getGetterImplTempFileHandle());
         } else if ((generatedTempFiles & SETTER_FOR_CLASS_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getSetterImplTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getSetterImplTempFileHandle());
         } else if ((generatedTempFiles & CONSTRUCTOR_IMPL_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getConstructorImplTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getConstructorImplTempFileHandle());
         } else if ((generatedTempFiles & HASH_CODE_IMPL_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getHashCodeImplTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getHashCodeImplTempFileHandle());
         } else if ((generatedTempFiles & EQUALS_IMPL_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getEqualsImplTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getEqualsImplTempFileHandle());
         } else if ((generatedTempFiles & TO_STRING_IMPL_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getToStringImplTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getToStringImplTempFileHandle());
         } else if ((generatedTempFiles & CONSTRUCTOR_FOR_TYPE_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles
                             .getConstructorForTypeTempFileHandle());
         } else if ((generatedTempFiles & OF_STRING_IMPL_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getOfStringImplTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getOfStringImplTempFileHandle());
         } else if ((generatedTempFiles & FROM_STRING_IMPL_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getFromStringImplTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getFromStringImplTempFileHandle());
         } else if ((generatedTempFiles & ENUM_IMPL_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getEnumClassTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getEnumClassTempFileHandle());
         } else if ((generatedTempFiles & RPC_IMPL_MASK) != 0) {
-            return tempJavaCodeFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaCodeFragmentFiles.getRpcInterfaceImplTempFileHandle());
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getRpcInterfaceImplTempFileHandle());
         }
         return null;
     }
@@ -157,15 +157,16 @@
     /**
      * Initiates generation of file based on generated file type.
      *
-     * @param file      generated file
+     * @param file generated file
      * @param className generated file class name
-     * @param type      generated file type
-     * @param imports   imports for the file
-     * @param pkg       generated file package
+     * @param type generated file type
+     * @param imports imports for the file
+     * @param pkg generated file package
      * @throws IOException when fails to generate a file
      */
     public static void initiateJavaFileGeneration(File file, String className, int type, List<String> imports,
-                                                  String pkg) throws IOException {
+            String pkg)
+            throws IOException {
 
         try {
             file.createNewFile();
@@ -178,15 +179,16 @@
     /**
      * Appends all the contents into a generated java file.
      *
-     * @param file        generated file
-     * @param fileName    generated file name
-     * @param type        generated file type
-     * @param pkg         generated file package
+     * @param file generated file
+     * @param fileName generated file name
+     * @param type generated file type
+     * @param pkg generated file package
      * @param importsList list of java imports.
      * @throws IOException when fails to append contents
      */
     private static void appendContents(File file, String fileName, int type, List<String> importsList,
-                                       String pkg) throws IOException {
+            String pkg)
+            throws IOException {
 
         String pkgString = parsePackageString(pkg, importsList);
 
@@ -218,7 +220,7 @@
     /**
      * Removes base directory path from package and generates package string for file.
      *
-     * @param javaPkg     generated java package
+     * @param javaPkg generated java package
      * @param importsList list of imports
      * @return package string
      */
@@ -243,12 +245,13 @@
      * Appends other contents to interface, builder and typedef classes.
      * for example : ONOS copyright, imports and package.
      *
-     * @param file        generated file
-     * @param pkg         generated package
+     * @param file generated file
+     * @param pkg generated package
      * @param importsList list of imports
      * @throws IOException when fails to append contents
      */
-    private static void appendHeaderContents(File file, String pkg, List<String> importsList) throws IOException {
+    private static void appendHeaderContents(File file, String pkg, List<String> importsList)
+            throws IOException {
 
         insertDataIntoJavaFile(file, CopyrightHeader.getCopyrightHeader());
         insertDataIntoJavaFile(file, pkg);
@@ -269,9 +272,9 @@
     /**
      * Writes data to the specific generated file.
      *
-     * @param file        generated file
-     * @param fileName    file name
-     * @param genType     generated file type
+     * @param file generated file
+     * @param fileName file name
+     * @param genType generated file type
      * @param javaDocType java doc type
      * @throws IOException when fails to write into a file
      */
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java
index 27b9e80..5ab0923 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java
@@ -21,7 +21,7 @@
 
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
-import org.onosproject.yangutils.translator.tojava.HasJavaFileInfo;
+import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
 
 import static org.onosproject.yangutils.utils.UtilConstants.COLAN;
@@ -111,16 +111,16 @@
     public static String getCurNodePackage(YangNode curNode) {
 
         String pkg;
-        if (!(curNode instanceof HasJavaFileInfo)
+        if (!(curNode instanceof JavaFileInfoContainer)
                 || curNode.getParent() == null) {
             throw new TranslatorException("missing parent node to get current node's package");
         }
 
         YangNode parentNode = getParentNodeInGenCode(curNode);
-        if (!(parentNode instanceof HasJavaFileInfo)) {
+        if (!(parentNode instanceof JavaFileInfoContainer)) {
             throw new TranslatorException("missing parent java node to get current node's package");
         }
-        JavaFileInfo parentJavaFileHandle = ((HasJavaFileInfo) parentNode).getJavaFileInfo();
+        JavaFileInfo parentJavaFileHandle = ((JavaFileInfoContainer) parentNode).getJavaFileInfo();
         pkg = parentJavaFileHandle.getPackage() + PERIOD + parentJavaFileHandle.getJavaName();
         return pkg.toLowerCase();
     }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
index 99ab915..6723ce5 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
@@ -138,7 +138,7 @@
     /**
      * Returns setter string.
      *
-     * @param attr      attribute info
+     * @param attr attribute info
      * @param className java class name
      * @return setter string
      */
@@ -164,7 +164,7 @@
     /**
      * Returns default constructor method string.
      *
-     * @param name         class name
+     * @param name class name
      * @param modifierType modifier type
      * @return default constructor string
      */
@@ -228,7 +228,7 @@
     /**
      * Returns the setter method strings for class file.
      *
-     * @param attr      attribute info
+     * @param attr attribute info
      * @param className name of the class
      * @return setter method for class
      */
@@ -247,8 +247,8 @@
      * Returns setter for attribute.
      *
      * @param className class name
-     * @param name      attribute name
-     * @param type      return type
+     * @param name attribute name
+     * @param type return type
      * @return setter for attribute
      */
     private static String getSetter(String className, String name, String type) {
@@ -298,9 +298,9 @@
     /**
      * Returns the getter method strings for interface file.
      *
-     * @param yangName   name of the attribute
+     * @param yangName name of the attribute
      * @param returnType return type of attribute
-     * @param isList     is list attribute
+     * @param isList is list attribute
      * @return getter method for interface
      */
     public static String getGetterForInterface(String yangName, String returnType, boolean isList) {
@@ -316,7 +316,7 @@
      * Returns getter for attribute in interface.
      *
      * @param returnType return type
-     * @param yangName   attribute name
+     * @param yangName attribute name
      * @return getter for interface
      */
     private static String getGetterInterfaceString(String returnType, String yangName) {
@@ -327,10 +327,10 @@
     /**
      * Returns the setter method strings for interface file.
      *
-     * @param attrName  name of the attribute
-     * @param attrType  return type of attribute
+     * @param attrName name of the attribute
+     * @param attrType return type of attribute
      * @param className name of the java class being generated
-     * @param isList    is list attribute
+     * @param isList is list attribute
      * @return setter method for interface
      */
     public static String getSetterForInterface(String attrName, String attrType, String className, boolean isList) {
@@ -346,8 +346,8 @@
      * Returns setter string for interface.
      *
      * @param className class name
-     * @param attrName  attribute name
-     * @param attrType  attribute type
+     * @param attrName attribute name
+     * @param attrType attribute type
      * @return setter string
      */
     private static String getSetterInterfaceString(String className, String attrName, String attrType) {
@@ -410,7 +410,7 @@
      * Returns the constructor strings for class file.
      *
      * @param yangName name of the class
-     * @param attr     attribute info
+     * @param attr attribute info
      * @return constructor for class
      */
     public static String getConstructor(String yangName, JavaAttributeInfo attr) {
@@ -428,8 +428,8 @@
     /**
      * Returns the rpc strings for service interface.
      *
-     * @param rpcName    name of the rpc
-     * @param inputName  name of input
+     * @param rpcName name of the rpc
+     * @param inputName name of input
      * @param outputName name of output
      * @return rpc method string
      */
@@ -459,7 +459,7 @@
     /**
      * Returns the Default constructor strings for class file.
      *
-     * @param name         name of the class
+     * @param name name of the class
      * @param modifierType modifier type for default constructor
      * @return Default constructor for class
      */
@@ -536,13 +536,13 @@
     /**
      * Return from string method's body string.
      *
-     * @param attr                    attribute info
+     * @param attr attribute info
      * @param fromStringAttributeInfo attribute info for the from string
-     *                                wrapper type
+     * wrapper type
      * @return from string method's body string
      */
     public static String getFromStringMethod(JavaAttributeInfo attr,
-                                             JavaAttributeInfo fromStringAttributeInfo) {
+            JavaAttributeInfo fromStringAttributeInfo) {
 
         return EIGHT_SPACE_INDENTATION + getTrySubString() + NEW_LINE + TWELVE_SPACE_INDENTATION
                 + getParsedSubString(attr, fromStringAttributeInfo) + SEMI_COLAN + NEW_LINE + TWELVE_SPACE_INDENTATION
@@ -585,7 +585,7 @@
      * @return sub string with parsed statement for union's from string method
      */
     private static String getParsedSubString(JavaAttributeInfo attr,
-                                             JavaAttributeInfo fromStringAttributeInfo) {
+            JavaAttributeInfo fromStringAttributeInfo) {
 
         String targetDataType = getReturnType(attr);
         String parseFromStringMethod = getParseFromStringMethod(targetDataType,
@@ -731,7 +731,7 @@
     /**
      * Returns of method's string and java doc for special type.
      *
-     * @param attr                   attribute info
+     * @param attr attribute info
      * @param generatedJavaClassName class name
      * @return of method's string and java doc for special type
      */
@@ -747,7 +747,7 @@
     /**
      * Returns of method's string.
      *
-     * @param type      data type
+     * @param type data type
      * @param className class name
      * @return of method's string
      */
@@ -762,7 +762,7 @@
     /**
      * Returns string and java doc for constructor of type class.
      *
-     * @param attr                   attribute info
+     * @param attr attribute info
      * @param generatedJavaClassName class name
      * @return string and java doc for constructor of type class
      */
@@ -778,8 +778,8 @@
     /**
      * Returns type constructor string.
      *
-     * @param type      data type
-     * @param name      attribute name
+     * @param type data type
+     * @param name attribute name
      * @param className class name
      * @return type constructor string
      */
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
index a82d7d4..1e1982a 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
@@ -21,7 +21,7 @@
 import java.util.List;
 
 import org.onosproject.yangutils.datamodel.YangNode;
-import org.onosproject.yangutils.translator.tojava.HasJavaImportData;
+import org.onosproject.yangutils.translator.tojava.JavaImportDataContainer;
 
 import static org.onosproject.yangutils.translator.tojava.JavaImportData.getAugmentedInfoImport;
 import static org.onosproject.yangutils.translator.tojava.JavaImportData.getHasAugmentationImport;
@@ -52,9 +52,9 @@
      * @return import list
      */
     public static List<String> addImportsToStringAndHasCodeMethods(YangNode curNode, List<String> imports) {
-        if (curNode instanceof HasJavaImportData) {
-            imports.add(((HasJavaImportData) curNode).getJavaImportData().getImportForHashAndEquals());
-            imports.add(((HasJavaImportData) curNode).getJavaImportData().getImportForToString());
+        if (curNode instanceof JavaImportDataContainer) {
+            imports.add(((JavaImportDataContainer) curNode).getJavaImportData().getImportForHashAndEquals());
+            imports.add(((JavaImportDataContainer) curNode).getJavaImportData().getImportForToString());
         }
         return imports;
     }
@@ -68,7 +68,7 @@
      * @return import for HasAugmentation class
      */
     public static List<String> addHasAugmentationImport(YangNode curNode, List<String> imports, boolean operation) {
-        if (curNode instanceof HasJavaImportData) {
+        if (curNode instanceof JavaImportDataContainer) {
             String thisImport = getHasAugmentationImport();
             performOperationOnImports(imports, thisImport, operation);
         }
@@ -84,7 +84,7 @@
      * @return import for AugmentedInfo class
      */
     public static List<String> addAugmentedInfoImport(YangNode curNode, List<String> imports, boolean operation) {
-        if (curNode instanceof HasJavaImportData) {
+        if (curNode instanceof JavaImportDataContainer) {
             String thisImport = getAugmentedInfoImport();
             performOperationOnImports(imports, thisImport, operation);
         }
@@ -100,7 +100,7 @@
      * @return import for HasAugmentation class
      */
     public static List<String> addArrayListImport(YangNode curNode, List<String> imports, boolean operation) {
-        if (curNode instanceof HasJavaImportData) {
+        if (curNode instanceof JavaImportDataContainer) {
             String arrayListImport = getImportForArrayList();
             String listImport = getImportForList();
             performOperationOnImports(imports, arrayListImport, operation);
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
index 4f3cb45..eb5d537 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
@@ -17,7 +17,8 @@
 package org.onosproject.yangutils.translator.tojava.utils;
 
 import java.io.IOException;
-import org.onosproject.yangutils.datamodel.HasType;
+
+import org.onosproject.yangutils.datamodel.YangTypeContainer;
 import org.onosproject.yangutils.datamodel.YangAugment;
 import org.onosproject.yangutils.datamodel.YangCase;
 import org.onosproject.yangutils.datamodel.YangChoice;
@@ -28,11 +29,13 @@
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.datamodel.YangNotification;
 import org.onosproject.yangutils.datamodel.YangOutput;
-import org.onosproject.yangutils.translator.tojava.HasJavaFileInfo;
+import org.onosproject.yangutils.translator.exception.TranslatorException;
+import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.javamodel.JavaCodeGeneratorInfo;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration;
 
+import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.addCurNodeInfoInParentTempFile;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCurNodePackage;
@@ -40,7 +43,6 @@
 import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED_INFO;
 import static org.onosproject.yangutils.utils.UtilConstants.HAS_AUGMENTATION;
 import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
-import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
 
 /**
  * Represents utility class for YANG java model.
@@ -56,30 +58,30 @@
     /**
      * Updates YANG java file package information.
      *
-     * @param hasJavaFileInfo YANG java file info node
-     * @param yangPlugin      YANG plugin config
+     * @param javaCodeGeneratorInfo YANG java file info node
+     * @param yangPlugin YANG plugin config
      * @throws IOException IO operations fails
      */
-    public static void updatePackageInfo(HasJavaFileInfo hasJavaFileInfo, YangPluginConfig yangPlugin)
+    public static void updatePackageInfo(JavaCodeGeneratorInfo javaCodeGeneratorInfo, YangPluginConfig yangPlugin)
             throws IOException {
-        hasJavaFileInfo.getJavaFileInfo()
+        javaCodeGeneratorInfo.getJavaFileInfo()
                 .setJavaName(getCaptialCase(
-                        getCamelCase(((YangNode) hasJavaFileInfo).getName(), yangPlugin.getConflictResolver())));
-        hasJavaFileInfo.getJavaFileInfo().setPackage(getCurNodePackage((YangNode) hasJavaFileInfo));
-        hasJavaFileInfo.getJavaFileInfo().setPackageFilePath(
-                getPackageDirPathFromJavaJPackage(hasJavaFileInfo.getJavaFileInfo().getPackage()));
-        hasJavaFileInfo.getJavaFileInfo().setBaseCodeGenPath(yangPlugin.getCodeGenDir());
+                        getCamelCase(((YangNode) javaCodeGeneratorInfo).getName(), yangPlugin.getConflictResolver())));
+        javaCodeGeneratorInfo.getJavaFileInfo().setPackage(getCurNodePackage((YangNode) javaCodeGeneratorInfo));
+        javaCodeGeneratorInfo.getJavaFileInfo().setPackageFilePath(
+                getPackageDirPathFromJavaJPackage(javaCodeGeneratorInfo.getJavaFileInfo().getPackage()));
+        javaCodeGeneratorInfo.getJavaFileInfo().setBaseCodeGenPath(yangPlugin.getCodeGenDir());
     }
 
     /**
      * Updates YANG java file package information for specified package.
      *
      * @param javaCodeGeneratorInfo YANG java file info node
-     * @param yangPlugin            YANG plugin config
+     * @param yangPlugin YANG plugin config
      * @throws IOException IO operations fails
      */
     private static void updatePackageInfo(JavaCodeGeneratorInfo javaCodeGeneratorInfo, YangPluginConfig yangPlugin,
-                                          String pkg)
+            String pkg)
             throws IOException {
         javaCodeGeneratorInfo.getJavaFileInfo()
                 .setJavaName(getCaptialCase(
@@ -96,13 +98,10 @@
      * @param javaCodeGeneratorInfo YANG java file info node
      * @throws IOException IO operations fails
      */
-    private static void createTempFragmentFile(JavaCodeGeneratorInfo javaCodeGeneratorInfo) throws IOException {
-        String absolutePath = getAbsolutePackagePath(javaCodeGeneratorInfo.getJavaFileInfo().getBaseCodeGenPath(),
-                javaCodeGeneratorInfo.getJavaFileInfo().getPackageFilePath());
-
+    private static void createTempFragmentFile(JavaCodeGeneratorInfo javaCodeGeneratorInfo)
+            throws IOException {
         javaCodeGeneratorInfo.setTempJavaCodeFragmentFiles(
-                new TempJavaCodeFragmentFiles(javaCodeGeneratorInfo.getJavaFileInfo().getGeneratedFileTypes(),
-                        absolutePath, javaCodeGeneratorInfo.getJavaFileInfo().getJavaName()));
+                new TempJavaCodeFragmentFiles(javaCodeGeneratorInfo.getJavaFileInfo()));
     }
 
     /**
@@ -111,19 +110,21 @@
      * @param javaCodeGeneratorInfo YANG java file info node
      * @throws IOException IO operations fails
      */
-    private static void updateLeafInfoInTempFragmentFiles(JavaCodeGeneratorInfo javaCodeGeneratorInfo)
+    private static void updateTempFragmentFiles(JavaCodeGeneratorInfo javaCodeGeneratorInfo)
             throws IOException {
         if (javaCodeGeneratorInfo instanceof YangLeavesHolder) {
             javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
                     .addCurNodeLeavesInfoToTempFiles((YangNode) javaCodeGeneratorInfo);
-        } else if (javaCodeGeneratorInfo instanceof HasType) {
+        } else if (javaCodeGeneratorInfo instanceof YangTypeContainer) {
             javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
-                    .addTypeInfoToTempFiles((HasType) javaCodeGeneratorInfo);
+                    .addTypeInfoToTempFiles((YangTypeContainer) javaCodeGeneratorInfo);
         } else if (javaCodeGeneratorInfo instanceof YangJavaEnumeration) {
             javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
                     .addEnumAttributeToTempFiles((YangNode) javaCodeGeneratorInfo);
+        } else if (javaCodeGeneratorInfo instanceof YangChoice) {
+            /*Do nothing, only the interface needs to be generated*/
         } else {
-            //TODO throw exception
+            throw new TranslatorException("Unsupported Node Translation");
         }
     }
 
@@ -131,16 +132,15 @@
      * Process generate code entry of YANG node.
      *
      * @param javaCodeGeneratorInfo YANG java file info node
-     * @param codeGenDir            code generation directory
      * @throws IOException IO operations fails
      */
     private static void generateTempFiles(JavaCodeGeneratorInfo javaCodeGeneratorInfo, String codeGenDir)
             throws IOException {
         if (!(javaCodeGeneratorInfo instanceof YangNode)) {
-            // TODO:throw exception
+            throw new TranslatorException("translation is not supported for the node");
         }
         createTempFragmentFile(javaCodeGeneratorInfo);
-        updateLeafInfoInTempFragmentFiles(javaCodeGeneratorInfo);
+        updateTempFragmentFiles(javaCodeGeneratorInfo);
 
     }
 
@@ -148,23 +148,44 @@
      * Process generate code entry of YANG node.
      *
      * @param javaCodeGeneratorInfo YANG java file info node
-     * @param yangPlugin            YANG plugin config
-     * @param isMultiInstance       flag to indicate whether it's a list
+     * @param yangPlugin YANG plugin config
+     * @param isMultiInstance flag to indicate whether it's a list
      * @throws IOException IO operations fails
      */
-    public static void generateCodeOfNode(JavaCodeGeneratorInfo javaCodeGeneratorInfo, YangPluginConfig yangPlugin,
-                                          boolean isMultiInstance) throws IOException {
+    public static void generateCodeAndUpdateInParent(JavaCodeGeneratorInfo javaCodeGeneratorInfo,
+            YangPluginConfig yangPlugin, boolean isMultiInstance)
+            throws IOException {
         if (!(javaCodeGeneratorInfo instanceof YangNode)) {
-            // TODO:throw exception
+            throw new TranslatorException("Invalid node for translation");
         }
-        updatePackageInfo((HasJavaFileInfo) javaCodeGeneratorInfo, yangPlugin);
-        generateTempFiles(javaCodeGeneratorInfo, yangPlugin.getCodeGenDir());
 
-        if (!(javaCodeGeneratorInfo instanceof YangCase)) {
-            javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
-                    .addCurNodeInfoInParentTempFile((YangNode) javaCodeGeneratorInfo, isMultiInstance);
+        /**
+         * Generate the Java files corresponding to the current node.
+         */
+        generateCodeOfAugmentableNode(javaCodeGeneratorInfo, yangPlugin);
+
+        /**
+         * Update the current nodes info in its parent nodes generated files.
+         */
+        addCurNodeInfoInParentTempFile((YangNode) javaCodeGeneratorInfo, isMultiInstance);
+    }
+
+    /**
+     * Process generate code entry of YANG type.
+     *
+     * @param javaCodeGeneratorInfo YANG java file info node
+     * @param yangPlugin YANG plugin config
+     * @throws IOException IO operations fails
+     */
+    public static void generateCodeOfAugmentableNode(JavaCodeGeneratorInfo javaCodeGeneratorInfo,
+            YangPluginConfig yangPlugin)
+            throws IOException {
+        if (!(javaCodeGeneratorInfo instanceof YangNode)) {
+            throw new TranslatorException("invalid node for translation");
         }
 
+        generateCodeOfNode(javaCodeGeneratorInfo, yangPlugin);
+
         /**
          * For augmentation of nodes.
          */
@@ -185,11 +206,11 @@
             String curNodeName = ((YangCase) javaCodeGeneratorInfo).getName();
             if (!parent.getName().equals(curNodeName)) {
                 javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().addToExtendsList(getCaptialCase(getCamelCase(
-                    parent.getName(), null)));
-                javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().addParentInfoInCurNodeTempFile((YangNode)
-                    javaCodeGeneratorInfo);
+                        parent.getName(), null)));
+                javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().getBeanTempFiles()
+                        .addParentInfoInCurNodeTempFile((YangNode) javaCodeGeneratorInfo);
             } else {
-                String parentPackage = ((HasJavaFileInfo) parent).getJavaFileInfo().getPackage();
+                String parentPackage = ((JavaFileInfoContainer) parent).getJavaFileInfo().getPackage();
                 String caseExtendInfo = parentPackage + PERIOD + parent.getName();
                 javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().addToExtendsList(caseExtendInfo);
             }
@@ -200,7 +221,7 @@
      * Process generate code entry of YANG type.
      *
      * @param javaCodeGeneratorInfo YANG java file info node
-     * @param yangPlugin            YANG plugin config
+     * @param yangPlugin YANG plugin config
      * @throws IOException IO operations fails
      */
     public static void generateCodeOfNode(JavaCodeGeneratorInfo javaCodeGeneratorInfo, YangPluginConfig yangPlugin)
@@ -208,7 +229,7 @@
         if (!(javaCodeGeneratorInfo instanceof YangNode)) {
             // TODO:throw exception
         }
-        updatePackageInfo((HasJavaFileInfo) javaCodeGeneratorInfo, yangPlugin);
+        updatePackageInfo(javaCodeGeneratorInfo, yangPlugin);
         generateTempFiles(javaCodeGeneratorInfo, yangPlugin.getCodeGenDir());
     }
 
@@ -216,12 +237,13 @@
      * Process generate code entry of root node.
      *
      * @param javaCodeGeneratorInfo YANG java file info node
-     * @param yangPlugin            YANG plugin config
-     * @param rootPkg               package of the root node
+     * @param yangPlugin YANG plugin config
+     * @param rootPkg package of the root node
      * @throws IOException IO operations fails
      */
     public static void generateCodeOfRootNode(JavaCodeGeneratorInfo javaCodeGeneratorInfo, YangPluginConfig yangPlugin,
-                                              String rootPkg) throws IOException {
+            String rootPkg)
+            throws IOException {
         if (!(javaCodeGeneratorInfo instanceof YangNode)) {
             // TODO:throw exception
         }
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/linker/IntraFileTypeLinkingTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/linker/IntraFileTypeLinkingTest.java
index 956867d..82e9c3a 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/linker/IntraFileTypeLinkingTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/linker/IntraFileTypeLinkingTest.java
@@ -65,7 +65,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("hello"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
 
@@ -104,7 +104,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("hello"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
 
@@ -144,7 +144,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("hello"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
 
@@ -184,7 +184,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("hello"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
 
@@ -222,7 +222,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("FirstClass"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
 
@@ -274,7 +274,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("FirstClass"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
 
@@ -325,7 +325,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("FirstClass"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
 
@@ -377,7 +377,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("FirstClass"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
 
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/linker/IntraFileUsesLinkingTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/linker/IntraFileUsesLinkingTest.java
index 472d453..352b3d0 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/linker/IntraFileUsesLinkingTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/linker/IntraFileUsesLinkingTest.java
@@ -80,7 +80,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under grouping.
-        assertThat(leafInfo.getLeafName(), is("hello"));
+        assertThat(leafInfo.getName(), is("hello"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("String"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
@@ -96,7 +96,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under module.
-        assertThat(leafInfo.getLeafName(), is("hello"));
+        assertThat(leafInfo.getName(), is("hello"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("String"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
@@ -134,7 +134,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under grouping.
-        assertThat(leafInfo.getLeafName(), is("treat"));
+        assertThat(leafInfo.getName(), is("treat"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("String"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
@@ -149,7 +149,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under container which is under grouping.
-        assertThat(leafInfo.getLeafName(), is("leaf2"));
+        assertThat(leafInfo.getName(), is("leaf2"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("String"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
@@ -165,7 +165,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under module.
-        assertThat(leafInfo.getLeafName(), is("treat"));
+        assertThat(leafInfo.getName(), is("treat"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("String"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
@@ -180,7 +180,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under container which is under module.
-        assertThat(leafInfo.getLeafName(), is("leaf2"));
+        assertThat(leafInfo.getName(), is("leaf2"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("String"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
     }
@@ -227,7 +227,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under list which is under grouping.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -253,7 +253,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under list which is deep copied.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -282,7 +282,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under list which is deep copied.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -353,7 +353,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under design-container.
-        assertThat(leafInfo.getLeafName(), is("ink"));
+        assertThat(leafInfo.getName(), is("ink"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("int32"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
 
@@ -374,7 +374,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under correct-container.
-        assertThat(leafInfo.getLeafName(), is("newone"));
+        assertThat(leafInfo.getName(), is("newone"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
@@ -397,7 +397,7 @@
 
         // Check whether the information in the leaf is correct under container
         // which has been deep copied from grouping.
-        assertThat(leafInfo.getLeafName(), is("zip-code"));
+        assertThat(leafInfo.getName(), is("zip-code"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
@@ -426,7 +426,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under list which has been deep copied from grouping.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -441,7 +441,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under grouping.
-        assertThat(leafInfo.getLeafName(), is("zip-code"));
+        assertThat(leafInfo.getName(), is("zip-code"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
@@ -517,7 +517,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under grouping.
-        assertThat(leafInfo.getLeafName(), is("carry"));
+        assertThat(leafInfo.getName(), is("carry"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
@@ -550,7 +550,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under list.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
     }
@@ -687,7 +687,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under grouping.
-        assertThat(leafInfo.getLeafName(), is("hello"));
+        assertThat(leafInfo.getName(), is("hello"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("String"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
 
@@ -761,7 +761,7 @@
         leafInfo = leafIterator.next();
 
         // Check whether the information in the leaf is correct under grouping.
-        assertThat(leafInfo.getLeafName(), is("hello"));
+        assertThat(leafInfo.getName(), is("hello"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("String"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
     }
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListenerTest.java
index bb59e65..3ce2fd0 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListenerTest.java
@@ -62,7 +62,7 @@
         ListIterator<YangLeaf> leafIterator = yangAugment.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("ds0ChannelNumber"));
+        assertThat(leafInfo.getName(), is("ds0ChannelNumber"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("ChannelNumber"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
     }
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/BitListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/BitListenerTest.java
index b5bc1c5..3aceb34 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/BitListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/BitListenerTest.java
@@ -61,7 +61,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("mybits"));
+        assertThat(leafInfo.getName(), is("mybits"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("bits"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.BITS));
         assertThat(((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitsName(),
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/CaseListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/CaseListenerTest.java
index a403c5a..675a9e9 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/CaseListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/CaseListenerTest.java
@@ -70,7 +70,7 @@
         ListIterator<YangLeaf> leafIterator1 = yangCase1.getListOfLeaf().listIterator();
         YangLeaf leafInfo1 = leafIterator1.next();
 
-        assertThat(leafInfo1.getLeafName(), is("pretzel"));
+        assertThat(leafInfo1.getName(), is("pretzel"));
 
         YangCase yangCase2 = (YangCase) yangCase1.getNextSibling();
         assertThat(yangCase2.getName(), is("late-night"));
@@ -79,7 +79,7 @@
         ListIterator<YangLeaf> leafIterator2 = yangCase2.getListOfLeaf().listIterator();
         YangLeaf leafInfo2 = leafIterator2.next();
 
-        assertThat(leafInfo2.getLeafName(), is("chocolate"));
+        assertThat(leafInfo2.getName(), is("chocolate"));
     }
 
     /**
@@ -140,7 +140,7 @@
         ListIterator<YangLeaf> leafIterator1 = yangCase1.getListOfLeaf().listIterator();
         YangLeaf leafInfo1 = leafIterator1.next();
 
-        assertThat(leafInfo1.getLeafName(), is("pretzel"));
+        assertThat(leafInfo1.getName(), is("pretzel"));
 
         YangChoice yangChoice2 = (YangChoice) yangChoice.getNextSibling();
         assertThat(yangChoice2.getName(), is("lunch"));
@@ -152,7 +152,7 @@
         ListIterator<YangLeaf> leafIterator2 = yangCase2.getListOfLeaf().listIterator();
         YangLeaf leafInfo2 = leafIterator2.next();
 
-        assertThat(leafInfo2.getLeafName(), is("chocolate"));
+        assertThat(leafInfo2.getName(), is("chocolate"));
     }
 
     /**
@@ -186,7 +186,7 @@
         ListIterator<YangLeaf> leafIterator1 = yangCase1.getListOfLeaf().listIterator();
         YangLeaf leafInfo1 = leafIterator1.next();
 
-        assertThat(leafInfo1.getLeafName(), is("pretzel"));
+        assertThat(leafInfo1.getName(), is("pretzel"));
 
         YangCase yangCase2 = (YangCase) yangCase1.getNextSibling();
         assertThat(yangCase2.getName(), is("late-night"));
@@ -200,6 +200,6 @@
         // Check whether leaf properties as set correctly.
         ListIterator<YangLeaf> leafIterator2 = yangCase3.getListOfLeaf().listIterator();
         YangLeaf leafInfo2 = leafIterator2.next();
-        assertThat(leafInfo2.getLeafName(), is("beer"));
+        assertThat(leafInfo2.getName(), is("beer"));
     }
 }
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ConfigListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ConfigListenerTest.java
index 210b2d9..439832f 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ConfigListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ConfigListenerTest.java
@@ -68,7 +68,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether the Config value is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.isConfig(), is(true));
     }
 
@@ -94,7 +94,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether the Config value is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.isConfig(), is(false));
     }
 
@@ -168,7 +168,7 @@
         ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -204,7 +204,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -236,7 +236,7 @@
         YangLeafList leafListInfo = leafListIterator.next();
 
         // Check whether config value is set correctly.
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.isConfig(), is(true));
     }
 
@@ -262,7 +262,7 @@
         ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.isConfig(), is(true));
     }
 
@@ -367,7 +367,7 @@
         YangLeafList leafListInfo = leafListIterator.next();
 
         // Check whether config value is set correctly.
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.isConfig(), is(true));
 
     }
@@ -395,7 +395,7 @@
         ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.isConfig(), is(true));
     }
 
@@ -475,7 +475,7 @@
         YangLeafList leafListInfo = leafListIterator.next();
 
         // Check whether config value is set correctly.
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.isConfig(), is(true));
     }
 
@@ -502,7 +502,7 @@
         ListIterator<YangLeaf> leafIterator = list1.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.isConfig(), is(true));
     }
 
@@ -531,4 +531,4 @@
         assertThat(childList.getName(), is("list1"));
         assertThat(childList.isConfig(), is(true));
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ContainerListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ContainerListenerTest.java
index 4e7e31b..a149da2 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ContainerListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ContainerListenerTest.java
@@ -192,7 +192,7 @@
         ListIterator<YangLeaf> leafIterator = yangContainer.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/DescriptionListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/DescriptionListenerTest.java
index fcaf670..c3989a6 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/DescriptionListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/DescriptionListenerTest.java
@@ -68,7 +68,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether the description is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
     }
 
@@ -176,7 +176,7 @@
         ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -213,7 +213,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -245,7 +245,7 @@
         YangLeafList leafListInfo = leafListIterator.next();
 
         // Check whether description value is set correctly.
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/EnumListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/EnumListenerTest.java
index 67ef587..6f13667 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/EnumListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/EnumListenerTest.java
@@ -61,7 +61,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("speed"));
+        assertThat(leafInfo.getName(), is("speed"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("enumeration"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
         assertThat(((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getName(),
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListenerTest.java
index e9b12bc..acd0c8a 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListenerTest.java
@@ -64,7 +64,7 @@
         ListIterator<YangLeaf> leafIterator = yangGrouping.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("address"));
+        assertThat(leafInfo.getName(), is("address"));
     }
 
     /**
@@ -94,7 +94,7 @@
         ListIterator<YangLeaf> leafIterator = yangGrouping.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("address"));
+        assertThat(leafInfo.getName(), is("address"));
     }
 
     /**
@@ -124,7 +124,7 @@
         ListIterator<YangLeaf> leafIterator = yangGrouping.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("address"));
+        assertThat(leafInfo.getName(), is("address"));
     }
 
     /**
@@ -157,7 +157,7 @@
         ListIterator<YangLeaf> leafIterator = yangGrouping.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("address"));
+        assertThat(leafInfo.getName(), is("address"));
     }
 
     /**
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/InputListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/InputListenerTest.java
index 61775f6..c85c1d5 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/InputListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/InputListenerTest.java
@@ -65,7 +65,7 @@
         ListIterator<YangLeaf> leafIterator = yangInput.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("image-name"));
+        assertThat(leafInfo.getName(), is("image-name"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
 
         YangList yangList = (YangList) yangInput.getChild();
@@ -76,7 +76,7 @@
         assertThat(yangList.getMinElements(), is(3));
         leafIterator = yangList.getListOfLeaf().listIterator();
         leafInfo = leafIterator.next();
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
 
         YangContainer yangContainer = (YangContainer) yangList.getNextSibling();
@@ -84,7 +84,7 @@
 
         leafIterator = yangContainer.getListOfLeaf().listIterator();
         leafInfo = leafIterator.next();
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
     }
 
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListenerTest.java
index dec9df1..fe918fa 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListenerTest.java
@@ -66,7 +66,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafListInfo.getUnits(), is("\"seconds\""));
@@ -161,7 +161,7 @@
         ListIterator<YangLeafList> leafListIterator = container.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafListInfo.getUnits(), is("\"seconds\""));
@@ -198,7 +198,7 @@
         ListIterator<YangLeafList> leafListIterator = yangList.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafListInfo.getUnits(), is("\"seconds\""));
@@ -208,4 +208,4 @@
         assertThat(leafListInfo.getStatus(), is(YangStatusType.CURRENT));
         assertThat(leafListInfo.getReference(), is("\"RFC 6020\""));
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListenerTest.java
index bd53d76..186d549 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LeafListenerTest.java
@@ -67,7 +67,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -161,7 +161,7 @@
         ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -224,7 +224,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListenerTest.java
index a8f494b..513c7ed 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListenerTest.java
@@ -67,7 +67,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
         YangStringRestriction stringRestriction = (YangStringRestriction) leafInfo
@@ -99,7 +99,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
         YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
@@ -167,7 +167,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
         YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
@@ -199,7 +199,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
         YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ListListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ListListenerTest.java
index 2ab279d..526a645 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ListListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ListListenerTest.java
@@ -161,7 +161,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -208,4 +208,4 @@
         thrown.expectMessage("YANG file error : list name 1valid is not valid.");
         YangNode node = manager.getDataModel("src/test/resources/ListInvalidIdentifier.yang");
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MandatoryListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MandatoryListenerTest.java
index ca4d2f0..246d4b0 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MandatoryListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MandatoryListenerTest.java
@@ -64,7 +64,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether the mandatory value is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.isMandatory(), is(true));
     }
 
@@ -90,7 +90,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether the mandatory value is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.isMandatory(), is(false));
     }
 
@@ -116,7 +116,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether the mandatory value is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.isMandatory(), is(false));
     }
 
@@ -154,4 +154,4 @@
                 + " 'revision', 'rpc', 'typedef', 'uses', '}'}");
         YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementMandatory.yang");
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MaxElementsListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MaxElementsListenerTest.java
index 1097b75..c531b85 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MaxElementsListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MaxElementsListenerTest.java
@@ -64,7 +64,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getMaxElelements(), is(3));
     }
 
@@ -148,7 +148,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getMaxElelements(), is(2147483647));
     }
 
@@ -173,7 +173,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getMaxElelements(), is(2147483647));
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MinElementsListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MinElementsListenerTest.java
index 0ce767cf..bf1afb8 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MinElementsListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MinElementsListenerTest.java
@@ -64,7 +64,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getMinElements(), is(3));
     }
 
@@ -159,7 +159,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getMinElements(), is(0));
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListenerTest.java
index 59eace7..3b9907e 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListenerTest.java
@@ -65,7 +65,7 @@
         ListIterator<YangLeaf> leafIterator = yangNotification.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("if-name"));
+        assertThat(leafInfo.getName(), is("if-name"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("leafref"));
     }
 }
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/OutputListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/OutputListenerTest.java
index 2ea9347..a727092 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/OutputListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/OutputListenerTest.java
@@ -64,7 +64,7 @@
         ListIterator<YangLeaf> leafIterator = yangOutput.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("image-name"));
+        assertThat(leafInfo.getName(), is("image-name"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
 
         YangList yangList = (YangList) yangOutput.getChild();
@@ -75,7 +75,7 @@
         assertThat(yangList.getMinElements(), is(3));
         leafIterator = yangList.getListOfLeaf().listIterator();
         leafInfo = leafIterator.next();
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
 
         YangContainer yangContainer = (YangContainer) yangList.getNextSibling();
@@ -83,7 +83,7 @@
 
         leafIterator = yangContainer.getListOfLeaf().listIterator();
         leafInfo = leafIterator.next();
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
     }
 
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListenerTest.java
index fb0ec72..00db373 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListenerTest.java
@@ -58,7 +58,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
         YangStringRestriction stringRestriction = (YangStringRestriction) leafInfo
@@ -84,7 +84,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
         YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
@@ -131,7 +131,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
         YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
@@ -157,7 +157,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
         YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PositionListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PositionListenerTest.java
index 9b3a192..7d252ba 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PositionListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/PositionListenerTest.java
@@ -61,7 +61,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("mybits"));
+        assertThat(leafInfo.getName(), is("mybits"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("bits"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.BITS));
         assertThat(((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitsName(),
@@ -100,7 +100,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("mybits"));
+        assertThat(leafInfo.getName(), is("mybits"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("bits"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.BITS));
         assertThat(((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitsName(),
@@ -139,7 +139,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("mybits"));
+        assertThat(leafInfo.getName(), is("mybits"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("bits"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.BITS));
         assertThat(((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitsName(),
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListenerTest.java
index 3ae527b..7935abc 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListenerTest.java
@@ -63,7 +63,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("int32"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
         YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafInfo
@@ -92,7 +92,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("int32"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
         YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafListInfo
@@ -122,7 +122,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("int32"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
         YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafListInfo
@@ -152,7 +152,7 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("int32"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
         YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafListInfo
@@ -175,4 +175,4 @@
         thrown.expectMessage("YANG file error : a is not valid.");
         YangNode node = manager.getDataModel("src/test/resources/RangeWithInvalidIntegerPattern.yang");
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ReferenceListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ReferenceListenerTest.java
index 6d1ef93..17a679a 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ReferenceListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ReferenceListenerTest.java
@@ -68,7 +68,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether the reference is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
     }
 
@@ -175,7 +175,7 @@
         ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -212,7 +212,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -244,7 +244,7 @@
         YangLeafList leafListInfo = leafListIterator.next();
 
         // Check whether description value is set correctly.
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getReference(), is("\"RFC 6020\""));
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/StatusListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/StatusListenerTest.java
index 8e44429..7f0d1ea 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/StatusListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/StatusListenerTest.java
@@ -68,7 +68,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether the status is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
     }
 
@@ -94,7 +94,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether the status is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getStatus(), is(YangStatusType.DEPRECATED));
     }
 
@@ -120,7 +120,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether the status is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getStatus(), is(YangStatusType.OBSOLETE));
     }
 
@@ -185,7 +185,7 @@
         ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -222,7 +222,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
@@ -254,7 +254,7 @@
         YangLeafList leafListInfo = leafListIterator.next();
 
         // Check whether status is set correctly.
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.isConfig(), is(true));
         assertThat(leafListInfo.getStatus(), is(YangStatusType.CURRENT));
     }
@@ -281,8 +281,8 @@
         YangLeafList leafListInfo = leafListIterator.next();
 
         // Check whether status is set correctly.
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.isConfig(), is(true));
         assertThat(leafListInfo.getStatus(), is(YangStatusType.CURRENT));
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/TypeListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/TypeListenerTest.java
index b3e4351..1737ea6 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/TypeListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/TypeListenerTest.java
@@ -58,7 +58,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("hello"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
     }
@@ -84,7 +84,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
     }
@@ -110,8 +110,8 @@
         ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnionListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnionListenerTest.java
index d05a42c..1ac199f 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnionListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnionListenerTest.java
@@ -66,7 +66,7 @@
         ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
 
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UNION));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("union"));
@@ -110,7 +110,7 @@
         ListIterator<YangLeafList> leafListIterator = yangList.getListOfLeafList().listIterator();
         YangLeafList leafListInfo = leafListIterator.next();
 
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
 
         assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.UNION));
         assertThat(leafListInfo.getDataType().getDataTypeName(), is("union"));
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnitsListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnitsListenerTest.java
index 19b8730..6479991 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnitsListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/UnitsListenerTest.java
@@ -66,7 +66,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether units value is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
     }
 
@@ -115,7 +115,7 @@
         YangLeaf leafInfo = leafIterator.next();
 
         // Check whether leaf properties is set correctly.
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
         assertThat(leafInfo.getUnits(), is("\"seconds\""));
         assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
@@ -146,7 +146,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafInfo.getName(), is("invalid-interval"));
         assertThat(leafInfo.getUnits(), is(nullValue()));
     }
 
@@ -182,7 +182,7 @@
         YangLeafList leafListInfo = leafListIterator.next();
 
         // Check whether units value is set correctly.
-        assertThat(leafListInfo.getLeafName(), is("invalid-interval"));
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
         assertThat(leafListInfo.getUnits(), is("\"seconds\""));
     }
-}
\ No newline at end of file
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ValueListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ValueListenerTest.java
index fb7c1d0..f0d5357 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ValueListenerTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ValueListenerTest.java
@@ -61,7 +61,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("speed"));
+        assertThat(leafInfo.getName(), is("speed"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("enumeration"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
         assertThat(((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getName(),
@@ -100,7 +100,7 @@
         ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
         YangLeaf leafInfo = leafIterator.next();
 
-        assertThat(leafInfo.getLeafName(), is("speed"));
+        assertThat(leafInfo.getName(), is("speed"));
         assertThat(leafInfo.getDataType().getDataTypeName(), is("enumeration"));
         assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
         assertThat(((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getName(),
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/parseutils/ListenerErrorMessageConstructionTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/parseutils/ListenerErrorMessageConstructionTest.java
new file mode 100644
index 0000000..d10e009
--- /dev/null
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/parseutils/ListenerErrorMessageConstructionTest.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.parser.parseutils;
+
+import org.junit.Test;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import static org.onosproject.yangutils.utils.YangConstructType.CONTACT_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+
+/**
+ * Test case for testing listener error message construction util.
+ */
+public class ListenerErrorMessageConstructionTest {
+
+    /**
+     * Checks for error message construction with parsable data type name.
+     */
+    @Test
+    public void checkErrorMsgConstructionWithName() {
+
+        // Create an test error message
+        String testErrorMessage = constructListenerErrorMessage(INVALID_HOLDER, CONTACT_DATA, "Test Instance", ENTRY);
+
+        // Check message.
+        assertThat(testErrorMessage, is("Internal parser error detected: Invalid holder for contact "
+                + "\"Test Instance\" before processing."));
+    }
+
+    /**
+     * Checks for error message construction without parsable data type name.
+     */
+    @Test
+    public void checkErrorMsgConstructionWithoutName() {
+
+        // Create an test error message
+        String testErrorMessage = constructListenerErrorMessage(INVALID_HOLDER, CONTACT_DATA, "Test Instance", ENTRY);
+
+        // Check message.
+        assertThat(testErrorMessage,
+                   is("Internal parser error detected: Invalid holder for contact \"Test Instance\""
+                           + " before processing."));
+    }
+
+    /**
+     * Checks for extended error message construction with parsable data type
+     * name.
+     */
+    @Test
+    public void checkExtendedErrorMsgConstructionWithName() {
+
+        // Create an test error message
+        String testErrorMessage = constructExtendedListenerErrorMessage(INVALID_HOLDER, CONTACT_DATA,
+                                                                        "Test Instance", ENTRY,
+                                                                        "Extended Information");
+
+        // Check message.
+        assertThat(testErrorMessage,
+                   is("Internal parser error detected: Invalid holder for contact \"Test Instance\""
+                           + " before processing.\n" + "Error Information: Extended Information"));
+    }
+
+    /**
+     * Checks for extended error message construction without parsable data type
+     * name.
+     */
+    @Test
+    public void checkExtendedErrorMsgConstructionWithoutName() {
+
+        // Create an test error message
+        String testErrorMessage = constructExtendedListenerErrorMessage(INVALID_HOLDER, CONTACT_DATA, "", ENTRY,
+                                                                        "Extended Information");
+
+        // Check message.
+        assertThat(testErrorMessage, is("Internal parser error detected: Invalid holder for contact"
+                + " before processing.\n" + "Error Information: Extended Information"));
+    }
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/parseutils/ListenerValidationTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/parseutils/ListenerValidationTest.java
new file mode 100644
index 0000000..f4e284e
--- /dev/null
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/parseutils/ListenerValidationTest.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.parser.parseutils;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yangutils.datamodel.YangRevision;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.utils.YangConstructType.YANGBASE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/**
+ * Test case for testing listener validation util.
+ */
+public class ListenerValidationTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    /**
+     * Checks for exception in case parsable stack is empty while validating for
+     * not empty scenario.
+     */
+    @Test
+    public void validateStackIsNotEmptyForEmptyStack() {
+
+        String expectedError = constructListenerErrorMessage(MISSING_HOLDER, YANGBASE_DATA, "", EXIT);
+
+        // Get the exception occurred during parsing.
+        thrown.expect(ParserException.class);
+        thrown.expectMessage(expectedError);
+
+        // Create test walker and assign test error to it.
+        TreeWalkListener testWalker = new TreeWalkListener();
+
+        checkStackIsNotEmpty(testWalker, MISSING_HOLDER, YANGBASE_DATA, "", EXIT);
+    }
+
+    /**
+     * Checks if there is no exception in case parsable stack is not empty while
+     * validating for not empty scenario.
+     */
+    @Test
+    public void validateStackIsNotEmptyForNonEmptyStack() {
+
+        // Create test walker and assign test error to it.
+        TreeWalkListener testWalker = new TreeWalkListener();
+
+        // Create a temporary node of parsable.
+        YangRevision tmpNode = new YangRevision();
+        testWalker.getParsedDataStack().push(tmpNode);
+
+        checkStackIsNotEmpty(testWalker, MISSING_HOLDER, YANGBASE_DATA, "", EXIT);
+    }
+
+    /**
+     * Checks for exception in case parsable stack is not empty while validating
+     * for empty scenario.
+     */
+    @Test
+    public void validateStackIsEmptyForNonEmptyStack() {
+
+        String expectedError = constructListenerErrorMessage(MISSING_HOLDER, YANGBASE_DATA, "", EXIT);
+
+        // Get the exception occurred during parsing.
+        thrown.expect(ParserException.class);
+        thrown.expectMessage(expectedError);
+
+        // Create test walker and assign test error to it.
+        TreeWalkListener testWalker = new TreeWalkListener();
+
+        // Create a temporary node of parsable.
+        YangRevision tmpNode = new YangRevision();
+        testWalker.getParsedDataStack().push(tmpNode);
+
+        checkStackIsEmpty(testWalker, MISSING_HOLDER, YANGBASE_DATA, "", EXIT);
+    }
+
+    /**
+     * Checks if there is no exception in case parsable stack is empty while
+     * validating for empty scenario.
+     */
+    @Test
+    public void validateStackIsEmptyForEmptyStack() {
+
+        // Create test walker and assign test error to it.
+        TreeWalkListener testWalker = new TreeWalkListener();
+
+        checkStackIsEmpty(testWalker, MISSING_HOLDER, YANGBASE_DATA, "", EXIT);
+    }
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/parseutils/ParseTreeErrorListenerTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/parseutils/ParseTreeErrorListenerTest.java
new file mode 100644
index 0000000..dd09247
--- /dev/null
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/parser/parseutils/ParseTreeErrorListenerTest.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.parser.parseutils;
+
+import org.antlr.v4.runtime.ANTLRFileStream;
+import org.antlr.v4.runtime.ANTLRInputStream;
+import org.antlr.v4.runtime.CommonTokenStream;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangLexer;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.CustomExceptionMatcher;
+import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
+import org.onosproject.yangutils.parser.impl.parserutils.ParseTreeErrorListener;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * Test case for testing parse tree error listener.
+ */
+public class ParseTreeErrorListenerTest {
+
+    YangUtilsParserManager manager = new YangUtilsParserManager();
+    File file;
+    BufferedWriter out;
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    /**
+     * Checks that no exception is generated for YANG file with valid syntax.
+     */
+    @Test
+    public void checkValidYangFileForNoSyntaxError() throws IOException {
+
+        ANTLRInputStream input = new ANTLRFileStream("src/test/resources/YangFileWithoutSyntaxError.yang");
+
+        // Create a lexer that feeds off of input char stream.
+        GeneratedYangLexer lexer = new GeneratedYangLexer(input);
+        // Create a buffer of tokens pulled from the lexer.
+        CommonTokenStream tokens = new CommonTokenStream(lexer);
+        // Create a parser that feeds off the tokens buffer.
+        GeneratedYangParser parser = new GeneratedYangParser(tokens);
+        // Remove console error listener.
+        parser.removeErrorListeners();
+        // Create instance of customized error listener.
+        ParseTreeErrorListener parseTreeErrorListener = new ParseTreeErrorListener();
+        // Add customized error listener to catch errors during parsing.
+        parser.addErrorListener(parseTreeErrorListener);
+        // Begin parsing YANG file and generate parse tree.
+        ParseTree tree = parser.yangfile();
+    }
+
+    /**
+     * Checks that exception is generated for YANG file with invalid syntax.
+     */
+    @Test
+    public void checkInvalidYangFileForSyntaxError() throws IOException {
+
+        // Get the exception occurred during parsing.
+        thrown.expect(ParserException.class);
+        thrown.expect(CustomExceptionMatcher.errorLocation(3, 0));
+        thrown.expectMessage("no viable alternative at input 'yang-version 1\\nnamespace'");
+
+        ANTLRInputStream input = new ANTLRFileStream("src/test/resources/YangFileWithSyntaxError.yang");
+
+        // Create a lexer that feeds off of input char stream.
+        GeneratedYangLexer lexer = new GeneratedYangLexer(input);
+        // Create a buffer of tokens pulled from the lexer.
+        CommonTokenStream tokens = new CommonTokenStream(lexer);
+        // Create a parser that feeds off the tokens buffer.
+        GeneratedYangParser parser = new GeneratedYangParser(tokens);
+        // Remove console error listener.
+        parser.removeErrorListeners();
+        // Create instance of customized error listener.
+        ParseTreeErrorListener parseTreeErrorListener = new ParseTreeErrorListener();
+        // Add customized error listener to catch errors during parsing.
+        parser.addErrorListener(parseTreeErrorListener);
+        // Begin parsing YANG file and generate parse tree.
+        ParseTree tree = parser.yangfile();
+    }
+}
\ No newline at end of file
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/translator/tojava/utils/RpcTranslatorTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/translator/tojava/utils/RpcTranslatorTest.java
index b1c7f74..138142e 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/translator/tojava/utils/RpcTranslatorTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/translator/tojava/utils/RpcTranslatorTest.java
@@ -17,6 +17,7 @@
 package org.onosproject.yangutils.translator.tojava.utils;
 
 import java.io.IOException;
+
 import org.junit.Test;
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
@@ -36,7 +37,8 @@
      * Checks rpc translation should not result in any exception.
      */
     @Test
-    public void processRpcTranslator() throws IOException, ParserException {
+    public void processRpcTranslator()
+            throws IOException, ParserException {
 
         String userDir = System.getProperty("user.dir");
         YangNode node = manager.getDataModel("src/test/resources/RpcTranslator.yang");
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/translator/tojava/utils/UnionTranslatorTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/translator/tojava/utils/UnionTranslatorTest.java
index 239e86f..9baad15 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/translator/tojava/utils/UnionTranslatorTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/translator/tojava/utils/UnionTranslatorTest.java
@@ -17,6 +17,7 @@
 package org.onosproject.yangutils.translator.tojava.utils;
 
 import java.io.IOException;
+
 import org.junit.Test;
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
@@ -36,7 +37,8 @@
      * Checks union translation should not result in any exception.
      */
     @Test
-    public void processUnionTranslator() throws IOException, ParserException {
+    public void processUnionTranslator()
+            throws IOException, ParserException {
 
         clean("src/test/org/onosproject/yang");