[ONOS-3908] Implemetation of YANG container translator.
Change-Id: I9ffcfc4b370edb801dfc90c5394cef787c77641d
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java b/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
index c35fafa..d1d3c7e 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
@@ -155,7 +155,7 @@
private byte version;
/**
- * package of the generated java code.
+ * Package of the generated java code.
*/
private String pkg;
@@ -493,6 +493,7 @@
*
* @return the fileHandle
*/
+ @Override
public CachedFileHandle getFileHandle() {
return fileHandle;
}
@@ -502,6 +503,7 @@
*
* @param handle the fileHandle to set
*/
+ @Override
public void setFileHandle(CachedFileHandle handle) {
fileHandle = handle;
}
@@ -555,14 +557,20 @@
throw new IOException("Failed to create the source files.");
}
setFileHandle(handle);
- addLavesAttributes();
+ }
+
+ @Override
+ public void generateJavaCodeExit() throws IOException {
+ addLeavesAttributes();
addLeafListAttributes();
+ getFileHandle().close();
+ return;
}
/**
* Adds leaf attributes in generated files.
*/
- private void addLavesAttributes() {
+ private void addLeavesAttributes() {
List<YangLeaf<?>> leaves = getListOfLeaf();
if (leaves != null) {
@@ -584,15 +592,4 @@
}
}
- /**
- * Free resources used to generate code.
- *
- * @throws IOException when fails to generate source files.
- */
- @Override
- public void generateJavaCodeExit() throws IOException {
- getFileHandle().close();
- return;
- }
-
}