multiFileYangTranslator
Change-Id: I2adfef3acaec4bd74ba2c487404d2c655b800988
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaAugment.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaAugment.java
index 9425e40..dbe006c 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaAugment.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaAugment.java
@@ -21,17 +21,18 @@
import org.onosproject.yangutils.translator.exception.TranslatorException;
import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
-import org.onosproject.yangutils.translator.tojava.JavaImportData;
import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
-import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode;
+import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfAugmentableNode;
/**
* Represents augment information extended to support java code generation.
*/
-public class YangJavaAugment extends YangAugment implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+public class YangJavaAugment
+ extends YangAugment
+ implements JavaCodeGeneratorInfo, JavaCodeGenerator {
/**
* Contains the information of the java file being generated.
@@ -39,12 +40,6 @@
private JavaFileInfo javaFileInfo;
/**
- * Contains information of the imports to be inserted in the java file
- * generated.
- */
- private JavaImportData javaImportData;
-
- /**
* File handle to maintain temporary java code fragments as per the code
* snippet types.
*/
@@ -56,7 +51,6 @@
public YangJavaAugment() {
super();
setJavaFileInfo(new JavaFileInfo());
- setJavaImportData(new JavaImportData());
getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
}
@@ -85,27 +79,6 @@
}
/**
- * Returns the data of java imports to be included in generated file.
- *
- * @return data of java imports to be included in generated file
- */
- @Override
- public JavaImportData getJavaImportData() {
- return javaImportData;
- }
-
- /**
- * Sets the data of java imports to be included in generated file.
- *
- * @param javaImportData data of java imports to be included in generated
- * file
- */
- @Override
- public void setJavaImportData(JavaImportData javaImportData) {
- this.javaImportData = javaImportData;
- }
-
- /**
* Returns the temporary file handle.
*
* @return temporary file handle
@@ -133,8 +106,9 @@
* @throws IOException IO operation fail
*/
@Override
- public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
- generateCodeOfNode(this, yangPlugin, false);
+ public void generateCodeEntry(YangPluginConfig yangPlugin)
+ throws IOException {
+ generateCodeOfAugmentableNode(this, yangPlugin);
}
/**
@@ -143,7 +117,8 @@
* @throws IOException when failed to do IO operations
*/
@Override
- public void generateCodeExit() throws IOException {
+ public void generateCodeExit()
+ throws IOException {
getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
}
}