diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.java
index ad2988d..afe3a02 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.java
@@ -78,6 +78,8 @@
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
 import static org.onosproject.yangutils.utils.YangConstructType.ENUM_DATA;
+import static org.onosproject.yangutils.utils.UtilConstants.QUOTES;
+import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
 
 /**
  * Represents listener based call back function corresponding to the "enum" rule
@@ -104,10 +106,18 @@
         checkStackIsNotEmpty(listener, MISSING_HOLDER, ENUM_DATA, ctx.string().getText(), ENTRY);
 
         YangEnum enumNode = new YangEnum();
-        enumNode.setNamedValue(ctx.string().getText());
+        enumNode.setNamedValue(getValidNamedValue(ctx.string().getText()));
         listener.getParsedDataStack().push(enumNode);
     }
 
+    /* Removes quotes from the enum name if present.*/
+    private static String getValidNamedValue(String name) {
+        if (name.contains(QUOTES)) {
+            name = name.replace(QUOTES, EMPTY_STRING);
+        }
+        return name;
+    }
+
     /**
      * It is called when parser exits from grammar rule (enum), it perform
      * validations and update the data model tree.
@@ -163,7 +173,8 @@
             }
         } else {
             throw new ParserException(
-                    constructListenerErrorMessage(MISSING_CURRENT_HOLDER, ENUM_DATA, ctx.string().getText(), EXIT));
+                    constructListenerErrorMessage(MISSING_CURRENT_HOLDER, ENUM_DATA, ctx.string().getText(),
+                            EXIT));
         }
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
index 9a4c6f4..bd214a6 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
@@ -158,6 +158,7 @@
                         logInfo = logInfo + NEW_LINE + e.getMessage();
                     }
                     getLog().info(logInfo);
+                    throw e;
                 }
             }
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
index 13eaf5f..958201b 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
@@ -147,7 +147,7 @@
             }
         }
 
-        if (isListToImport) {
+        if (getIfListImported()) {
             imports.add(getImportForList());
         }
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
index 370e0f6..6050f94 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
@@ -166,6 +166,7 @@
      * @return return the import info for this attribute
      */
     public static JavaQualifiedTypeInfo getQualifiedInfoOfFromString(JavaAttributeInfo referredTypesAttrInfo) {
+
         /*
          * Get the java qualified type information for the wrapper classes and
          * set it in new java attribute information.
@@ -178,7 +179,6 @@
         return qualifiedInfoOfFromString;
     }
 
-
     @Override
     public int hashCode() {
         return Objects.hash(pkgInfo, classInfo);
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaBeanFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaBeanFragmentFiles.java
index 8f0f145..1620bc9 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaBeanFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaBeanFragmentFiles.java
@@ -51,7 +51,6 @@
 
         super(javaFileInfo);
 
-
         /*
          * Initialize getterImpl, attributes, constructor, hash code, equals and
          * to strings when generation file type matches to impl class mask.
@@ -98,6 +97,7 @@
      * files
      * @throws IOException IO operation fail
      */
+    @Override
     void addJavaSnippetInfoToApplicableTempFiles(JavaAttributeInfo newAttrInfo)
             throws IOException {
         super.addJavaSnippetInfoToApplicableTempFiles(newAttrInfo);
@@ -124,5 +124,4 @@
         super.freeTemporaryResources(isErrorOccurred);
     }
 
-
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java
index f24391c..b1aa5d9 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java
@@ -67,7 +67,6 @@
      */
     private TempJavaEventListenerFragmentFiles eventListenerTempFiles;
 
-
     /**
      * Creates an instance of temporary java code fragment.
      *
@@ -126,7 +125,6 @@
         this.beanTempFiles = beanTempFiles;
     }
 
-
     /**
      * Retrieves the temp file handle for data type file generation.
      *
@@ -136,7 +134,6 @@
         return typeTempFiles;
     }
 
-
     /**
      * Sets temp file handle for data type file generation.
      *
@@ -234,23 +231,29 @@
             getBeanTempFiles().generateJavaFile(fileType, curNode);
         }
 
-        /**
+        /*
          * Creates user defined data type class file.
          */
         if ((fileType & GENERATE_TYPE_CLASS) != 0) {
             getTypeTempFiles().generateJavaFile(fileType, curNode);
         }
 
-
+        /*
+         * Creats service and manager class file.
+         */
         if (fileType == GENERATE_SERVICE_AND_MANAGER) {
-
             getServiceTempFiles().generateJavaFile(GENERATE_SERVICE_AND_MANAGER, curNode);
+        }
 
-
+        /*
+         * Creats enumeration class file.
+         */
+        if (fileType == GENERATE_ENUM_CLASS) {
+            getEnumerationTempFiles().generateJavaFile(GENERATE_ENUM_CLASS, curNode);
         }
 
         if ((fileType & GENERATE_EVENT_CLASS) != 0) {
-            /**
+            /*
              * Creates event class file.
              */
             if (getEventTempFiles() != null) {
@@ -350,7 +353,6 @@
         throw new TranslatorException("default constructor should not be added");
     }
 
-
     /**
      * Adds build method's implementation for class.
      *
@@ -397,22 +399,4 @@
         }
     }
 
-
-    /**
-     * 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 (getEnumerationTempFiles() != null) {
-            getEnumerationTempFiles().addEnumAttributeToTempFiles(curNode);
-            return;
-        }
-
-        throw new TranslatorException("build should not be added");
-    }
-
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEnumerationFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEnumerationFragmentFiles.java
index c18b002..1719886 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEnumerationFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEnumerationFragmentFiles.java
@@ -15,14 +15,68 @@
  */
 package org.onosproject.yangutils.translator.tojava;
 
+import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.onosproject.yangutils.datamodel.YangDataTypes;
+import org.onosproject.yangutils.datamodel.YangEnum;
+import org.onosproject.yangutils.datamodel.YangEnumeration;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.translator.exception.TranslatorException;
+import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaType;
+
+import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.ENUM_IMPL_MASK;
+import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.generateEnumAttributeString;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateEnumClassFile;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.closeFile;
+import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
+import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage;
 
 /**
  * Represents implementation of java code fragments temporary implementations.
  * Maintains the temp files required specific for enumeration java snippet generation.
  */
-public class TempJavaEnumerationFragmentFiles
-        extends TempJavaFragmentFiles {
+public class TempJavaEnumerationFragmentFiles extends TempJavaFragmentFiles {
+
+    /**
+     * File name for temporary enum class.
+     */
+    private static final String ENUM_CLASS_TEMP_FILE_NAME = "EnumClass";
+
+    /**
+     * File name for enum class file name suffix.
+     */
+    private static final String ENUM_CLASS_FILE_NAME_SUFFIX = EMPTY_STRING;
+
+    /**
+     * Current enum's value.
+     */
+    private int enumValue;
+
+    /**
+     * Contains data of enumSet.
+     */
+    private Map<String, Integer> enumStringMap = new HashMap<>();
+
+    /**
+     * Contains data of enumSet.
+     */
+    private List<String> enumStringList;
+
+    /**
+     * Temporary file handle for enum class file.
+     */
+    private File enumClassTempFileHandle;
+
+    /**
+     * Java file handle for enum class.
+     */
+    private File enumClassJavaFileHandle;
 
     /**
      * Creates an instance of temporary java code fragment.
@@ -32,6 +86,212 @@
      */
     public TempJavaEnumerationFragmentFiles(JavaFileInfo javaFileInfo)
             throws IOException {
+
         super(javaFileInfo);
+        setEnumSetJavaMap(new HashMap<>());
+        setEnumStringList(new ArrayList<>());
+        /*
+         * Initialize enum when generation file type matches to enum class mask.
+         */
+        addGeneratedTempFile(ENUM_IMPL_MASK);
+        setEnumClassTempFileHandle(getTemporaryFileHandle(ENUM_CLASS_TEMP_FILE_NAME));
+    }
+
+    /**
+     * Returns enum class java file handle.
+     *
+     * @return enum class java file handle
+     */
+    public 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;
+    }
+
+    /**
+     * Returns enum set java map.
+     *
+     * @return the enum set java map
+     */
+    public Map<String, Integer> getEnumSetJavaMap() {
+        return enumStringMap;
+    }
+
+    /**
+     * Sets enum set java map.
+     *
+     * @param map the enum set java map to set
+     */
+    private void setEnumSetJavaMap(Map<String, Integer> map) {
+        this.enumStringMap = map;
+    }
+
+    /**
+     * 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;
+    }
+
+    /**
+     * Adds enum class attributes to temporary file.
+     *
+     * @param curEnumInfo current YANG enum
+     * @throws IOException when fails to do IO operations.
+     */
+    private void addAttributesForEnumClass(String curEnumName) throws IOException {
+        appendToFile(getEnumClassTempFileHandle(), generateEnumAttributeString(curEnumName, getEnumValue()));
+    }
+
+    /**
+     * 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 {
+
+        super.addJavaSnippetInfoToApplicableTempFiles(getJavaAttributeForEnum());
+        if (curNode instanceof YangEnumeration) {
+            YangEnumeration enumeration = (YangEnumeration) curNode;
+            for (YangEnum curEnum : enumeration.getEnumSet()) {
+                setEnumValue(curEnum.getValue());
+                addToEnumStringList(curEnum.getNamedValue());
+                addToEnumSetJavaMap(curEnum.getNamedValue(), curEnum.getValue());
+                addJavaSnippetInfoToApplicableTempFiles(curEnum.getNamedValue());
+            }
+        } else {
+            throw new TranslatorException("current node should be of enumeration type.");
+        }
+    }
+
+    /**
+    * Returns java attribute for enum class.
+    *
+    * @return java attribute
+    */
+    public JavaAttributeInfo getJavaAttributeForEnum() {
+        YangJavaType<?> javaType = new YangJavaType<>();
+        javaType.setDataType(YangDataTypes.INT32);
+        javaType.setDataTypeName("int");
+        javaType.updateJavaQualifiedInfo();
+        return getAttributeInfoForTheData(
+                javaType.getJavaQualifiedInfo(),
+                javaType.getDataTypeName(), javaType,
+                getIsQualifiedAccessOrAddToImportList(javaType.getJavaQualifiedInfo()),
+                false);
+    }
+
+    /**
+     * Adds current enum name to java list.
+     *
+     * @param curEnumName current enum name
+     */
+    private void addToEnumSetJavaMap(String curEnumName, int value) {
+        getEnumSetJavaMap().put(curEnumName.toUpperCase(), value);
+    }
+
+    /**
+     * Adds the new attribute info to the target generated temporary files.
+     *
+     * @param curEnumName the attribute name that needs to be added to temporary
+     * files
+     * @throws IOException IO operation fail
+     */
+    void addJavaSnippetInfoToApplicableTempFiles(String curEnumName) throws IOException {
+        addAttributesForEnumClass(curEnumName);
+    }
+
+    /**
+     * Constructs java code exit.
+     *
+     * @param fileType generated file type
+     * @param curNode current YANG node
+     * @throws IOException when fails to generate java files
+     */
+    @Override
+    public void generateJavaFile(int fileType, YangNode curNode) throws IOException {
+        createPackage(curNode);
+        setEnumClassJavaFileHandle(getJavaFileHandle(getJavaClassName(ENUM_CLASS_FILE_NAME_SUFFIX)));
+        setEnumClassJavaFileHandle(generateEnumClassFile(getEnumClassJavaFileHandle(), curNode));
+        freeTemporaryResources(false);
+    }
+
+    /**
+     * 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
+     */
+    @Override
+    public void freeTemporaryResources(boolean isErrorOccurred) throws IOException {
+        closeFile(getEnumClassJavaFileHandle(), isErrorOccurred);
+        closeFile(getEnumClassTempFileHandle(), true);
+        super.freeTemporaryResources(isErrorOccurred);
+    }
+
+    /**
+     * Adds  to enum string list.
+     *
+     * @param curEnumValue current enum value
+     */
+    private void addToEnumStringList(String curEnumValue) {
+        getEnumStringList().add(curEnumValue.toUpperCase());
+    }
+
+    /**
+     * Returns enum string list.
+     *
+     * @return the enumStringList
+     */
+    public List<String> getEnumStringList() {
+        return enumStringList;
+    }
+
+    /**
+     * Sets enum string list.
+     *
+     * @param enumStringList the enumStringList to set
+     */
+    public void setEnumStringList(List<String> enumStringList) {
+        this.enumStringList = enumStringList;
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEventFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEventFragmentFiles.java
index 0eada3d..4f40ea9 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEventFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEventFragmentFiles.java
@@ -56,7 +56,7 @@
         setExtendsList(new ArrayList<>());
         setJavaImportData(new JavaImportData());
         setJavaFileInfo(javaFileInfo);
-        clearGeneratedTempFileMask();
+
         setAbsoluteDirPath(getAbsolutePackagePath(getJavaFileInfo().getBaseCodeGenPath(),
                 getJavaFileInfo().getPackageFilePath()));
 
@@ -80,7 +80,6 @@
         this.eventJavaFileHandle = eventJavaFileHandle;
     }
 
-
     /**
      * Constructs java code exit.
      *
@@ -88,6 +87,7 @@
      * @param curNode current YANG node
      * @throws IOException when fails to generate java files
      */
+    @Override
     public void generateJavaFile(int fileType, YangNode curNode)
             throws IOException {
 
@@ -113,6 +113,7 @@
      * and java files.
      * @throws IOException when failed to delete the temporary files
      */
+    @Override
     public void freeTemporaryResources(boolean isErrorOccurred)
             throws IOException {
         boolean isError = isErrorOccurred;
@@ -122,5 +123,6 @@
         closeFile(getEventJavaFileHandle(), isError);
 
         super.freeTemporaryResources(isErrorOccurred);
+
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEventListenerFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEventListenerFragmentFiles.java
index c6a297e..d1b0176 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEventListenerFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEventListenerFragmentFiles.java
@@ -56,7 +56,6 @@
         setExtendsList(new ArrayList<>());
         setJavaImportData(new JavaImportData());
         setJavaFileInfo(javaFileInfo);
-        clearGeneratedTempFileMask();
         setAbsoluteDirPath(getAbsolutePackagePath(getJavaFileInfo().getBaseCodeGenPath(),
                 getJavaFileInfo().getPackageFilePath()));
     }
@@ -79,7 +78,6 @@
         this.eventListenerJavaFileHandle = eventListenerJavaFileHandle;
     }
 
-
     /**
      * Constructs java code exit.
      *
@@ -87,6 +85,7 @@
      * @param curNode current YANG node
      * @throws IOException when fails to generate java files
      */
+    @Override
     public void generateJavaFile(int fileType, YangNode curNode)
             throws IOException {
 
@@ -112,6 +111,7 @@
      * and java files.
      * @throws IOException when failed to delete the temporary files
      */
+    @Override
     public void freeTemporaryResources(boolean isErrorOccurred)
             throws IOException {
         boolean isError = isErrorOccurred;
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
index 467ff8a..bcfdf80 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
@@ -19,12 +19,9 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Set;
 
 import org.onosproject.yangutils.datamodel.RpcNotificationContainer;
 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;
@@ -41,8 +38,8 @@
 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.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;
@@ -50,13 +47,12 @@
 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.JavaFileGeneratorUtils.getFileObject;
@@ -68,6 +64,7 @@
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuildString;
 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;
@@ -81,11 +78,11 @@
 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.closeFile;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.detectCollisionBwParentAndChildForImport;
 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.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.isHasAugmentationExtended;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.prepareJavaFileGeneratorForExtendsList;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.sortImports;
 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;
@@ -98,9 +95,9 @@
 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.getJavaDoc;
 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.getJavaDoc;
 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;
@@ -110,35 +107,43 @@
  * Manages the common temp file required for Java file(s) generated.
  */
 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 interface(s)/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.
      */
@@ -168,58 +173,62 @@
      * 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 temporary enum class.
+     * File name for from string method.
      */
-    private static final String ENUM_CLASS_TEMP_FILE_NAME = "EnumClass";
+    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 enum class file name suffix.
-     */
-    private static final String ENUM_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.
      */
@@ -254,18 +263,21 @@
      * 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.
+     * Temporary file handle for from string method of class.
      */
-    private File enumClassTempFileHandle;
+    private File fromStringImplTempFileHandle;
 
     /**
      * Import info for case.
@@ -275,56 +287,15 @@
     /**
      * Is attribute added.
      */
-    private boolean isAttributePresent = false;
-    /**
-     * Current enum's value.
-     */
-    private int enumValue;
-    /*
-     * Java file handle for enum class.
-     */
-    private File enumClassJavaFileHandle;
+    private boolean isAttributePresent;
 
+    /**
+     * Creates an instance of temp java fragment files.
+     */
     public TempJavaFragmentFiles() {
     }
 
     /**
-     * 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
@@ -378,12 +349,22 @@
     }
 
     /**
-     * Sets generated file files.
+     * Adds to generated temporary files.
      *
      * @param generatedTempFile generated file
      */
     void addGeneratedTempFile(int generatedTempFile) {
         generatedTempFiles |= generatedTempFile;
+        setGeneratedTempFiles(generatedTempFiles);
+    }
+
+    /**
+     * Sets generated file files.
+     *
+     * @param generatedTempFile generated file
+     */
+    void setGeneratedTempFiles(int fileType) {
+        generatedTempFiles = fileType;
     }
 
     /**
@@ -495,6 +476,25 @@
     }
 
     /**
+     * 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;
+    }
+
+    /**
      * Creates an instance of temporary java code fragment.
      *
      * @param javaFileInfo generated java file information
@@ -505,7 +505,6 @@
         setExtendsList(new ArrayList<>());
         setJavaImportData(new JavaImportData());
         setJavaFileInfo(javaFileInfo);
-        clearGeneratedTempFileMask();
         setAbsoluteDirPath(getAbsolutePackagePath(getJavaFileInfo().getBaseCodeGenPath(),
                 getJavaFileInfo().getPackageFilePath()));
 
@@ -557,9 +556,16 @@
             addGeneratedTempFile(HASH_CODE_IMPL_MASK);
             addGeneratedTempFile(EQUALS_IMPL_MASK);
             addGeneratedTempFile(TO_STRING_IMPL_MASK);
+            addGeneratedTempFile(FROM_STRING_IMPL_MASK);
         }
 
         /*
+         * Initialize temp files to generate enum class.
+         */
+        if ((getGeneratedJavaFiles() & GENERATE_ENUM_CLASS) != 0) {
+            addGeneratedTempFile(FROM_STRING_IMPL_MASK);
+        }
+        /*
          * Initialize getter and setter when generation file type matches to
          * builder interface mask.
          */
@@ -571,13 +577,6 @@
         }
 
         /*
-         * 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) {
@@ -609,9 +608,10 @@
         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() & FROM_STRING_IMPL_MASK) != 0) {
+            setFromStringImplTempFileHandle(getTemporaryFileHandle(FROM_STRING_METHOD_FILE_NAME));
         }
+
     }
 
     /**
@@ -704,7 +704,6 @@
         attributesTempFileHandle = attributeForClass;
     }
 
-
     /**
      * Returns getter method's impl's temporary file handle.
      *
@@ -723,7 +722,6 @@
         getterImplTempFileHandle = getterImpl;
     }
 
-
     /**
      * Returns hash code method's temporary file handle.
      *
@@ -779,24 +777,6 @@
     }
 
     /**
-     * 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 list of classes to be extended by generated files.
      *
      * @return list of classes to be extended by generated files
@@ -842,7 +822,8 @@
      */
     private void addGetterForInterface(JavaAttributeInfo attr)
             throws IOException {
-        appendToFile(getGetterInterfaceTempFileHandle(), getGetterString(attr, getGeneratedJavaFiles()) + NEW_LINE);
+        appendToFile(getGetterInterfaceTempFileHandle(),
+                getGetterString(attr, getGeneratedJavaFiles()) + NEW_LINE);
     }
 
     /**
@@ -866,7 +847,8 @@
     private void addSetterImpl(JavaAttributeInfo attr)
             throws IOException {
         appendToFile(getSetterImplTempFileHandle(),
-                getOverRideString() + getSetterForClass(attr, getGeneratedJavaClassName(), getGeneratedJavaFiles()) +
+                getOverRideString() + getSetterForClass(attr, getGeneratedJavaClassName(), getGeneratedJavaFiles())
+                        +
                         NEW_LINE);
     }
 
@@ -969,18 +951,19 @@
     }
 
     /**
-     * Adds enum class attributes to temporary file.
+     * Adds from string method for union class.
      *
-     * @param curEnumInfo current YANG enum
-     * @throws IOException when fails to do IO operations.
+     * @param javaAttributeInfo type attribute info
+     * @param fromStringAttributeInfo from string attribute info
+     * @throws IOException when fails to append to temporary file
      */
-    private void addAttributesForEnumClass(JavaAttributeInfo curEnumInfo)
+    private void addFromStringMethod(JavaAttributeInfo javaAttributeInfo,
+            JavaAttributeInfo fromStringAttributeInfo)
             throws IOException {
-        appendToFile(getEnumClassTempFileHandle(),
-                generateEnumAttributeString(curEnumInfo.getAttributeName(), getEnumValue()));
+        appendToFile(getFromStringImplTempFileHandle(), getFromStringMethod(javaAttributeInfo,
+                fromStringAttributeInfo) + NEW_LINE);
     }
 
-
     /**
      * Returns a temporary file handle for the specific file type.
      *
@@ -1009,9 +992,7 @@
      * @return temporary file handle
      * @throws IOException when fails to create new file handle
      */
-    File getJavaFileHandle(String fileName)
-            throws IOException {
-//        createPackage(getAbsoluteDirPath(), getJavaFileInfo().getJavaName());
+    File getJavaFileHandle(String fileName) throws IOException {
         return getFileObject(getDirPath(), fileName, JAVA_FILE_EXTENSION, getJavaFileInfo());
     }
 
@@ -1055,7 +1036,8 @@
          */
         String attributeName = getCamelCase(getSmallCase(attr.getAttributeName()), null);
         if (attr.isQualifiedName()) {
-            return getJavaAttributeDefination(attr.getImportInfo().getPkgInfo(), attr.getImportInfo().getClassInfo(),
+            return getJavaAttributeDefination(attr.getImportInfo().getPkgInfo(),
+                    attr.getImportInfo().getClassInfo(),
                     attributeName, attr.isListAttr());
         } else {
             return getJavaAttributeDefination(null, attr.getImportInfo().getClassInfo(), attributeName,
@@ -1127,11 +1109,24 @@
             throw new TranslatorException("Parent node does not have file info");
         }
         TempJavaFragmentFiles tempJavaFragmentFiles = getNodesInterfaceFragmentFiles(parentNode);
+        boolean isQualified = true;
         JavaImportData parentImportData = tempJavaFragmentFiles.getJavaImportData();
-        boolean isQualified = parentImportData.addImportInfo(qualifiedTypeInfo);
+        if (isListNode) {
+            parentImportData.setIfListImported(true);
+        }
+        if (!detectCollisionBwParentAndChildForImport(curNode, qualifiedTypeInfo)) {
+            parentImportData.addImportInfo(qualifiedTypeInfo);
+            isQualified = false;
+        }
         return getAttributeInfoForTheData(qualifiedTypeInfo, curNodeName, null, isQualified, isListNode);
     }
 
+    /**
+     * Returns interface fragment files for node.
+     *
+     * @param node YANG node
+     * @return interface fragment files for node
+     */
     public static TempJavaFragmentFiles getNodesInterfaceFragmentFiles(YangNode node) {
         TempJavaFragmentFiles tempJavaFragmentFiles;
         if (node instanceof RpcNotificationContainer) {
@@ -1211,6 +1206,7 @@
                 }
                 JavaLeafInfoContainer javaLeaf = (JavaLeafInfoContainer) leafList;
                 javaLeaf.updateJavaQualifiedInfo();
+                getJavaImportData().setIfListImported(true);
                 JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(
                         javaLeaf.getJavaQualifiedInfo(),
                         javaLeaf.getJavaName(yangPluginConfig.getConflictResolver()),
@@ -1242,33 +1238,6 @@
     }
 
     /**
-     * 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.
      *
      * @param newAttrInfo the attribute info that needs to be added to temporary
@@ -1306,8 +1275,19 @@
         if ((getGeneratedTempFiles() & TO_STRING_IMPL_MASK) != 0) {
             addToStringMethod(newAttrInfo);
         }
-        if ((getGeneratedTempFiles() & ENUM_IMPL_MASK) != 0) {
-            addAttributesForEnumClass(newAttrInfo);
+
+        if ((getGeneratedTempFiles() & FROM_STRING_IMPL_MASK) != 0) {
+            JavaQualifiedTypeInfo qualifiedInfoOfFromString = getQualifiedInfoOfFromString(newAttrInfo);
+            /*
+             * Create a new java attribute info with qualified information of
+             * wrapper classes.
+             */
+            JavaAttributeInfo fromStringAttributeInfo = getAttributeInfoForTheData(qualifiedInfoOfFromString,
+                    newAttrInfo.getAttributeName(),
+                    newAttrInfo.getAttributeType(),
+                    getIsQualifiedAccessOrAddToImportList(qualifiedInfoOfFromString), false);
+
+            addFromStringMethod(newAttrInfo, fromStringAttributeInfo);
         }
     }
 
@@ -1358,8 +1338,9 @@
              * Adds import for case.
              */
             if (curNode instanceof YangCase) {
-                List<String> importData = ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
-                        .getBeanTempFiles().getJavaImportData().getImports();
+                List<String> importData =
+                        ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                .getBeanTempFiles().getJavaImportData().getImports();
                 for (String importInfo : importData) {
                     if (!imports.contains(importInfo)) {
                         imports.add(importInfo);
@@ -1375,6 +1356,7 @@
             if (isAugmentedInfoExtended(getExtendsList())) {
                 addAugmentedInfoImport(curNode, imports, true);
             }
+            sortImports(imports);
             /*
              * Create interface file.
              */
@@ -1406,8 +1388,7 @@
                 removeCaseImport(imports);
             }
         }
-        if (((fileType & GENERATE_SERVICE_AND_MANAGER) != 0)
-                && ((fileType & BUILDER_CLASS_MASK) != 0 || (fileType & IMPL_CLASS_MASK) != 0)) {
+        if ((fileType & BUILDER_CLASS_MASK) != 0 || (fileType & IMPL_CLASS_MASK) != 0) {
             if (isAttributePresent()) {
                 addImportsToStringAndHasCodeMethods(curNode, imports);
             }
@@ -1415,12 +1396,14 @@
                 addAugmentedInfoImport(curNode, imports, true);
                 addArrayListImport(curNode, imports, true);
             }
+            sortImports(imports);
             /*
              * Create builder class file.
              */
             setBuilderClassJavaFileHandle(getJavaFileHandle(getJavaClassName(BUILDER_CLASS_FILE_NAME_SUFFIX)));
             setBuilderClassJavaFileHandle(
-                    generateBuilderClassFile(getBuilderClassJavaFileHandle(), imports, curNode, isAttributePresent()));
+                    generateBuilderClassFile(getBuilderClassJavaFileHandle(), imports, curNode,
+                            isAttributePresent()));
             /*
              * Create impl class file.
              */
@@ -1437,14 +1420,6 @@
         }
 
         /*
-         * Creates type enum class file.
-         */
-        if ((fileType & GENERATE_ENUM_CLASS) != 0) {
-            setEnumClassJavaFileHandle(getJavaFileHandle(getJavaClassName(ENUM_CLASS_FILE_NAME_SUFFIX)));
-            setEnumClassJavaFileHandle(generateEnumClassFile(getEnumClassJavaFileHandle(), curNode));
-        }
-
-        /*
          * Close all the file handles.
          */
         freeTemporaryResources(false);
@@ -1505,10 +1480,6 @@
             closeFile(getImplClassJavaFileHandle(), true);
         }
 
-        if ((getGeneratedJavaFiles() & GENERATE_ENUM_CLASS) != 0) {
-            closeFile(getEnumClassJavaFileHandle(), isError);
-        }
-
         /*
          * Close all temporary file handles and delete the files.
          */
@@ -1527,8 +1498,8 @@
         if ((getGeneratedTempFiles() & EQUALS_IMPL_MASK) != 0) {
             closeFile(getEqualsImplTempFileHandle(), true);
         }
-        if ((getGeneratedTempFiles() & ENUM_IMPL_MASK) != 0) {
-            closeFile(getEnumClassTempFileHandle(), true);
+        if ((getGeneratedTempFiles() & FROM_STRING_IMPL_MASK) != 0) {
+            closeFile(getFromStringImplTempFileHandle(), true);
         }
     }
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java
index 9c0c571..288f640 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java
@@ -33,9 +33,11 @@
 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.closeFile;
-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.EMPTY_STRING;
 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
+import static org.onosproject.yangutils.utils.UtilConstants.RPC_INPUT_VAR_NAME;
+import static org.onosproject.yangutils.utils.UtilConstants.VOID;
 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.generateJavaDocForRpc;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.insertDataIntoJavaFile;
@@ -180,12 +182,13 @@
     }
 
     /**
-     * Constructs java code exit.
+     * Generate java code.
      *
      * @param fileType generated file type
      * @param curNode current YANG node
      * @throws IOException when fails to generate java files
      */
+    @Override
     public void generateJavaFile(int fileType, YangNode curNode)
             throws IOException {
         List<String> imports = new ArrayList<>();
@@ -199,9 +202,6 @@
         setServiceInterfaceJavaFileHandle(getJavaFileHandle(getJavaClassName(SERVICE_FILE_NAME_SUFFIX)));
         generateServiceInterfaceFile(getServiceInterfaceJavaFileHandle(), curNode, imports, isAttributePresent());
 
-        if (isAttributePresent()) {
-            addImportsToStringAndHasCodeMethods(curNode, imports);
-        }
         if (isHasAugmentationExtended(getExtendsList())) {
             addAugmentedInfoImport(curNode, imports, true);
             addArrayListImport(curNode, imports, true);
@@ -229,21 +229,20 @@
      * @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";
+    private void addRpcString(JavaAttributeInfo javaAttributeInfoOfInput,
+            JavaAttributeInfo javaAttributeInfoOfOutput,
+            String rpcName) throws IOException {
+        String rpcInput = EMPTY_STRING;
+        String rpcOutput = VOID;
         if (javaAttributeInfoOfInput != null) {
             rpcInput = javaAttributeInfoOfInput.getAttributeName();
         }
         if (javaAttributeInfoOfOutput != null) {
             rpcOutput = javaAttributeInfoOfOutput.getAttributeName();
         }
-        appendToFile(getRpcInterfaceTempFileHandle(), generateJavaDocForRpc(rpcName, rpcInput, rpcOutput) +
-                getRpcServiceMethod(rpcName, rpcInput, rpcOutput) + NEW_LINE);
-        appendToFile(getRpcImplTempFileHandle(),
-                getRpcManagerMethod(rpcName, rpcInput, rpcOutput) + NEW_LINE);
+        appendToFile(getRpcInterfaceTempFileHandle(), generateJavaDocForRpc(rpcName, RPC_INPUT_VAR_NAME, rpcOutput)
+                + getRpcServiceMethod(rpcName, rpcInput, rpcOutput) + NEW_LINE);
+        appendToFile(getRpcImplTempFileHandle(), getRpcManagerMethod(rpcName, rpcInput, rpcOutput) + NEW_LINE);
     }
 
     /**
@@ -269,12 +268,17 @@
      * and java files.
      * @throws IOException when failed to delete the temporary files
      */
+    @Override
     public void freeTemporaryResources(boolean isErrorOccurred)
             throws IOException {
         boolean isError = isErrorOccurred;
 
         closeFile(getServiceInterfaceJavaFileHandle(), isError);
         closeFile(getRpcInterfaceTempFileHandle(), true);
+        closeFile(getRpcImplTempFileHandle(), true);
+        closeFile(getGetterInterfaceTempFileHandle(), true);
+        closeFile(getSetterInterfaceTempFileHandle(), true);
+        closeFile(getSetterImplTempFileHandle(), true);
 
         super.freeTemporaryResources(isErrorOccurred);
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java
index 8af0ecd..d9a44d6 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java
@@ -21,6 +21,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.onosproject.yangutils.datamodel.YangDataTypes;
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.datamodel.YangType;
 import org.onosproject.yangutils.datamodel.YangTypeHolder;
@@ -33,10 +34,9 @@
 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.FROM_STRING_IMPL_MASK;
 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.OF_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.utils.JavaFileGenerator.generateTypeDefClassFile;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateUnionClassFile;
-import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getFromStringMethod;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getOfMethodStringAndJavaDoc;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getTypeConstructorStringAndJavaDoc;
 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.closeFile;
@@ -60,10 +60,6 @@
      * 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 typedef class file name suffix.
@@ -86,11 +82,6 @@
     private File constructorForTypeTempFileHandle;
 
     /**
-     * Temporary file handle for from string method of class.
-     */
-    private File fromStringImplTempFileHandle;
-
-    /**
      * Java file handle for typedef class file.
      */
     private File typedefClassJavaFileHandle;
@@ -118,10 +109,8 @@
         addGeneratedTempFile(CONSTRUCTOR_FOR_TYPE_MASK);
         addGeneratedTempFile(FROM_STRING_IMPL_MASK);
 
-
         setOfStringImplTempFileHandle(getTemporaryFileHandle(OF_STRING_METHOD_FILE_NAME));
         setConstructorForTypeTempFileHandle(getTemporaryFileHandle(CONSTRUCTOR_FOR_TYPE_FILE_NAME));
-        setFromStringImplTempFileHandle(getTemporaryFileHandle(FROM_STRING_METHOD_FILE_NAME));
 
     }
 
@@ -146,25 +135,6 @@
     }
 
     /**
-     * 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 file handle for typedef class file.
      *
      * @return java file handle for typedef class file
@@ -239,9 +209,14 @@
                 }
                 YangJavaType<?> javaType = (YangJavaType<?>) yangType;
                 javaType.updateJavaQualifiedInfo();
+                String typeName = javaType.getDataTypeName();
+
+                if (javaType.getDataType().equals(YangDataTypes.DERIVED)) {
+                    typeName = getCamelCase(typeName, null);
+                }
                 JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(
                         javaType.getJavaQualifiedInfo(),
-                        javaType.getDataTypeName(), javaType,
+                        typeName, javaType,
                         getIsQualifiedAccessOrAddToImportList(javaType.getJavaQualifiedInfo()),
                         false);
                 addJavaSnippetInfoToApplicableTempFiles((YangNode) yangTypeHolder, javaAttributeInfo);
@@ -269,34 +244,6 @@
         if ((getGeneratedTempFiles() & CONSTRUCTOR_FOR_TYPE_MASK) != 0) {
             addTypeConstructor(javaAttributeInfo);
         }
-
-        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);
-        }
-    }
-
-
-    /**
-     * Adds 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);
     }
 
     /**
@@ -324,7 +271,6 @@
                 + NEW_LINE);
     }
 
-
     /**
      * Removes all temporary file handles.
      *
@@ -333,6 +279,7 @@
      * and java files.
      * @throws IOException when failed to delete the temporary files
      */
+    @Override
     public void freeTemporaryResources(boolean isErrorOccurred)
             throws IOException {
         boolean isError = isErrorOccurred;
@@ -356,6 +303,7 @@
         }
 
         super.freeTemporaryResources(isErrorOccurred);
+
     }
 
     /**
@@ -365,6 +313,7 @@
      * @param curNode current YANG node
      * @throws IOException when fails to generate java files
      */
+    @Override
     public void generateJavaFile(int fileType, YangNode curNode)
             throws IOException {
         List<String> imports = new ArrayList<>();
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java
index a11fb2c..0eeb78e 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java
@@ -76,7 +76,6 @@
      */
     @Override
     public void setJavaFileInfo(JavaFileInfo javaInfo) {
-
         javaFileInfo = javaInfo;
     }
 
@@ -87,7 +86,6 @@
      */
     @Override
     public TempJavaCodeFragmentFiles getTempJavaCodeFragmentFiles() {
-
         return tempFileHandle;
     }
 
@@ -98,7 +96,6 @@
      */
     @Override
     public void setTempJavaCodeFragmentFiles(TempJavaCodeFragmentFiles fileHandle) {
-
         tempFileHandle = fileHandle;
     }
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModule.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModule.java
index cdda4d3..ff48fb4 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModule.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaModule.java
@@ -27,6 +27,7 @@
 
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDeleteTempDir;
 
 /**
  * Represents module information extended to support java code generation.
@@ -118,5 +119,7 @@
     public void generateCodeExit()
             throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_SERVICE_AND_MANAGER, this);
+        searchAndDeleteTempDir(getJavaFileInfo().getBaseCodeGenPath() +
+                getJavaFileInfo().getPackageFilePath());
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModule.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModule.java
index 0bcab6f..570169c 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModule.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaSubModule.java
@@ -28,6 +28,7 @@
 
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDeleteTempDir;
 
 /**
  * Represents sub module information extended to support java code generation.
@@ -133,5 +134,7 @@
     public void generateCodeExit()
             throws IOException {
         getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_SERVICE_AND_MANAGER, this);
+        searchAndDeleteTempDir(getJavaFileInfo().getBaseCodeGenPath() +
+                getJavaFileInfo().getPackageFilePath());
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaType.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaType.java
index 18bbc1a..39b6220 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaType.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaType.java
@@ -68,6 +68,7 @@
             }
             importInfo.setClassInfo(dataTypeName);
         }
+        setJavaQualifiedInfo(importInfo);
     }
 
     @Override
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
index 6c91f4f..606fc3d 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
@@ -38,6 +38,7 @@
 import static org.onosproject.yangutils.utils.UtilConstants.BYTE;
 import static org.onosproject.yangutils.utils.UtilConstants.BYTE_WRAPPER;
 import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
+import static org.onosproject.yangutils.utils.UtilConstants.FROM_STRING_METHOD_NAME;
 import static org.onosproject.yangutils.utils.UtilConstants.INT;
 import static org.onosproject.yangutils.utils.UtilConstants.INTEGER_WRAPPER;
 import static org.onosproject.yangutils.utils.UtilConstants.JAVA_LANG;
@@ -45,7 +46,6 @@
 import static org.onosproject.yangutils.utils.UtilConstants.LONG;
 import static org.onosproject.yangutils.utils.UtilConstants.LONG_WRAPPER;
 import static org.onosproject.yangutils.utils.UtilConstants.NEW;
-import static org.onosproject.yangutils.utils.UtilConstants.OF;
 import static org.onosproject.yangutils.utils.UtilConstants.PARSE_BYTE;
 import static org.onosproject.yangutils.utils.UtilConstants.PARSE_INT;
 import static org.onosproject.yangutils.utils.UtilConstants.PARSE_LONG;
@@ -146,7 +146,7 @@
             case BINARY:
                 //TODO:BINARY
             case DERIVED:
-                return targetDataType + PERIOD + OF;
+                return targetDataType + PERIOD + FROM_STRING_METHOD_NAME;
             default:
                 throw new TranslatorException("given data type is not supported.");
         }
@@ -316,8 +316,7 @@
         } else {
             switch (type) {
                 case UINT64:
-                    //TODO: BIGINTEGER.
-                    break;
+                    return JAVA_MATH;
                 case DECIMAL64:
                     //TODO: DECIMAL64
                     break;
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java
index 5cfb777..9f12346 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java
@@ -74,7 +74,7 @@
         if ((genFileTypes & INTERFACE_MASK) != 0) {
             return getInterfaceDefinition(yangName);
         } else if ((genFileTypes & BUILDER_CLASS_MASK) != 0) {
-            return getBuilderClassDefinition(yangName, genFileTypes);
+            return getBuilderClassDefinition(yangName);
         } else if ((genFileTypes & IMPL_CLASS_MASK) != 0) {
             return getImplClassDefinition(yangName);
         } else if ((genFileTypes & BUILDER_INTERFACE_MASK) != 0) {
@@ -142,14 +142,9 @@
      * @param genFileTypes
      * @return definition
      */
-    private static String getBuilderClassDefinition(String yangName, int genFileTypes) {
-        if ((genFileTypes & GENERATE_SERVICE_AND_MANAGER) != 0) {
-            return PUBLIC + SPACE + CLASS + SPACE + yangName + MANAGER + SPACE + IMPLEMENTS + SPACE + yangName +
-                    SERVICE + PERIOD + yangName + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
-        } else {
-            return PUBLIC + SPACE + CLASS + SPACE + yangName + BUILDER + SPACE + IMPLEMENTS + SPACE + yangName + PERIOD
-                    + yangName + BUILDER + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
-        }
+    private static String getBuilderClassDefinition(String yangName) {
+        return PUBLIC + SPACE + CLASS + SPACE + yangName + BUILDER + SPACE + IMPLEMENTS + SPACE + yangName + PERIOD
+                + yangName + BUILDER + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
     }
 
     /**
@@ -180,7 +175,11 @@
      * @return definition
      */
     private static String getRpcInterfaceDefinition(String yangName) {
-        return INTERFACE + SPACE + yangName + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
+        if (yangName.contains(SERVICE)) {
+            return PUBLIC + SPACE + INTERFACE + SPACE + yangName + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
+        }
+        return PUBLIC + SPACE + CLASS + SPACE + yangName + MANAGER + SPACE + IMPLEMENTS + SPACE + yangName + SERVICE
+                + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
     }
 
     /**
@@ -195,7 +194,7 @@
         if (classDef.length() < 5) {
             throw new RuntimeException("Event class name is error");
         }
-        classDef = classDef.substring(0, (classDef.length() - 5));
+        classDef = classDef.substring(0, classDef.length() - 5);
         classDef = classDef + ">" + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
 
         return classDef;
@@ -213,7 +212,7 @@
         if (intfDef.length() < 8) {
             throw new RuntimeException("Event listener interface name is error");
         }
-        intfDef = intfDef.substring(0, (intfDef.length() - 8));
+        intfDef = intfDef.substring(0, intfDef.length() - 8);
         intfDef = intfDef + "Event>" + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
 
         return intfDef;
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaCodeSnippetGen.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaCodeSnippetGen.java
index 1942b01..189a329 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaCodeSnippetGen.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaCodeSnippetGen.java
@@ -19,7 +19,6 @@
 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
 
 import static org.onosproject.yangutils.translator.tojava.utils.ClassDefinitionGenerator.generateClassDefinition;
-import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getEnumJavaAttribute;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase;
 import static org.onosproject.yangutils.utils.UtilConstants.ARRAY_LIST;
@@ -87,11 +86,6 @@
      * @return corresponding textual java code information
      */
     public static String getJavaClassDefStart(int genFileTypes, String yangName) {
-
-        /*
-         * get the camel case name for java class / interface.
-         */
-        yangName = getCamelCase(yangName, null);
         return generateClassDefinition(genFileTypes, yangName);
     }
 
@@ -168,8 +162,9 @@
      * @return string for enum's attribute
      */
     public static String generateEnumAttributeString(String name, int value) {
-        return getJavaDoc(ENUM_ATTRIBUTE, name, false) + FOUR_SPACE_INDENTATION + getEnumJavaAttribute(name)
-                + OPEN_PARENTHESIS + value + CLOSE_PARENTHESIS + COMMA + NEW_LINE;
+        return getJavaDoc(ENUM_ATTRIBUTE, name, false) + FOUR_SPACE_INDENTATION
+                + getEnumJavaAttribute(name).toUpperCase() + OPEN_PARENTHESIS
+                + value + CLOSE_PARENTHESIS + COMMA + NEW_LINE;
     }
 
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
index 26487d8..3edf5c0 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
@@ -25,6 +25,7 @@
 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.TempJavaEnumerationFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.javamodel.JavaCodeGeneratorInfo;
 
 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK;
@@ -62,6 +63,7 @@
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getAugmentInfoListImpl;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getConstructorStart;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getEnumsConstrcutor;
+import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getEnumsOfMethod;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getEqualsMethodClose;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getEqualsMethodOpen;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getFromStringMethodClose;
@@ -84,7 +86,6 @@
 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.INT;
-import static org.onosproject.yangutils.utils.UtilConstants.MANAGER;
 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
 import static org.onosproject.yangutils.utils.UtilConstants.PRIVATE;
 import static org.onosproject.yangutils.utils.UtilConstants.PUBLIC;
@@ -164,7 +165,8 @@
      * @return interface file
      * @throws IOException when fails to write in file
      */
-    public static File generateInterfaceFile(File file, List<String> imports, YangNode curNode, boolean isAttrPresent)
+    public static File generateInterfaceFile(File file, List<String> imports, YangNode curNode,
+            boolean isAttrPresent)
             throws IOException {
 
         JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
@@ -311,7 +313,8 @@
         /**
          * Add default constructor and build method impl.
          */
-        methods.add(((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles().addBuildMethodImpl());
+        methods.add(((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                .addBuildMethodImpl());
         methods.add(((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
                 .addDefaultConstructor(PUBLIC, BUILDER));
 
@@ -340,42 +343,45 @@
 
         JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
 
-        String className = getCaptialCase(javaFileInfo.getJavaName()) + MANAGER;
+        String className = getCaptialCase(javaFileInfo.getJavaName());
         String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath();
 
         initiateJavaFileGeneration(file, className, GENERATE_SERVICE_AND_MANAGER, imports, path);
 
         List<String> methods = new ArrayList<>();
 
-        if (isAttrPresent) {
-
-            try {
+        try {
+            if (isAttrPresent) {
                 /**
                  * Getter methods.
                  */
-                methods.add(getDataFromTempFileHandle(GETTER_FOR_CLASS_MASK,
-                        ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
-                                .getServiceTempFiles()));
+                methods.add(
+                        getDataFromTempFileHandle(GETTER_FOR_CLASS_MASK,
+                                ((TempJavaCodeFragmentFilesContainer) curNode)
+                                        .getTempJavaCodeFragmentFiles().getServiceTempFiles()));
                 /**
                  * Setter methods.
                  */
-                methods.add(getDataFromTempFileHandle(SETTER_FOR_CLASS_MASK,
-                        ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
-                                .getServiceTempFiles()) +
-                        NEW_LINE);
+                methods.add(
+                        getDataFromTempFileHandle(SETTER_FOR_CLASS_MASK,
+                                ((TempJavaCodeFragmentFilesContainer) curNode)
+                                        .getTempJavaCodeFragmentFiles().getServiceTempFiles())
+                                + NEW_LINE);
 
+            }
+            if (((JavaCodeGeneratorInfo) curNode).getTempJavaCodeFragmentFiles().getServiceTempFiles() != null) {
                 JavaCodeGeneratorInfo javaGeninfo = (JavaCodeGeneratorInfo) curNode;
                 /**
                  * Rpc methods
                  */
-                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
-                        + " while manager class file generation");
+                methods.add(getDataFromTempFileHandle(RPC_IMPL_MASK,
+                        javaGeninfo.getTempJavaCodeFragmentFiles().getServiceTempFiles()));
             }
-        } else {
             insertDataIntoJavaFile(file, NEW_LINE);
+
+        } catch (IOException e) {
+            throw new IOException("No data found in temporary java code fragment files for " + className
+                    + " while manager class file generation");
         }
 
         /**
@@ -746,16 +752,34 @@
         /**
          * Add a constructor for enum.
          */
-        insertDataIntoJavaFile(file,
-                getJavaDoc(TYPE_CONSTRUCTOR, getSmallCase(className), false) + getEnumsConstrcutor(className)
-                        + NEW_LINE);
+        insertDataIntoJavaFile(file, getJavaDoc(TYPE_CONSTRUCTOR, getSmallCase(className), false)
+                + getEnumsConstrcutor(className) + NEW_LINE);
+
+        TempJavaEnumerationFragmentFiles enumFragFiles =
+                ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                        .getEnumerationTempFiles();
+        insertDataIntoJavaFile(file, getEnumsOfMethod(className,
+                enumFragFiles.getJavaAttributeForEnum(),
+                enumFragFiles.getEnumSetJavaMap(),
+                enumFragFiles.getEnumStringList())
+                + NEW_LINE);
 
         /**
          * Add a getter method for enum.
          */
-        insertDataIntoJavaFile(file,
-                getJavaDoc(GETTER_METHOD, getSmallCase(className), false)
-                        + getGetter(INT, getSmallCase(className), GENERATE_SERVICE_AND_MANAGER) + NEW_LINE);
+        insertDataIntoJavaFile(file, getJavaDoc(GETTER_METHOD, getSmallCase(className), false)
+                + getGetter(INT, getSmallCase(className), GENERATE_ENUM_CLASS) + NEW_LINE);
+
+        try {
+            insertDataIntoJavaFile(file, getFromStringMethodSignature(className)
+                    + getDataFromTempFileHandle(FROM_STRING_IMPL_MASK,
+                            ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
+                                    .getEnumerationTempFiles())
+                    + getFromStringMethodClose());
+        } catch (IOException e) {
+            throw new IOException("No data found in temporary java code fragment files for " + className
+                    + " while enum class file generation");
+        }
 
         insertDataIntoJavaFile(file, CLOSE_CURLY_BRACKET + NEW_LINE);
 
@@ -785,33 +809,30 @@
 
         List<String> methods = new ArrayList<>();
 
-
         try {
             if (isAttributePresent) {
 
                 /**
                  * Getter methods.
                  */
-                methods.add(FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(GETTER_FOR_INTERFACE_MASK,
+                methods.add(getDataFromTempFileHandle(GETTER_FOR_INTERFACE_MASK,
                         ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
                                 .getServiceTempFiles()));
                 /**
                  * Setter methods.
                  */
-                methods.add(NEW_LINE);
-                methods.add(FOUR_SPACE_INDENTATION + getDataFromTempFileHandle(SETTER_FOR_INTERFACE_MASK,
+                methods.add(getDataFromTempFileHandle(SETTER_FOR_INTERFACE_MASK,
                         ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
                                 .getServiceTempFiles()));
             }
-
-
-            JavaCodeGeneratorInfo javaGeninfo = (JavaCodeGeneratorInfo) curNode;
-            /**
-             * Rpc methods
-             */
-            methods.add(getDataFromTempFileHandle(RPC_INTERFACE_MASK, javaGeninfo.getTempJavaCodeFragmentFiles()
-                    .getServiceTempFiles()));
-
+            if (((JavaCodeGeneratorInfo) curNode).getTempJavaCodeFragmentFiles().getServiceTempFiles() != null) {
+                JavaCodeGeneratorInfo javaGeninfo = (JavaCodeGeneratorInfo) curNode;
+                /**
+                 * Rpc methods
+                 */
+                methods.add(getDataFromTempFileHandle(RPC_INTERFACE_MASK,
+                        javaGeninfo.getTempJavaCodeFragmentFiles().getServiceTempFiles()));
+            }
         } catch (IOException e) {
             throw new IOException("No data found in temporary java code fragment files for " + className
                     + " while rpc class file generation");
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java
index 1304706..4f363d8 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java
@@ -23,6 +23,7 @@
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
 import org.onosproject.yangutils.translator.tojava.TempJavaBeanFragmentFiles;
+import org.onosproject.yangutils.translator.tojava.TempJavaEnumerationFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.TempJavaTypeFragmentFiles;
@@ -39,6 +40,7 @@
 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;
@@ -58,13 +60,16 @@
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase;
 import static org.onosproject.yangutils.utils.UtilConstants.FOUR_SPACE_INDENTATION;
 import static org.onosproject.yangutils.utils.UtilConstants.INT;
+import static org.onosproject.yangutils.utils.UtilConstants.MANAGER;
 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
 import static org.onosproject.yangutils.utils.UtilConstants.ORG;
 import static org.onosproject.yangutils.utils.UtilConstants.PACKAGE;
 import static org.onosproject.yangutils.utils.UtilConstants.PRIVATE;
 import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN;
+import static org.onosproject.yangutils.utils.UtilConstants.SERVICE;
 import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
 import static org.onosproject.yangutils.utils.UtilConstants.SPACE;
+import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.BUILDER_CLASS;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.BUILDER_INTERFACE;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.ENUM_CLASS;
@@ -73,7 +78,7 @@
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.IMPL_CLASS;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.INTERFACE;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.RPC_INTERFACE;
-import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
+import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.RPC_MANAGER;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.insertDataIntoJavaFile;
 
 /**
@@ -105,7 +110,6 @@
      * Returns data stored in temporary files.
      *
      * @param generatedTempFiles temporary file types
-     * @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
@@ -130,9 +134,10 @@
         if (tempJavaFragmentFiles instanceof TempJavaServiceFragmentFiles) {
             serviceFragmentFiles = (TempJavaServiceFragmentFiles) tempJavaFragmentFiles;
         }
-
-
-        if ((generatedTempFiles & GETTER_FOR_INTERFACE_MASK) != 0) {
+        if ((generatedTempFiles & ATTRIBUTES_MASK) != 0) {
+            return tempJavaFragmentFiles
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getAttributesTempFileHandle());
+        } else if ((generatedTempFiles & GETTER_FOR_INTERFACE_MASK) != 0) {
             return tempJavaFragmentFiles
                     .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getGetterInterfaceTempFileHandle());
         } else if ((generatedTempFiles & SETTER_FOR_INTERFACE_MASK) != 0) {
@@ -172,14 +177,16 @@
             return typeFragmentFiles
                     .getTemporaryDataFromFileHandle(typeFragmentFiles.getConstructorForTypeTempFileHandle());
         } else if ((generatedTempFiles & FROM_STRING_IMPL_MASK) != 0) {
-            if (typeFragmentFiles == null) {
-                throw new TranslatorException("Required from string info is missing.");
-            }
-            return typeFragmentFiles
-                    .getTemporaryDataFromFileHandle(typeFragmentFiles.getFromStringImplTempFileHandle());
-        } else if ((generatedTempFiles & ENUM_IMPL_MASK) != 0) {
             return tempJavaFragmentFiles
-                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getEnumClassTempFileHandle());
+                    .getTemporaryDataFromFileHandle(tempJavaFragmentFiles.getFromStringImplTempFileHandle());
+        } else if ((generatedTempFiles & ENUM_IMPL_MASK) != 0) {
+            if (!(tempJavaFragmentFiles instanceof TempJavaEnumerationFragmentFiles)) {
+                throw new TranslatorException("Required enum info is missing.");
+            }
+            TempJavaEnumerationFragmentFiles enumFragmentFiles =
+                    (TempJavaEnumerationFragmentFiles) tempJavaFragmentFiles;
+            return enumFragmentFiles
+                    .getTemporaryDataFromFileHandle(enumFragmentFiles.getEnumClassTempFileHandle());
         } else if ((generatedTempFiles & RPC_INTERFACE_MASK) != 0) {
             if (serviceFragmentFiles == null) {
                 throw new TranslatorException("Required rpc interface info is missing.");
@@ -328,7 +335,15 @@
      */
     private static void write(File file, String fileName, int genType, JavaDocType javaDocType)
             throws IOException {
-        insertDataIntoJavaFile(file, getJavaDoc(javaDocType, fileName, false));
+        if ((genType & GENERATE_SERVICE_AND_MANAGER) != 0) {
+            if (!fileName.contains(SERVICE)) {
+                insertDataIntoJavaFile(file, getJavaDoc(RPC_MANAGER, fileName + MANAGER, false));
+            } else {
+                insertDataIntoJavaFile(file, getJavaDoc(javaDocType, fileName, false));
+            }
+        } else {
+            insertDataIntoJavaFile(file, getJavaDoc(javaDocType, fileName, false));
+        }
         insertDataIntoJavaFile(file, getJavaClassDefStart(genType, fileName));
     }
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
index c4da89a..b98b71c 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
@@ -16,6 +16,9 @@
 
 package org.onosproject.yangutils.translator.tojava.utils;
 
+import java.util.List;
+import java.util.Map;
+
 import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo;
 import org.onosproject.yangutils.utils.io.impl.JavaDocGen;
 
@@ -31,12 +34,15 @@
 import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_DATA_TYPE;
 import static org.onosproject.yangutils.utils.UtilConstants.BUILD;
 import static org.onosproject.yangutils.utils.UtilConstants.BUILDER;
+import static org.onosproject.yangutils.utils.UtilConstants.CASE;
 import static org.onosproject.yangutils.utils.UtilConstants.CATCH;
 import static org.onosproject.yangutils.utils.UtilConstants.CHECK_NOT_NULL_STRING;
 import static org.onosproject.yangutils.utils.UtilConstants.CLEAR;
 import static org.onosproject.yangutils.utils.UtilConstants.CLOSE_CURLY_BRACKET;
 import static org.onosproject.yangutils.utils.UtilConstants.CLOSE_PARENTHESIS;
+import static org.onosproject.yangutils.utils.UtilConstants.COLAN;
 import static org.onosproject.yangutils.utils.UtilConstants.COMMA;
+import static org.onosproject.yangutils.utils.UtilConstants.DEFAULT;
 import static org.onosproject.yangutils.utils.UtilConstants.DIAMOND_CLOSE_BRACKET;
 import static org.onosproject.yangutils.utils.UtilConstants.DIAMOND_OPEN_BRACKET;
 import static org.onosproject.yangutils.utils.UtilConstants.EIGHT_SPACE_INDENTATION;
@@ -82,6 +88,7 @@
 import static org.onosproject.yangutils.utils.UtilConstants.STATIC;
 import static org.onosproject.yangutils.utils.UtilConstants.STRING_DATA_TYPE;
 import static org.onosproject.yangutils.utils.UtilConstants.SUFFIX_S;
+import static org.onosproject.yangutils.utils.UtilConstants.SWITCH;
 import static org.onosproject.yangutils.utils.UtilConstants.THIS;
 import static org.onosproject.yangutils.utils.UtilConstants.TMP_VAL;
 import static org.onosproject.yangutils.utils.UtilConstants.TO;
@@ -494,10 +501,11 @@
 
         rpcName = getSmallCase(getCamelCase(rpcName, null));
         inputName = getCaptialCase(inputName);
-        outputName = getCaptialCase(outputName);
-
-        return FOUR_SPACE_INDENTATION + PUBLIC + SPACE + outputName + SPACE + rpcName + OPEN_PARENTHESIS
-                + inputName + SPACE + RPC_INPUT_VAR_NAME + CLOSE_PARENTHESIS + SEMI_COLAN;
+        if (!outputName.equals(VOID)) {
+            outputName = getCaptialCase(outputName);
+        }
+        return FOUR_SPACE_INDENTATION + outputName + SPACE + rpcName + OPEN_PARENTHESIS + inputName + SPACE
+                + RPC_INPUT_VAR_NAME + CLOSE_PARENTHESIS + SEMI_COLAN;
     }
 
     /**
@@ -512,12 +520,14 @@
 
         rpcName = getSmallCase(getCamelCase(rpcName, null));
         inputName = getCaptialCase(inputName);
-        outputName = getCaptialCase(outputName);
+        if (!outputName.equals(VOID)) {
+            outputName = getCaptialCase(outputName);
+        }
 
-        String method = getOverRideString() +
-                FOUR_SPACE_INDENTATION + PUBLIC + SPACE + outputName + SPACE + rpcName + OPEN_PARENTHESIS
-                + inputName + SPACE + RPC_INPUT_VAR_NAME + CLOSE_PARENTHESIS + SPACE + OPEN_CURLY_BRACKET
-                + NEW_LINE + EIGHT_SPACE_INDENTATION + YANG_UTILS_TODO + NEW_LINE;
+        String method =
+                getOverRideString() + FOUR_SPACE_INDENTATION + PUBLIC + SPACE + outputName + SPACE + rpcName
+                        + OPEN_PARENTHESIS + inputName + SPACE + RPC_INPUT_VAR_NAME + CLOSE_PARENTHESIS + SPACE
+                        + OPEN_CURLY_BRACKET + NEW_LINE + EIGHT_SPACE_INDENTATION + YANG_UTILS_TODO + NEW_LINE;
         if (!outputName.contentEquals(VOID)) {
             method += EIGHT_SPACE_INDENTATION + RETURN + SPACE + NULL + SEMI_COLAN + NEW_LINE;
         }
@@ -601,7 +611,7 @@
      * @return from string method's open string
      */
     public static String getFromStringMethodSignature(String className) {
-        return getJavaDoc(FROM_METHOD, className, false) + FOUR_SPACE_INDENTATION + PUBLIC + SPACE
+        return getJavaDoc(FROM_METHOD, className, false) + FOUR_SPACE_INDENTATION + PUBLIC + SPACE + STATIC + SPACE
                 + className + SPACE + FROM_STRING_METHOD_NAME + OPEN_PARENTHESIS + STRING_DATA_TYPE + SPACE
                 + FROM_STRING_PARAM_NAME + CLOSE_PARENTHESIS + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
     }
@@ -677,7 +687,6 @@
                 + OPEN_PARENTHESIS + FROM_STRING_PARAM_NAME + CLOSE_PARENTHESIS;
     }
 
-
     /**
      * Returns hash code method open strings.
      *
@@ -916,4 +925,38 @@
                 + OPEN_CURLY_BRACKET + NEW_LINE + EIGHT_SPACE_INDENTATION + getSmallCase(className) + SPACE + EQUAL
                 + SPACE + VALUE + SEMI_COLAN + NEW_LINE + FOUR_SPACE_INDENTATION + CLOSE_CURLY_BRACKET;
     }
+
+    /**
+     * Returns of method for enum class.
+     *
+     * @param className class name
+     * @param attr java attribute
+     * @param enumMap enum's sets map
+     * @param enumList enum's sets list
+     * @return of method
+     */
+    public static String getEnumsOfMethod(String className, JavaAttributeInfo attr,
+            Map<String, Integer> enumMap, List<String> enumList) {
+        String attrType = getReturnType(attr);
+        String attrName = getSmallCase(attr.getAttributeName());
+
+        String method = FOUR_SPACE_INDENTATION + PUBLIC + SPACE + STATIC + SPACE + className + SPACE + OF
+                + OPEN_PARENTHESIS
+                + attrType + SPACE + VALUE + CLOSE_PARENTHESIS + SPACE + OPEN_CURLY_BRACKET + NEW_LINE
+                + EIGHT_SPACE_INDENTATION + SWITCH + SPACE + OPEN_PARENTHESIS + VALUE
+                + CLOSE_PARENTHESIS + SPACE + OPEN_CURLY_BRACKET + NEW_LINE;
+        int value = 0;
+        for (String str : enumList) {
+
+            value = enumMap.get(str);
+            method = method + TWELVE_SPACE_INDENTATION + CASE + SPACE + value + COLAN + NEW_LINE
+                    + SIXTEEN_SPACE_INDENTATION + RETURN + SPACE + className + PERIOD
+                    + str + SEMI_COLAN + NEW_LINE;
+        }
+        method = method + TWELVE_SPACE_INDENTATION + DEFAULT + SPACE + COLAN + NEW_LINE + SIXTEEN_SPACE_INDENTATION
+                + RETURN + SPACE + NULL + SEMI_COLAN + NEW_LINE + EIGHT_SPACE_INDENTATION + CLOSE_CURLY_BRACKET
+                + NEW_LINE + FOUR_SPACE_INDENTATION + CLOSE_CURLY_BRACKET;
+
+        return getJavaDoc(OF_METHOD, className + " for type " + attrName, false) + method;
+    }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
index 741274e..e1db371 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
@@ -21,7 +21,11 @@
 import java.util.List;
 
 import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
 import org.onosproject.yangutils.translator.tojava.JavaImportDataContainer;
+import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
+
+import static java.util.Collections.sort;
 
 import static org.onosproject.yangutils.translator.tojava.JavaImportData.getAugmentedInfoImport;
 import static org.onosproject.yangutils.translator.tojava.JavaImportData.getHasAugmentationImport;
@@ -31,8 +35,6 @@
 import static org.onosproject.yangutils.utils.UtilConstants.HAS_AUGMENTATION;
 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.updateFileHandle;
 
-import static java.util.Collections.sort;
-
 /**
  * Represents utilities for temporary java code fragments.
  */
@@ -52,7 +54,8 @@
      * @param operation add or delete import
      * @return import for HasAugmentation class
      */
-    public static List<String> addHasAugmentationImport(YangNode curNode, List<String> imports, boolean operation) {
+    public static List<String> addHasAugmentationImport(YangNode curNode, List<String> imports,
+            boolean operation) {
         if (curNode instanceof JavaImportDataContainer) {
             String thisImport = getHasAugmentationImport();
             performOperationOnImports(imports, thisImport, operation);
@@ -109,13 +112,14 @@
      * @param operation add or remove
      * @return import list
      */
-    private static List<String> performOperationOnImports(List<String> imports, String curImport, boolean operation) {
+    private static List<String> performOperationOnImports(List<String> imports, String curImport,
+            boolean operation) {
         if (operation) {
             imports.add(curImport);
         } else {
             imports.remove(curImport);
         }
-        sort(imports);
+        sortImports(imports);
         return imports;
     }
 
@@ -142,7 +146,7 @@
      * @return true or false
      */
     public static boolean isHasAugmentationExtended(List<String> extendsList) {
-        return (extendsList != null && extendsList.contains(HAS_AUGMENTATION));
+        return extendsList != null && extendsList.contains(HAS_AUGMENTATION);
     }
 
     /**
@@ -152,7 +156,7 @@
      * @return true or false
      */
     public static boolean isAugmentedInfoExtended(List<String> extendsList) {
-        return (extendsList != null && extendsList.contains(AUGMENTED_INFO));
+        return extendsList != null && extendsList.contains(AUGMENTED_INFO);
     }
 
     /**
@@ -172,4 +176,37 @@
             }
         }
     }
+
+    /**
+     * Detects collision between parent and child node which have same name.
+     * When parent and child node both have the same name in that case child node should be used with
+     * qualified name.
+     *
+     * @param curNode current YANG node
+     * @param qualifiedTypeInfo current node's qualified info
+     * @return true if collision is detected
+     */
+    public static boolean detectCollisionBwParentAndChildForImport(YangNode curNode,
+            JavaQualifiedTypeInfo qualifiedTypeInfo) {
+
+        YangNode parent = curNode.getParent();
+        String parentsClassInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo().getJavaName();
+        String childsClassInfo = qualifiedTypeInfo.getClassInfo();
+        if (childsClassInfo.equals(parentsClassInfo)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Returns sorted import list.
+     *
+     * @param imports import list
+     * @return sorted import list
+     */
+    public static List<String> sortImports(List<String> imports) {
+        sort(imports);
+        return imports;
+    }
+
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
index 0597683..d285351 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
@@ -149,7 +149,7 @@
             /**
              * Enumeration
              */
-            javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
+            javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().getEnumerationTempFiles()
                     .addEnumAttributeToTempFiles((YangNode) javaCodeGeneratorInfo);
         } else if (javaCodeGeneratorInfo instanceof YangChoice) {
             /*Do nothing, only the interface needs to be generated*/
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
index 965367c..dc7920a 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
@@ -41,7 +41,6 @@
     public static final String INTERFACE_JAVA_DOC = " * Abstraction of an entity which represents the"
             + " functionality of ";
 
-
     /**
      * JavaDocs for event.
      */
@@ -52,7 +51,6 @@
      */
     public static final String EVENT_LISTENER_JAVA_DOC = " * Abstraction for event listener of ";
 
-
     /**
      * JavaDocs for builder interface class.
      */
@@ -169,6 +167,11 @@
     public static final String NEW_LINE = "\n";
 
     /**
+     * Static attribute for default.
+     */
+    public static final String DEFAULT = "default";
+
+    /**
      * Static attribute for multiple new line.
      */
     public static final String MULTIPLE_NEW_LINE = "\n\n";
@@ -434,6 +437,16 @@
     public static final String CLEAR = "clear";
 
     /**
+     * Static attribute for switch syntax.
+     */
+    public static final String SWITCH = "switch";
+
+    /**
+     * Static attribute for case syntax.
+     */
+    public static final String CASE = "case";
+
+    /**
      * Static attribute for temp val syntax.
      */
     public static final String TMP_VAL = "tmpVal";
@@ -703,7 +716,6 @@
      */
     public static final String SERVICE = "Service";
 
-
     /**
      * Static attribute for interface syntax.
      */
@@ -875,7 +887,7 @@
     public static final String ARRAY_LIST = "ArrayList";
 
     /**
-     * comment to be added for autogenerated impl methods.
+     * Comment to be added for autogenerated impl methods.
      */
     public static final String YANG_UTILS_TODO = "//TODO: YANG utils generated code";
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java
index 1dced05..7d8fd84 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java
@@ -24,8 +24,9 @@
 import java.io.PrintWriter;
 
 import org.onosproject.yangutils.datamodel.YangNode;
-import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
+import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
+import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
 
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getJavaPackageFromPackagePath;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
@@ -35,7 +36,6 @@
 import static org.onosproject.yangutils.utils.UtilConstants.FOUR_SPACE_INDENTATION;
 import static org.onosproject.yangutils.utils.UtilConstants.MULTIPLE_NEW_LINE;
 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.SLASH;
 import static org.onosproject.yangutils.utils.UtilConstants.SPACE;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.addPackageInfo;
@@ -62,7 +62,7 @@
     public static boolean doesPackageExist(String pkg) {
         File pkgDir = new File(getPackageDirPathFromJavaJPackage(pkg));
         File pkgWithFile = new File(pkgDir + SLASH + "package-info.java");
-        return (pkgDir.exists() && pkgWithFile.isFile());
+        return pkgDir.exists() && pkgWithFile.isFile();
     }
 
     /**
@@ -71,26 +71,24 @@
      * @param yangNode YANG node for which code is being generated
      * @throws IOException any IO exception
      */
-    public static void createPackage(YangNode yangNode)
-            throws IOException {
-
-        YangNode parent = getParentNodeInGenCode(yangNode);
-        JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) yangNode).getJavaFileInfo();
-        String absolutePath = getAbsolutePackagePath(javaFileInfo.getBaseCodeGenPath(),
-                javaFileInfo.getPackageFilePath());
-
-        String pkgInfo;
-        if (parent != null) {
-            pkgInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo().getJavaName()
-                    + PACKAGE_INFO_JAVADOC_OF_CHILD;
-        } else {
-            pkgInfo = javaFileInfo.getJavaName();
+    public static void createPackage(YangNode yangNode) throws IOException {
+        if (!(yangNode instanceof JavaFileInfoContainer)) {
+            throw new TranslatorException("current node must have java file info");
         }
-
-        if (!doesPackageExist(absolutePath)) {
+        String pkgInfo;
+        JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) yangNode).getJavaFileInfo();
+        String pkg = getAbsolutePackagePath(javaFileInfo.getBaseCodeGenPath(), javaFileInfo.getPackageFilePath());
+        if (!doesPackageExist(pkg)) {
             try {
-                File pack = createDirectories(absolutePath);
-                addPackageInfo(pack, pkgInfo, getJavaPackageFromPackagePath(absolutePath));
+                File pack = createDirectories(pkg);
+                YangNode parent = getParentNodeInGenCode(yangNode);
+                if (parent != null) {
+                    pkgInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo().getJavaName();
+                    addPackageInfo(pack, pkgInfo, getJavaPackageFromPackagePath(pkg), true);
+                } else {
+                    pkgInfo = ((JavaFileInfoContainer) yangNode).getJavaFileInfo().getJavaName();
+                    addPackageInfo(pack, pkgInfo, getJavaPackageFromPackagePath(pkg), false);
+                }
             } catch (IOException e) {
                 throw new IOException("failed to create package-info file");
             }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java
index fdf876d..335de7f 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java
@@ -19,7 +19,6 @@
 import org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax;
 
 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.utils.UtilConstants.BUILDER;
 import static org.onosproject.yangutils.utils.UtilConstants.BUILDER_CLASS_JAVA_DOC;
 import static org.onosproject.yangutils.utils.UtilConstants.BUILDER_INTERFACE_JAVA_DOC;
@@ -54,12 +53,14 @@
 import static org.onosproject.yangutils.utils.UtilConstants.OBJECT;
 import static org.onosproject.yangutils.utils.UtilConstants.OF;
 import static org.onosproject.yangutils.utils.UtilConstants.PACKAGE_INFO_JAVADOC;
+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.RPC_INPUT_STRING;
 import static org.onosproject.yangutils.utils.UtilConstants.RPC_OUTPUT_STRING;
 import static org.onosproject.yangutils.utils.UtilConstants.SPACE;
 import static org.onosproject.yangutils.utils.UtilConstants.STRING_DATA_TYPE;
 import static org.onosproject.yangutils.utils.UtilConstants.VALUE;
+import static org.onosproject.yangutils.utils.UtilConstants.VOID;
 
 /**
  * Represents javadoc for the generated classes.
@@ -108,11 +109,16 @@
         GETTER_METHOD,
 
         /**
-         * For rpc.
+         * For rpc service.
          */
         RPC_INTERFACE,
 
         /**
+         * For rpc manager.
+         */
+        RPC_MANAGER,
+
+        /**
          * For event.
          */
         EVENT,
@@ -203,7 +209,7 @@
                 return generateForBuilderInterface(name);
             }
             case PACKAGE_INFO: {
-                return generateForPackage(name);
+                return generateForPackage(name, isList);
             }
             case GETTER_METHOD: {
                 return generateForGetters(name, isList);
@@ -239,7 +245,10 @@
                 return generateForEnumAttr(name);
             }
             case RPC_INTERFACE: {
-                return generateForRpcInterface(name);
+               return generateForRpcService(name);
+            }
+            case RPC_MANAGER: {
+               return generateForImplClass(name);
             }
             case EVENT: {
                 return generateForEvent(name);
@@ -274,13 +283,14 @@
      */
     public static String generateJavaDocForRpc(String rpcName, String inputName, String outputName) {
         rpcName = getCamelCase(rpcName, null);
-        inputName = getCaptialCase(inputName);
-        outputName = getCaptialCase(outputName);
 
-        return NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_FIRST_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_RPC
+        String javadoc = NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_FIRST_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_RPC
                 + rpcName + PERIOD + NEW_LINE + FOUR_SPACE_INDENTATION + NEW_LINE_ASTERISK
-                + getInputString(inputName, rpcName) + getOutputString(outputName, rpcName) + FOUR_SPACE_INDENTATION
-                + JAVA_DOC_END_LINE;
+                + getInputString(inputName, rpcName);
+        if (!outputName.equals(VOID)) {
+            javadoc = javadoc + getOutputString(outputName, rpcName);
+        }
+        return javadoc + FOUR_SPACE_INDENTATION + JAVA_DOC_END_LINE;
     }
 
     /**
@@ -315,7 +325,7 @@
      * @param interfaceName interface name
      * @return javaDocs
      */
-    private static String generateForRpcInterface(String interfaceName) {
+    private static String generateForRpcService(String interfaceName) {
         return NEW_LINE + JAVA_DOC_FIRST_LINE + INTERFACE_JAVA_DOC + interfaceName + PERIOD + NEW_LINE
                 + JAVA_DOC_END_LINE;
     }
@@ -436,7 +446,7 @@
         return NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_FIRST_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_OF
                 + attribute + SPACE + FROM_STRING_METHOD_NAME + SPACE + INPUT + SPACE + STRING_DATA_TYPE + PERIOD
                 + NEW_LINE + FOUR_SPACE_INDENTATION + NEW_LINE_ASTERISK + FOUR_SPACE_INDENTATION + JAVA_DOC_PARAM
-                + FROM_STRING_PARAM_NAME + SPACE + INPUT + SPACE + STRING_DATA_TYPE + PERIOD + NEW_LINE
+                + FROM_STRING_PARAM_NAME + SPACE + INPUT + SPACE + STRING_DATA_TYPE + NEW_LINE
                 + FOUR_SPACE_INDENTATION + JAVA_DOC_RETURN + OBJECT + SPACE + OF + SPACE + attribute + NEW_LINE
                 + FOUR_SPACE_INDENTATION + JAVA_DOC_END_LINE;
     }
@@ -512,10 +522,15 @@
      * Generates javaDocs for package-info.
      *
      * @param packageName package name
+     * @param isChildNode is it child node
      * @return javaDocs
      */
-    private static String generateForPackage(String packageName) {
-        return JAVA_DOC_FIRST_LINE + PACKAGE_INFO_JAVADOC + packageName + PERIOD + NEW_LINE + JAVA_DOC_END_LINE;
+    private static String generateForPackage(String packageName, boolean isChildNode) {
+        String javaDoc = JAVA_DOC_FIRST_LINE + PACKAGE_INFO_JAVADOC + packageName;
+        if (isChildNode) {
+            javaDoc = javaDoc + PACKAGE_INFO_JAVADOC_OF_CHILD;
+        }
+        return javaDoc + PERIOD + NEW_LINE + JAVA_DOC_END_LINE;
     }
 
     /**
@@ -536,11 +551,10 @@
      * @return javaDocs
      */
     private static String generateForConstructors(String className) {
-        return NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_FIRST_LINE
-                + FOUR_SPACE_INDENTATION + JAVA_DOC_CONSTRUCTOR + className + IMPL + PERIOD + NEW_LINE
-                + FOUR_SPACE_INDENTATION + NEW_LINE_ASTERISK + FOUR_SPACE_INDENTATION + JAVA_DOC_PARAM
-                + BUILDER.toLowerCase() + OBJECT + SPACE + BUILDER_OBJECT + className + NEW_LINE
-                + FOUR_SPACE_INDENTATION + JAVA_DOC_END_LINE;
+        return NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_FIRST_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_CONSTRUCTOR
+                + className + IMPL + PERIOD + NEW_LINE + FOUR_SPACE_INDENTATION + NEW_LINE_ASTERISK
+                + FOUR_SPACE_INDENTATION + JAVA_DOC_PARAM + BUILDER.toLowerCase() + OBJECT + SPACE + BUILDER_OBJECT
+                + className + NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_END_LINE;
     }
 
     /**
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
index 192df4e..a076fbe 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
@@ -23,7 +23,9 @@
 import java.nio.file.Files;
 import java.nio.file.StandardCopyOption;
 import java.util.ArrayList;
+import java.util.LinkedList;
 import java.util.List;
+import java.util.Stack;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.model.Resource;
@@ -80,9 +82,11 @@
      * @param path directory path
      * @param classInfo class info for the package
      * @param pack package of the directory
+     * @param isChildNode is it a child node
      * @throws IOException when fails to create package info file
      */
-    public static void addPackageInfo(File path, String classInfo, String pack) throws IOException {
+    public static void addPackageInfo(File path, String classInfo, String pack, boolean isChildNode)
+            throws IOException {
 
         if (pack.contains(ORG)) {
             String[] strArray = pack.split(ORG);
@@ -97,7 +101,7 @@
             BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
 
             bufferedWriter.write(CopyrightHeader.getCopyrightHeader());
-            bufferedWriter.write(getJavaDoc(PACKAGE_INFO, classInfo, false));
+            bufferedWriter.write(getJavaDoc(PACKAGE_INFO, classInfo, isChildNode));
             bufferedWriter.write(PACKAGE + SPACE + pack + SEMI_COLAN);
 
             bufferedWriter.close();
@@ -119,12 +123,46 @@
             try {
                 FileUtils.deleteDirectory(generatedDirectory);
             } catch (IOException e) {
-                throw new IOException("Failed to delete the generated files in " + generatedDirectory + " directory");
+                throw new IOException(
+                        "Failed to delete the generated files in " + generatedDirectory + " directory");
             }
         }
     }
 
     /**
+     * Searches and deletes generated temporary directories.
+     *
+     * @param root root directory
+     * @throws IOException when fails to do IO operations.
+     */
+    public static void searchAndDeleteTempDir(String root) throws IOException {
+        List<File> store = new LinkedList<>();
+        Stack<String> stack = new Stack<>();
+        stack.push(root);
+
+        while (!stack.empty()) {
+            root = stack.pop();
+            File file = new File(root);
+            File[] filelist = file.listFiles();
+            if (filelist == null || filelist.length == 0) {
+                continue;
+            }
+            for (File current : filelist) {
+                if (current.isDirectory()) {
+                    stack.push(current.toString());
+                    if (current.getName().endsWith("-Temp")) {
+                        store.add(current);
+                    }
+                }
+            }
+        }
+
+        for (File dir : store) {
+            dir.delete();
+        }
+    }
+
+    /**
      * Adds generated source directory to the compilation root.
      *
      * @param source directory
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/translator/tojava/utils/EnumTranslatorTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/translator/tojava/utils/EnumTranslatorTest.java
new file mode 100644
index 0000000..2a950fc
--- /dev/null
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/translator/tojava/utils/EnumTranslatorTest.java
@@ -0,0 +1,54 @@
+/*
+ * 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.utils;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
+
+import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
+
+/**
+ * Unit test case for enum translator.
+ */
+public final class EnumTranslatorTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks enum translation should not result in any exception.
+     */
+    @Test
+    public void processEnumTranslator()
+            throws IOException, ParserException {
+
+        String userDir = System.getProperty("user.dir");
+        YangNode node = manager.getDataModel("src/test/resources/EnumTranslator.yang");
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir(userDir + "/target/EnumTestGenFile/");
+
+        generateJavaCode(node, yangPluginConfig);
+
+        deleteDirectory(userDir + "/target/EnumTestGenFile/");
+    }
+    // TODO enhance the test cases, after having a framework of translator test.
+}
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtilTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtilTest.java
index 0d97cf0..9819445 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtilTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtilTest.java
@@ -22,6 +22,7 @@
 import java.lang.reflect.InvocationTargetException;
 
 import org.junit.Test;
+import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
 
@@ -41,20 +42,23 @@
 public final class FileSystemUtilTest {
 
     private static final String BASE_DIR_PKG = "target.UnitTestCase.";
-    private static final String PKG_INFO_CONTENT = "testGeneration6";
     private static final String BASE_PKG = "target/UnitTestCase";
     private static final String TEST_DATA_1 = "This is to append a text to the file first1\n";
     private static final String TEST_DATA_2 = "This is next second line\n";
     private static final String TEST_DATA_3 = "This is next third line in the file";
+    private static final String TEST_FILE = "testFile";
+    private static final String SOURCE_TEST_FILE = "sourceTestFile";
+    private static final String DIR_PATH = "exist1.exist2.exist3";
+    private static final String PKG_INFO = "package-info.java";
 
     /**
      * A private constructor is tested.
      *
-     * @throws SecurityException         if any security violation is observed
-     * @throws NoSuchMethodException     if when the method is not found
-     * @throws IllegalArgumentException  if there is illegal argument found
-     * @throws InstantiationException    if instantiation is provoked for the private constructor
-     * @throws IllegalAccessException    if instance is provoked or a method is provoked
+     * @throws SecurityException if any security violation is observed
+     * @throws NoSuchMethodException if when the method is not found
+     * @throws IllegalArgumentException if there is illegal argument found
+     * @throws InstantiationException if instantiation is provoked for the private constructor
+     * @throws IllegalAccessException if instance is provoked or a method is provoked
      * @throws InvocationTargetException when an exception occurs by the method or constructor
      */
     @Test
@@ -62,7 +66,7 @@
             throws SecurityException, NoSuchMethodException, IllegalArgumentException,
             InstantiationException, IllegalAccessException, InvocationTargetException {
 
-        Class<?>[] classesToConstruct = {FileSystemUtil.class};
+        Class<?>[] classesToConstruct = {FileSystemUtil.class };
         for (Class<?> clazz : classesToConstruct) {
             Constructor<?> constructor = clazz.getDeclaredConstructor();
             constructor.setAccessible(true);
@@ -76,14 +80,13 @@
      * @throws IOException when fails to create a test file
      */
     @Test
-    public void updateFileHandleTest()
-            throws IOException {
+    public void updateFileHandleTest() throws IOException {
 
-        File dir = new File(BASE_PKG + SLASH + "File1");
+        File dir = new File(BASE_PKG + SLASH + TEST_FILE);
         dir.mkdirs();
-        File createFile = new File(dir + "testFile");
+        File createFile = new File(dir + TEST_FILE);
         createFile.createNewFile();
-        File createSourceFile = new File(dir + "sourceTestFile");
+        File createSourceFile = new File(dir + SOURCE_TEST_FILE);
         createSourceFile.createNewFile();
         updateFileHandle(createFile, TEST_DATA_1, false);
         updateFileHandle(createFile, TEST_DATA_2, false);
@@ -98,23 +101,31 @@
      * @throws IOException when failed to create a test file
      */
     @Test
-    public void packageExistTest()
-            throws IOException {
+    public void packageExistTest() throws IOException {
 
-        String dirPath = "exist1.exist2.exist3";
-        String strPath = BASE_DIR_PKG + dirPath;
+        String strPath = BASE_DIR_PKG + DIR_PATH;
         File createDir = new File(strPath.replace(PERIOD, SLASH));
         createDir.mkdirs();
-        File createFile = new File(createDir + SLASH + "package-info.java");
+        File createFile = new File(createDir + SLASH + PKG_INFO);
         createFile.createNewFile();
         assertThat(true, is(doesPackageExist(strPath)));
-        JavaFileInfo javaFileInfo = new JavaFileInfo();
-        javaFileInfo.setBaseCodeGenPath(BASE_DIR_PKG);
-        javaFileInfo.setPackageFilePath(dirPath);
-        YangJavaModule moduleNode = new YangJavaModule();
-        moduleNode.setJavaFileInfo(javaFileInfo);
-        createPackage(moduleNode);
+        createPackage(getStubNode());
         createDir.delete();
     }
 
+    /**
+     * Returns stub YANG node.
+     *
+     * @return stub node
+     */
+    private YangNode getStubNode() {
+        YangJavaModule module = new YangJavaModule();
+        module.setName(TEST_DATA_1);
+        JavaFileInfo javafileInfo = new JavaFileInfo();
+        javafileInfo.setJavaName(TEST_DATA_1);
+        javafileInfo.setBaseCodeGenPath("");
+        javafileInfo.setPackageFilePath(BASE_PKG);
+        module.setJavaFileInfo(javafileInfo);
+        return module;
+    }
 }
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/JavaDocGenTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/JavaDocGenTest.java
index 23541e0..0284ea0 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/JavaDocGenTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/JavaDocGenTest.java
@@ -51,7 +51,7 @@
     public ExpectedException thrown = ExpectedException.none();
 
     /**
-     * This test case checks the content recieved for the builder class java doc.
+     * This test case checks the content received for the builder class java doc.
      */
     @Test
     public void builderClassGenerationTest() {
@@ -61,7 +61,7 @@
     }
 
     /**
-     * This test case checks the content recieved for the builder interface ge java doc.
+     * This test case checks the content received for the builder interface ge java doc.
      */
     @Test
     public void builderInterfaceGenerationTest() {
@@ -71,7 +71,7 @@
     }
 
     /**
-     * This test case checks the content recieved for the build  java doc.
+     * This test case checks the content received for the build  java doc.
      */
     @Test
     public void buildGenerationTest() {
@@ -102,7 +102,7 @@
     }
 
     /**
-     * This test case checks the content recieved for the constructor java doc.
+     * This test case checks the content received for the constructor java doc.
      */
     @Test
     public void constructorGenerationTest() {
@@ -113,7 +113,7 @@
     }
 
     /**
-     * This test case checks the content recieved for the default constructor java doc.
+     * This test case checks the content received for the default constructor java doc.
      */
     @Test
     public void defaultConstructorGenerationTest() {
@@ -123,7 +123,7 @@
     }
 
     /**
-     * This test case checks the content recieved for the getter java doc.
+     * This test case checks the content received for the getter java doc.
      */
     @Test
     public void getterGenerationTest() {
@@ -132,7 +132,7 @@
     }
 
     /**
-     * This test case checks the content recieved for the impl class java doc.
+     * This test case checks the content received for the impl class java doc.
      */
     @Test
     public void implClassGenerationTest() {
@@ -143,7 +143,7 @@
     }
 
     /**
-     * This test case checks the content recieved for the interface java doc.
+     * This test case checks the content received for the interface java doc.
      */
     @Test
     public void interfaceGenerationTest() {
@@ -154,7 +154,7 @@
     }
 
     /**
-     * This test case checks the content recieved for the package info  java doc.
+     * This test case checks the content received for the package info  java doc.
      */
     @Test
     public void packageInfoGenerationTest() {
@@ -163,7 +163,17 @@
     }
 
     /**
-     * This test case checks the content recieved for the setter java doc.
+     * This test case checks the content received for the package info  java doc.
+     */
+    @Test
+    public void packageInfoGenerationForChildNodeTest() {
+        String packageInfo = getJavaDoc(PACKAGE_INFO, TEST_NAME, true);
+        assertThat(true, is(packageInfo.contains("Implementation of YANG node testName's children nodes")
+                && packageInfo.contains(END_STRING)));
+    }
+
+    /**
+     * This test case checks the content received for the setter java doc.
      */
     @Test
     public void setterGenerationTest() {
diff --git a/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/YangIoUtilsTest.java b/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/YangIoUtilsTest.java
index b939516..204bd7b 100644
--- a/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/YangIoUtilsTest.java
+++ b/utils/yangutils/src/test/java/org/onosproject/yangutils/utils/io/impl/YangIoUtilsTest.java
@@ -47,6 +47,10 @@
     private static final String CREATE_PATH = BASE_DIR + File.separator + "dir1/dir2/dir3/dir4/";
     private static final String CHECK_STRING = "one, two, three, four, five, six";
     private static final String TRIM_STRING = "one, two, three, four, five, ";
+    private static final String CHECK1 = "check1";
+    private static final String PKG_INFO = "package-info.java";
+    private static final String PATH = "src/main/yangmodel/";
+    private static final String MSG = "Exception occured while creating package info file.";
 
     /**
      * Expected exceptions.
@@ -64,8 +68,8 @@
 
         File dirPath = new File(CREATE_PATH);
         dirPath.mkdirs();
-        addPackageInfo(dirPath, "check1", CREATE_PATH);
-        File filePath = new File(dirPath + File.separator + "package-info.java");
+        addPackageInfo(dirPath, CHECK1, CREATE_PATH, false);
+        File filePath = new File(dirPath + File.separator + PKG_INFO);
         assertThat(filePath.isFile(), is(true));
     }
 
@@ -79,8 +83,23 @@
 
         File dirPath = new File(CREATE_PATH);
         dirPath.mkdirs();
-        addPackageInfo(dirPath, "check1", "src/main/yangmodel/" + CREATE_PATH);
-        File filePath = new File(dirPath + File.separator + "package-info.java");
+        addPackageInfo(dirPath, CHECK1, PATH + CREATE_PATH, false);
+        File filePath = new File(dirPath + File.separator + PKG_INFO);
+        assertThat(filePath.isFile(), is(true));
+    }
+
+    /**
+     * This test case checks with a child node.
+     *
+     * @throws IOException when fails to do IO operations for test case
+     */
+    @Test
+    public void addPackageInfoWithChildNode() throws IOException {
+
+        File dirPath = new File(CREATE_PATH);
+        dirPath.mkdirs();
+        addPackageInfo(dirPath, CHECK1, PATH + CREATE_PATH, true);
+        File filePath = new File(dirPath + File.separator + PKG_INFO);
         assertThat(filePath.isFile(), is(true));
     }
 
@@ -94,9 +113,9 @@
 
         File dirPath = new File("invalid/check");
         thrown.expect(IOException.class);
-        thrown.expectMessage("Exception occured while creating package info file.");
-        addPackageInfo(dirPath, "check1", CREATE_PATH);
-        File filePath1 = new File(dirPath + File.separator + "package-info.java");
+        thrown.expectMessage(MSG);
+        addPackageInfo(dirPath, CHECK1, CREATE_PATH, false);
+        File filePath1 = new File(dirPath + File.separator + PKG_INFO);
         assertThat(filePath1.isFile(), is(false));
     }
 
diff --git a/utils/yangutils/src/test/resources/EnumTranslator.yang b/utils/yangutils/src/test/resources/EnumTranslator.yang
new file mode 100644
index 0000000..1957c1f
--- /dev/null
+++ b/utils/yangutils/src/test/resources/EnumTranslator.yang
@@ -0,0 +1,17 @@
+module Sfc {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf test{
+        type string;
+    }
+    leaf myenum {
+      type enumeration {
+         enum zero;
+         enum one;
+         enum seven {
+              value 7;
+             }
+         }
+     }
+}
