[ONOS-4073] YANG enum translator implementation.
Change-Id: I129eaec0c8f81c674a994a579650f18499340052
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaAttributeInfo.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaAttributeInfo.java
index b02b4e2..44e8ab2 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaAttributeInfo.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaAttributeInfo.java
@@ -124,6 +124,29 @@
}
/**
+ * Creates an attribute info object corresponding to the passed enumeration attribute
+ * information and return it.
+ *
+ * @param curNode current data model node for which the java file is being
+ * generated
+ * @param attributeName attribute name
+ * @return AttributeInfo attribute details required to add in temporary
+ * files
+ */
+ public static JavaAttributeInfo getAttributeInfoOfEnumAttribute(YangNode curNode, String attributeName) {
+
+ String curNodeName = ((HasJavaFileInfo) curNode).getJavaFileInfo().getJavaName();
+
+ /*
+ * Get the import info corresponding to the attribute for import in
+ * generated java files or qualified access
+ */
+ JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode,
+ curNodeName, false);
+
+ return getAttributeInfoForTheData(qualifiedTypeInfo, attributeName, null, curNode, false);
+ }
+ /**
* Returns the data type info of attribute.
*
* @return the data type info of attribute