diff --git a/src/main/java/org/onosproject/yangutils/datamodel/CollisionDetector.java b/src/main/java/org/onosproject/yangutils/datamodel/CollisionDetector.java
index 7d37929..69ff0c0 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/CollisionDetector.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/HasRpcNotification.java b/src/main/java/org/onosproject/yangutils/datamodel/RpcNotificationContainer.java
similarity index 93%
rename from src/main/java/org/onosproject/yangutils/datamodel/HasRpcNotification.java
rename to src/main/java/org/onosproject/yangutils/datamodel/RpcNotificationContainer.java
index 9d4d5f1..2d29f9e 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/HasRpcNotification.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/YangEntityToResolveInfo.java b/src/main/java/org/onosproject/yangutils/datamodel/YangEntityToResolveInfo.java
index aa95899..229625c 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangEntityToResolveInfo.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java b/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java
index 83091b1..c9808a2 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java b/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
index 809bb8c..0e0bc3e 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/YangList.java b/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
index f743f42..e82132f 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java b/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
index c902389..f737e32 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java b/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java
index ae29433..811c76e 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/HasResolutionInfo.java b/src/main/java/org/onosproject/yangutils/datamodel/YangReferenceResolver.java
similarity index 98%
rename from src/main/java/org/onosproject/yangutils/datamodel/HasResolutionInfo.java
rename to src/main/java/org/onosproject/yangutils/datamodel/YangReferenceResolver.java
index 4e786ff..e9ae54d 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/HasResolutionInfo.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java b/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java
index 9db0469..d762151 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/HasType.java b/src/main/java/org/onosproject/yangutils/datamodel/YangTypeContainer.java
similarity index 95%
rename from src/main/java/org/onosproject/yangutils/datamodel/HasType.java
rename to src/main/java/org/onosproject/yangutils/datamodel/YangTypeContainer.java
index e7a5c73..c22bfc0 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/HasType.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java b/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
index 49eafff..2eac613 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/YangUnion.java b/src/main/java/org/onosproject/yangutils/datamodel/YangUnion.java
index eb0e34d..038cf38 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangUnion.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java b/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java
index 16f45c4..55fbaf4 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java b/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java
index e848299..928e87b 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/utils/YangDataModelFactory.java b/src/main/java/org/onosproject/yangutils/datamodel/utils/YangDataModelFactory.java
index 686360e..aff53c4 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/utils/YangDataModelFactory.java
+++ b/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/src/main/java/org/onosproject/yangutils/linker/YangLinker.java b/src/main/java/org/onosproject/yangutils/linker/YangLinker.java
index 5d38c9b..f659fa9 100644
--- a/src/main/java/org/onosproject/yangutils/linker/YangLinker.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/TreeWalkListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/TreeWalkListener.java
index c1c84a1..5c03e54 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/TreeWalkListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java
index 0501806..07dba80 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java
index e822c14..97efebb 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListener.java
index 67dacbb..c81e554 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/InputListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/InputListener.java
index 78a5153..ecd8c4d 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/InputListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java
index 6b5afe3..4a2481a 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
index 2cb6187..fd1bd84 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListener.java
index 1bd7390..58daefb 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OutputListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OutputListener.java
index 83fec50..f1cde72 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OutputListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RpcListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RpcListener.java
index b440289..ae9e04c 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RpcListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
index d20f90a..cfaa15f 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
index e93001e..e5b098b 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java
index 1d2a698..2a78eec 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/GeneratedJavaFileType.java b/src/main/java/org/onosproject/yangutils/translator/tojava/GeneratedJavaFileType.java
index c112ce0..1b3c7e0 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/GeneratedJavaFileType.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/JavaAttributeInfo.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaAttributeInfo.java
index f50f84a..485878b 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaAttributeInfo.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java
index add5504..6d05ba6 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaFileInfo.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaFileInfoContainer.java
similarity index 96%
rename from src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaFileInfo.java
rename to src/main/java/org/onosproject/yangutils/translator/tojava/JavaFileInfoContainer.java
index efd4be8..485df77 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaFileInfo.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
index 723b937..13eaf5f 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaImportData.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportDataContainer.java
similarity index 96%
rename from src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaImportData.java
rename to src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportDataContainer.java
index 7251b7f..e86b468 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaImportData.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
index 9b0ccca..370e0f6 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaQualifiedTypeInfo.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfoContainer.java
similarity index 95%
rename from src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaQualifiedTypeInfo.java
rename to src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfoContainer.java
index 80b72cf..c6570c6 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/HasJavaQualifiedTypeInfo.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaBeanFragmentFiles.java b/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaBeanFragmentFiles.java
new file mode 100644
index 0000000..eaecdd7
--- /dev/null
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java b/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java
index 10d98c8..a1bb801 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/HasTempJavaCodeFragmentFiles.java b/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFilesContainer.java
similarity index 94%
rename from src/main/java/org/onosproject/yangutils/translator/tojava/HasTempJavaCodeFragmentFiles.java
rename to src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFilesContainer.java
index 9b67ccf..1bbf349 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/HasTempJavaCodeFragmentFiles.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEnumerationFragmentFiles.java b/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEnumerationFragmentFiles.java
new file mode 100644
index 0000000..4537b2f
--- /dev/null
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java b/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
new file mode 100644
index 0000000..24fd71d
--- /dev/null
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java b/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java
new file mode 100644
index 0000000..00f372f
--- /dev/null
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java b/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java
new file mode 100644
index 0000000..88336f9
--- /dev/null
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaCodeGeneratorInfo.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaCodeGeneratorInfo.java
index 5335ff4..8dc0db5 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaCodeGeneratorInfo.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaLeafInfoContainer.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaLeafInfoContainer.java
new file mode 100644
index 0000000..be005e4
--- /dev/null
+++ b/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/src/main/java/org/onosproject/yangutils/datamodel/HasType.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaQualifiedTypeResolver.java
similarity index 62%
copy from src/main/java/org/onosproject/yangutils/datamodel/HasType.java
copy to src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/JavaQualifiedTypeResolver.java
index e7a5c73..22970a9 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/HasType.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaAugment.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaAugment.java
index 9425e40..dbe006c 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaAugment.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaCase.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaCase.java
index 8729f17..6d1ac21 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaCase.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaChoice.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaChoice.java
index 0299e6c..cc12782 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaChoice.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaContainer.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaContainer.java
index 5099c85..0222e12 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaContainer.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java
index ccb82c6..a11fb2c 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java
index 058bfbf..f29934f 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaInput.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaInput.java
index 14e2cdf..0f07262 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaInput.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeaf.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeaf.java
index 1ff57f4..61e8e9c 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeaf.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeafList.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaLeafList.java
new file mode 100644
index 0000000..2d7e5bb
--- /dev/null
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaList.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaList.java
index c828faa..08351d2 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaList.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModule.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModule.java
index 7670b31..8f71c0a 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModule.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaNotification.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaNotification.java
index 0452dd4..5d4e2d5 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaNotification.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaOutput.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaOutput.java
index db29d57..0c5ddcf 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaOutput.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java
index 1f138ea..7a7c96a 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModule.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModule.java
index 8bf7592..89ff0c9 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModule.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaType.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaType.java
new file mode 100644
index 0000000..18bbc1a
--- /dev/null
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaTypeDef.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaTypeDef.java
index b7efb5f..bbec876 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaTypeDef.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUnion.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUnion.java
index 7af19c6..5c3a144 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUnion.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUses.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUses.java
index 2cbb551..725f0f5 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUses.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
index e28fa4e..6c91f4f 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
index ff548fc..1582616 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java
index cb1263f..c43346a 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java
index 27b9e80..5ab0923 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
index 99ab915..6723ce5 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
index a82d7d4..1e1982a 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
+++ b/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/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
index 4f3cb45..eb5d537 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
+++ b/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
         }
