Gaurav Agrawal
Committed by Thomas Vachuska

[ONOS-4711] Removed cyclic dependencies

Change-Id: I9ffea9a1a1b72f6ed3a23c0edb04cfc37bd8e48e
Showing 69 changed files with 272 additions and 649 deletions
...@@ -31,11 +31,11 @@ import org.onosproject.yangutils.datamodel.YangRpc; ...@@ -31,11 +31,11 @@ import org.onosproject.yangutils.datamodel.YangRpc;
31 import org.onosproject.yangutils.datamodel.YangType; 31 import org.onosproject.yangutils.datamodel.YangType;
32 import org.onosproject.yangutils.datamodel.exceptions.DataModelException; 32 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
33 33
34 +
34 /** 35 /**
35 * Represents utilities for data model tree. 36 * Represents utilities for data model tree.
36 */ 37 */
37 public final class DataModelUtils { 38 public final class DataModelUtils {
38 -
39 /** 39 /**
40 * Creates a new data model tree utility. 40 * Creates a new data model tree utility.
41 */ 41 */
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
17 package org.onosproject.yangutils.linker; 17 package org.onosproject.yangutils.linker;
18 18
19 import java.util.Set; 19 import java.util.Set;
20 -import org.onosproject.yangutils.plugin.manager.YangFileInfo; 20 +import org.onosproject.yangutils.datamodel.YangNode;
21 21
22 /** 22 /**
23 * Abstraction of entity which provides linking service of YANG files. 23 * Abstraction of entity which provides linking service of YANG files.
...@@ -28,7 +28,7 @@ public interface YangLinker { ...@@ -28,7 +28,7 @@ public interface YangLinker {
28 * Resolve the import and include dependencies for a given resolution 28 * Resolve the import and include dependencies for a given resolution
29 * information. 29 * information.
30 * 30 *
31 - * @param yangFileInfoSet set of all dependent YANG files 31 + * @param yangNodeSet set of all dependent YANG nodes
32 */ 32 */
33 - void resolveDependencies(Set<YangFileInfo> yangFileInfoSet); 33 + void resolveDependencies(Set<YangNode> yangNodeSet);
34 } 34 }
......
...@@ -25,7 +25,6 @@ import org.onosproject.yangutils.datamodel.YangSubModule; ...@@ -25,7 +25,6 @@ import org.onosproject.yangutils.datamodel.YangSubModule;
25 import org.onosproject.yangutils.datamodel.exceptions.DataModelException; 25 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
26 import org.onosproject.yangutils.linker.YangLinker; 26 import org.onosproject.yangutils.linker.YangLinker;
27 import org.onosproject.yangutils.linker.exceptions.LinkerException; 27 import org.onosproject.yangutils.linker.exceptions.LinkerException;
28 -import org.onosproject.yangutils.plugin.manager.YangFileInfo;
29 28
30 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE; 29 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
31 30
...@@ -53,53 +52,51 @@ public class YangLinkerManager ...@@ -53,53 +52,51 @@ public class YangLinkerManager
53 /** 52 /**
54 * Creates YANG nodes set. 53 * Creates YANG nodes set.
55 * 54 *
56 - * @param yangFileInfoSet YANG file information set 55 + * @param yangNodeSet YANG node information set
57 */ 56 */
58 - public void createYangNodeSet(Set<YangFileInfo> yangFileInfoSet) { 57 + public void createYangNodeSet(Set<YangNode> yangNodeSet) {
59 - for (YangFileInfo yangFileInfo : yangFileInfoSet) { 58 + getYangNodeSet().addAll(yangNodeSet);
60 - getYangNodeSet().add(yangFileInfo.getRootNode());
61 - }
62 } 59 }
63 60
64 @Override 61 @Override
65 - public void resolveDependencies(Set<YangFileInfo> yangFileInfoSet) { 62 + public void resolveDependencies(Set<YangNode> yangNodeSet) {
66 63
67 // Create YANG node set. 64 // Create YANG node set.
68 - createYangNodeSet(yangFileInfoSet); 65 + createYangNodeSet(yangNodeSet);
69 66
70 // Carry out linking of sub module with module. 67 // Carry out linking of sub module with module.
71 - linkSubModulesToParentModule(yangFileInfoSet); 68 + linkSubModulesToParentModule(yangNodeSet);
72 69
73 // Add references to import list. 70 // Add references to import list.
74 - addRefToYangFilesImportList(yangFileInfoSet); 71 + addRefToYangFilesImportList(yangNodeSet);
75 72
76 // Add reference to include list. 73 // Add reference to include list.
77 - addRefToYangFilesIncludeList(yangFileInfoSet); 74 + addRefToYangFilesIncludeList(yangNodeSet);
78 75
79 // TODO check for circular import/include. 76 // TODO check for circular import/include.
80 77
81 // Carry out inter-file linking. 78 // Carry out inter-file linking.
82 - processInterFileLinking(yangFileInfoSet); 79 + processInterFileLinking(yangNodeSet);
83 } 80 }
84 81
85 /** 82 /**
86 * Resolves sub-module linking by linking sub module with parent module. 83 * Resolves sub-module linking by linking sub module with parent module.
87 * 84 *
88 - * @param yangFileInfoSet set of YANG files info 85 + * @param yangNodeSet set of YANG files info
89 * @throws LinkerException fails to link sub-module to parent module 86 * @throws LinkerException fails to link sub-module to parent module
90 */ 87 */
91 - public void linkSubModulesToParentModule(Set<YangFileInfo> yangFileInfoSet) 88 + public void linkSubModulesToParentModule(Set<YangNode> yangNodeSet)
92 throws LinkerException { 89 throws LinkerException {
93 - for (YangFileInfo yangFileInfo : yangFileInfoSet) { 90 + for (YangNode yangNode : yangNodeSet) {
94 - YangNode yangNode = yangFileInfo.getRootNode();
95 if (yangNode instanceof YangSubModule) { 91 if (yangNode instanceof YangSubModule) {
96 try { 92 try {
97 ((YangSubModule) yangNode).linkWithModule(getYangNodeSet()); 93 ((YangSubModule) yangNode).linkWithModule(getYangNodeSet());
98 } catch (DataModelException e) { 94 } catch (DataModelException e) {
99 - String errorInfo = "YANG file error: " + yangFileInfo.getYangFileName() + " at line: " 95 + String errorInfo = "YANG file error: " + yangNode.getName() + " at line: "
100 + e.getLineNumber() + " at position: " + e.getCharPositionInLine() + NEW_LINE 96 + e.getLineNumber() + " at position: " + e.getCharPositionInLine() + NEW_LINE
101 + e.getMessage(); 97 + e.getMessage();
102 throw new LinkerException(errorInfo); 98 throw new LinkerException(errorInfo);
99 + // TODO add file path in exception message in util manager.
103 } 100 }
104 } 101 }
105 } 102 }
...@@ -108,20 +105,20 @@ public class YangLinkerManager ...@@ -108,20 +105,20 @@ public class YangLinkerManager
108 /** 105 /**
109 * Adds imported node information to the import list. 106 * Adds imported node information to the import list.
110 * 107 *
111 - * @param yangFileInfoSet set of YANG files info 108 + * @param yangNodeSet set of YANG files info
112 * @throws LinkerException fails to find imported module 109 * @throws LinkerException fails to find imported module
113 */ 110 */
114 - public void addRefToYangFilesImportList(Set<YangFileInfo> yangFileInfoSet) throws LinkerException { 111 + public void addRefToYangFilesImportList(Set<YangNode> yangNodeSet) throws LinkerException {
115 - for (YangFileInfo yangFileInfo : yangFileInfoSet) { 112 + for (YangNode yangNode : yangNodeSet) {
116 - YangNode yangNode = yangFileInfo.getRootNode();
117 if (yangNode instanceof YangReferenceResolver) { 113 if (yangNode instanceof YangReferenceResolver) {
118 try { 114 try {
119 ((YangReferenceResolver) yangNode).addReferencesToImportList(getYangNodeSet()); 115 ((YangReferenceResolver) yangNode).addReferencesToImportList(getYangNodeSet());
120 } catch (DataModelException e) { 116 } catch (DataModelException e) {
121 - String errorInfo = "Error in file: " + yangFileInfo.getYangFileName() + " at line: " 117 + String errorInfo = "Error in file: " + yangNode.getName() + " at line: "
122 + e.getLineNumber() + " at position: " + e.getCharPositionInLine() + NEW_LINE 118 + e.getLineNumber() + " at position: " + e.getCharPositionInLine() + NEW_LINE
123 + e.getMessage(); 119 + e.getMessage();
124 throw new LinkerException(errorInfo); 120 throw new LinkerException(errorInfo);
121 + // TODO add file path in exception message in util manager.
125 } 122 }
126 } 123 }
127 } 124 }
...@@ -130,20 +127,20 @@ public class YangLinkerManager ...@@ -130,20 +127,20 @@ public class YangLinkerManager
130 /** 127 /**
131 * Adds included node information to the include list. 128 * Adds included node information to the include list.
132 * 129 *
133 - * @param yangFileInfoSet set of YANG files info 130 + * @param yangNodeSet set of YANG files info
134 * @throws LinkerException fails to find included sub-module 131 * @throws LinkerException fails to find included sub-module
135 */ 132 */
136 - public void addRefToYangFilesIncludeList(Set<YangFileInfo> yangFileInfoSet) throws LinkerException { 133 + public void addRefToYangFilesIncludeList(Set<YangNode> yangNodeSet) throws LinkerException {
137 - for (YangFileInfo yangFileInfo : yangFileInfoSet) { 134 + for (YangNode yangNode : yangNodeSet) {
138 - YangNode yangNode = yangFileInfo.getRootNode();
139 if (yangNode instanceof YangReferenceResolver) { 135 if (yangNode instanceof YangReferenceResolver) {
140 try { 136 try {
141 ((YangReferenceResolver) yangNode).addReferencesToIncludeList(getYangNodeSet()); 137 ((YangReferenceResolver) yangNode).addReferencesToIncludeList(getYangNodeSet());
142 } catch (DataModelException e) { 138 } catch (DataModelException e) {
143 - String errorInfo = "Error in file: " + yangFileInfo.getYangFileName() + " at line: " 139 + String errorInfo = "Error in file: " + yangNode.getName() + " at line: "
144 + e.getLineNumber() + " at position: " + e.getCharPositionInLine() + NEW_LINE 140 + e.getLineNumber() + " at position: " + e.getCharPositionInLine() + NEW_LINE
145 + e.getMessage(); 141 + e.getMessage();
146 throw new LinkerException(errorInfo); 142 throw new LinkerException(errorInfo);
143 + // TODO add file path in exception message in util manager.
147 } 144 }
148 } 145 }
149 } 146 }
...@@ -152,20 +149,21 @@ public class YangLinkerManager ...@@ -152,20 +149,21 @@ public class YangLinkerManager
152 /** 149 /**
153 * Processes inter file linking for type and uses. 150 * Processes inter file linking for type and uses.
154 * 151 *
155 - * @param yangFileInfoSet set of YANG files info 152 + * @param yangNodeSet set of YANG files info
156 * @throws LinkerException a violation in linker execution 153 * @throws LinkerException a violation in linker execution
157 */ 154 */
158 - public void processInterFileLinking(Set<YangFileInfo> yangFileInfoSet) 155 + public void processInterFileLinking(Set<YangNode> yangNodeSet)
159 throws LinkerException { 156 throws LinkerException {
160 - for (YangFileInfo yangFileInfo : yangFileInfoSet) { 157 + for (YangNode yangNode : yangNodeSet) {
161 try { 158 try {
162 - ((YangReferenceResolver) yangFileInfo.getRootNode()).resolveInterFileLinking(ResolvableType.YANG_USES); 159 + ((YangReferenceResolver) yangNode).resolveInterFileLinking(ResolvableType.YANG_USES);
163 - ((YangReferenceResolver) yangFileInfo.getRootNode()) 160 + ((YangReferenceResolver) yangNode)
164 .resolveInterFileLinking(ResolvableType.YANG_DERIVED_DATA_TYPE); 161 .resolveInterFileLinking(ResolvableType.YANG_DERIVED_DATA_TYPE);
165 } catch (DataModelException e) { 162 } catch (DataModelException e) {
166 - String errorInfo = "Error in file: " + yangFileInfo.getYangFileName() + " at line: " 163 + String errorInfo = "Error in file: " + yangNode.getName() + " at line: "
167 + e.getLineNumber() + " at position: " + e.getCharPositionInLine() + NEW_LINE + e.getMessage(); 164 + e.getLineNumber() + " at position: " + e.getCharPositionInLine() + NEW_LINE + e.getMessage();
168 throw new LinkerException(errorInfo); 165 throw new LinkerException(errorInfo);
166 + // TODO add file path in exception message in util manager.
169 } 167 }
170 } 168 }
171 } 169 }
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
17 package org.onosproject.yangutils.parser.impl; 17 package org.onosproject.yangutils.parser.impl;
18 18
19 import java.io.IOException; 19 import java.io.IOException;
20 -
21 import org.antlr.v4.runtime.ANTLRFileStream; 20 import org.antlr.v4.runtime.ANTLRFileStream;
22 import org.antlr.v4.runtime.ANTLRInputStream; 21 import org.antlr.v4.runtime.ANTLRInputStream;
23 import org.antlr.v4.runtime.CommonTokenStream; 22 import org.antlr.v4.runtime.CommonTokenStream;
...@@ -101,4 +100,4 @@ public class YangUtilsParserManager implements YangUtilsParser { ...@@ -101,4 +100,4 @@ public class YangUtilsParserManager implements YangUtilsParser {
101 // Returns the Root Node of the constructed data model tree. 100 // Returns the Root Node of the constructed data model tree.
102 return treeWalker.getRootNode(); 101 return treeWalker.getRootNode();
103 } 102 }
104 -}
...\ No newline at end of file ...\ No newline at end of file
103 +}
......
...@@ -31,7 +31,7 @@ import org.onosproject.yangutils.parser.exceptions.ParserException; ...@@ -31,7 +31,7 @@ import org.onosproject.yangutils.parser.exceptions.ParserException;
31 import org.onosproject.yangutils.parser.impl.TreeWalkListener; 31 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
32 32
33 import static org.onosproject.yangutils.datamodel.utils.YangConstructType.AUGMENT_DATA; 33 import static org.onosproject.yangutils.datamodel.utils.YangConstructType.AUGMENT_DATA;
34 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; 34 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
35 35
36 /** 36 /**
37 * Represents a utility which provides listener utilities augment node. 37 * Represents a utility which provides listener utilities augment node.
......
...@@ -21,7 +21,6 @@ import java.util.HashSet; ...@@ -21,7 +21,6 @@ import java.util.HashSet;
21 import java.util.Iterator; 21 import java.util.Iterator;
22 import java.util.List; 22 import java.util.List;
23 import java.util.Set; 23 import java.util.Set;
24 -
25 import org.apache.maven.artifact.repository.ArtifactRepository; 24 import org.apache.maven.artifact.repository.ArtifactRepository;
26 import org.apache.maven.plugin.AbstractMojo; 25 import org.apache.maven.plugin.AbstractMojo;
27 import org.apache.maven.plugin.MojoExecutionException; 26 import org.apache.maven.plugin.MojoExecutionException;
...@@ -37,25 +36,25 @@ import org.onosproject.yangutils.linker.impl.YangLinkerManager; ...@@ -37,25 +36,25 @@ import org.onosproject.yangutils.linker.impl.YangLinkerManager;
37 import org.onosproject.yangutils.parser.YangUtilsParser; 36 import org.onosproject.yangutils.parser.YangUtilsParser;
38 import org.onosproject.yangutils.parser.exceptions.ParserException; 37 import org.onosproject.yangutils.parser.exceptions.ParserException;
39 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; 38 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
40 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
41 -import org.onosproject.yangutils.translator.tojava.utils.YangToJavaNamingConflictUtil;
42 import org.onosproject.yangutils.utils.io.impl.YangFileScanner; 39 import org.onosproject.yangutils.utils.io.impl.YangFileScanner;
40 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
41 +import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
43 import org.sonatype.plexus.build.incremental.BuildContext; 42 import org.sonatype.plexus.build.incremental.BuildContext;
44 43
45 import static org.apache.maven.plugins.annotations.LifecyclePhase.GENERATE_SOURCES; 44 import static org.apache.maven.plugins.annotations.LifecyclePhase.GENERATE_SOURCES;
46 import static org.apache.maven.plugins.annotations.ResolutionScope.COMPILE; 45 import static org.apache.maven.plugins.annotations.ResolutionScope.COMPILE;
46 +import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.addToCompilationRoot;
47 +import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.copyYangFilesToTarget;
48 +import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.resolveInterJarDependencies;
49 +import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.serializeDataModel;
47 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; 50 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode;
48 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.translatorErrorHandler; 51 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.translatorErrorHandler;
49 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
50 import static org.onosproject.yangutils.utils.UtilConstants.DEFAULT_BASE_PKG; 52 import static org.onosproject.yangutils.utils.UtilConstants.DEFAULT_BASE_PKG;
51 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE; 53 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
52 import static org.onosproject.yangutils.utils.UtilConstants.SLASH; 54 import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
53 -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.addToCompilationRoot;
54 -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.copyYangFilesToTarget;
55 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; 55 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
56 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getDirectory; 56 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getDirectory;
57 -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.resolveInterJarDependencies; 57 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getPackageDirPathFromJavaJPackage;
58 -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.serializeDataModel;
59 58
60 /** 59 /**
61 * Represents ONOS YANG utility maven plugin. 60 * Represents ONOS YANG utility maven plugin.
...@@ -64,7 +63,7 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.serializeDataM ...@@ -64,7 +63,7 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.serializeDataM
64 * requiresDependencyResolution at compile time. 63 * requiresDependencyResolution at compile time.
65 */ 64 */
66 @Mojo(name = "yang2java", defaultPhase = GENERATE_SOURCES, requiresDependencyResolution = COMPILE, 65 @Mojo(name = "yang2java", defaultPhase = GENERATE_SOURCES, requiresDependencyResolution = COMPILE,
67 - requiresProject = true) 66 + requiresProject = true)
68 public class YangUtilManager 67 public class YangUtilManager
69 extends AbstractMojo { 68 extends AbstractMojo {
70 69
...@@ -75,6 +74,8 @@ public class YangUtilManager ...@@ -75,6 +74,8 @@ public class YangUtilManager
75 private YangLinker yangLinker = new YangLinkerManager(); 74 private YangLinker yangLinker = new YangLinkerManager();
76 private YangFileInfo curYangFileInfo = new YangFileInfo(); 75 private YangFileInfo curYangFileInfo = new YangFileInfo();
77 76
77 + private Set<YangNode> yangNodeSet = new HashSet<>();
78 +
78 private static final String DEFAULT_PKG = SLASH + getPackageDirPathFromJavaJPackage(DEFAULT_BASE_PKG); 79 private static final String DEFAULT_PKG = SLASH + getPackageDirPathFromJavaJPackage(DEFAULT_BASE_PKG);
79 80
80 /** 81 /**
...@@ -217,6 +218,15 @@ public class YangUtilManager ...@@ -217,6 +218,15 @@ public class YangUtilManager
217 } 218 }
218 219
219 /** 220 /**
221 + * Returns the YANG node set.
222 + *
223 + * @return YANG node set
224 + */
225 + public Set<YangNode> getYangNodeSet() {
226 + return yangNodeSet;
227 + }
228 +
229 + /**
220 * Resolved inter-jar dependencies. 230 * Resolved inter-jar dependencies.
221 * 231 *
222 * @throws IOException when fails to do IO operations 232 * @throws IOException when fails to do IO operations
...@@ -244,10 +254,11 @@ public class YangUtilManager ...@@ -244,10 +254,11 @@ public class YangUtilManager
244 */ 254 */
245 public void resolveDependenciesUsingLinker() 255 public void resolveDependenciesUsingLinker()
246 throws MojoExecutionException { 256 throws MojoExecutionException {
257 + createYangNodeSet();
247 for (YangFileInfo yangFileInfo : getYangFileInfoSet()) { 258 for (YangFileInfo yangFileInfo : getYangFileInfoSet()) {
248 setCurYangFileInfo(yangFileInfo); 259 setCurYangFileInfo(yangFileInfo);
249 try { 260 try {
250 - yangLinker.resolveDependencies(getYangFileInfoSet()); 261 + yangLinker.resolveDependencies(getYangNodeSet());
251 } catch (LinkerException e) { 262 } catch (LinkerException e) {
252 throw new MojoExecutionException(e.getMessage()); 263 throw new MojoExecutionException(e.getMessage());
253 } 264 }
...@@ -255,6 +266,15 @@ public class YangUtilManager ...@@ -255,6 +266,15 @@ public class YangUtilManager
255 } 266 }
256 267
257 /** 268 /**
269 + * Creates YANG nodes set.
270 + */
271 + public void createYangNodeSet() {
272 + for (YangFileInfo yangFileInfo : getYangFileInfoSet()) {
273 + getYangNodeSet().add(yangFileInfo.getRootNode());
274 + }
275 + }
276 +
277 + /**
258 * Parses all the provided YANG files and generates YANG data model tree. 278 * Parses all the provided YANG files and generates YANG data model tree.
259 * 279 *
260 * @throws IOException a violation in IO 280 * @throws IOException a violation in IO
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
17 package org.onosproject.yangutils.translator.tojava; 17 package org.onosproject.yangutils.translator.tojava;
18 18
19 import org.onosproject.yangutils.translator.exception.TranslatorException; 19 import org.onosproject.yangutils.translator.exception.TranslatorException;
20 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 20 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
21 21
22 /** 22 /**
23 * Abstraction of an entity which provides Code generator functionalities. 23 * Abstraction of an entity which provides Code generator functionalities.
......
...@@ -14,10 +14,7 @@ ...@@ -14,10 +14,7 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -package org.onosproject.yangutils.translator.tojava.javamodel; 17 +package org.onosproject.yangutils.translator.tojava;
18 -
19 -import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
20 -import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer;
21 18
22 /** 19 /**
23 * Represents YANG java info containing interface for java code generator, java 20 * Represents YANG java info containing interface for java code generator, java
......
...@@ -20,7 +20,7 @@ import java.io.IOException; ...@@ -20,7 +20,7 @@ import java.io.IOException;
20 20
21 import org.onosproject.yangutils.datamodel.YangNode; 21 import org.onosproject.yangutils.datamodel.YangNode;
22 import org.onosproject.yangutils.translator.exception.TranslatorException; 22 import org.onosproject.yangutils.translator.exception.TranslatorException;
23 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 23 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
24 24
25 import static org.onosproject.yangutils.translator.tojava.TraversalType.CHILD; 25 import static org.onosproject.yangutils.translator.tojava.TraversalType.CHILD;
26 import static org.onosproject.yangutils.translator.tojava.TraversalType.PARENT; 26 import static org.onosproject.yangutils.translator.tojava.TraversalType.PARENT;
......
...@@ -18,7 +18,7 @@ package org.onosproject.yangutils.translator.tojava; ...@@ -18,7 +18,7 @@ package org.onosproject.yangutils.translator.tojava;
18 18
19 import java.io.Serializable; 19 import java.io.Serializable;
20 20
21 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 21 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
22 22
23 /** 23 /**
24 * Represents cached java file handle, which supports the addition of member attributes and 24 * Represents cached java file handle, which supports the addition of member attributes and
......
...@@ -22,13 +22,13 @@ import java.util.Objects; ...@@ -22,13 +22,13 @@ import java.util.Objects;
22 import org.onosproject.yangutils.datamodel.YangNode; 22 import org.onosproject.yangutils.datamodel.YangNode;
23 import org.onosproject.yangutils.translator.exception.TranslatorException; 23 import org.onosproject.yangutils.translator.exception.TranslatorException;
24 import org.onosproject.yangutils.translator.tojava.javamodel.JavaLeafInfoContainer; 24 import org.onosproject.yangutils.translator.tojava.javamodel.JavaLeafInfoContainer;
25 -import org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType; 25 +import org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType;
26 -import org.onosproject.yangutils.translator.tojava.utils.YangToJavaNamingConflictUtil; 26 +import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
27 27
28 import com.google.common.base.MoreObjects; 28 import com.google.common.base.MoreObjects;
29 29
30 -import static org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType.getJavaImportClass; 30 +import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaImportClass;
31 -import static org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType.getJavaImportPackage; 31 +import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaImportPackage;
32 32
33 /** 33 /**
34 * Represents the information about individual imports in the generated file. 34 * Represents the information about individual imports in the generated file.
......
...@@ -19,7 +19,7 @@ package org.onosproject.yangutils.translator.tojava; ...@@ -19,7 +19,7 @@ package org.onosproject.yangutils.translator.tojava;
19 import java.io.File; 19 import java.io.File;
20 import java.io.IOException; 20 import java.io.IOException;
21 21
22 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 22 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
23 23
24 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.CONSTRUCTOR_IMPL_MASK; 24 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.CONSTRUCTOR_IMPL_MASK;
25 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getConstructor; 25 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getConstructor;
......
...@@ -21,7 +21,7 @@ import java.io.IOException; ...@@ -21,7 +21,7 @@ import java.io.IOException;
21 import org.onosproject.yangutils.datamodel.YangNode; 21 import org.onosproject.yangutils.datamodel.YangNode;
22 import org.onosproject.yangutils.datamodel.YangTypeHolder; 22 import org.onosproject.yangutils.datamodel.YangTypeHolder;
23 import org.onosproject.yangutils.translator.exception.TranslatorException; 23 import org.onosproject.yangutils.translator.exception.TranslatorException;
24 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 24 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
25 25
26 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ENUM_CLASS; 26 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ENUM_CLASS;
27 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; 27 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
......
...@@ -28,19 +28,19 @@ import org.onosproject.yangutils.datamodel.YangEnumeration; ...@@ -28,19 +28,19 @@ import org.onosproject.yangutils.datamodel.YangEnumeration;
28 import org.onosproject.yangutils.datamodel.YangNode; 28 import org.onosproject.yangutils.datamodel.YangNode;
29 import org.onosproject.yangutils.translator.exception.TranslatorException; 29 import org.onosproject.yangutils.translator.exception.TranslatorException;
30 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaType; 30 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaType;
31 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 31 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
32 32
33 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.ENUM_IMPL_MASK; 33 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.ENUM_IMPL_MASK;
34 import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; 34 import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData;
35 import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.generateEnumAttributeString; 35 import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.generateEnumAttributeString;
36 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateEnumClassFile; 36 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateEnumClassFile;
37 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getEnumJavaAttribute; 37 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getEnumJavaAttribute;
38 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPrefixForIdentifier; 38 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getPrefixForIdentifier;
39 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.closeFile; 39 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.closeFile;
40 import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING; 40 import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
41 import static org.onosproject.yangutils.utils.UtilConstants.REGEX_FOR_FIRST_DIGIT; 41 import static org.onosproject.yangutils.utils.UtilConstants.REGEX_FOR_FIRST_DIGIT;
42 import static org.onosproject.yangutils.utils.UtilConstants.YANG_AUTO_PREFIX; 42 import static org.onosproject.yangutils.utils.UtilConstants.YANG_AUTO_PREFIX;
43 -import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage; 43 +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.createPackage;
44 44
45 /** 45 /**
46 * Represents implementation of java code fragments temporary implementations. 46 * Represents implementation of java code fragments temporary implementations.
......
...@@ -33,7 +33,7 @@ import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaGrouping; ...@@ -33,7 +33,7 @@ import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaGrouping;
33 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule; 33 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
34 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule; 34 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule;
35 import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; 35 import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder;
36 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 36 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
37 37
38 import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode; 38 import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode;
39 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; 39 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK;
...@@ -55,7 +55,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. ...@@ -55,7 +55,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.
55 import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; 55 import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData;
56 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedInfoOfFromString; 56 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedInfoOfFromString;
57 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode; 57 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode;
58 -import static org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType.updateJavaFileInfo; 58 +import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.updateJavaFileInfo;
59 import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaAttributeDefination; 59 import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaAttributeDefination;
60 import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaClassDefClose; 60 import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaClassDefClose;
61 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateBuilderClassFile; 61 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateBuilderClassFile;
...@@ -63,9 +63,9 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerato ...@@ -63,9 +63,9 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerato
63 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateImplClassFile; 63 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateImplClassFile;
64 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateInterfaceFile; 64 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateInterfaceFile;
65 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getFileObject; 65 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getFileObject;
66 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; 66 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase;
67 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; 67 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
68 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage; 68 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getPackageDirPathFromJavaJPackage;
69 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage; 69 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
70 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuildString; 70 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuildString;
71 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getDefaultConstructorString; 71 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getDefaultConstructorString;
...@@ -104,7 +104,7 @@ import static org.onosproject.yangutils.utils.UtilConstants.REFERENCE_CARDINALIT ...@@ -104,7 +104,7 @@ import static org.onosproject.yangutils.utils.UtilConstants.REFERENCE_CARDINALIT
104 import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN; 104 import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN;
105 import static org.onosproject.yangutils.utils.UtilConstants.SERVICE; 105 import static org.onosproject.yangutils.utils.UtilConstants.SERVICE;
106 import static org.onosproject.yangutils.utils.UtilConstants.SLASH; 106 import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
107 -import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage; 107 +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.createPackage;
108 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.readAppendFile; 108 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.readAppendFile;
109 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc; 109 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
110 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.GETTER_METHOD; 110 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.GETTER_METHOD;
......
...@@ -25,7 +25,7 @@ import org.onosproject.yangutils.datamodel.YangNode; ...@@ -25,7 +25,7 @@ import org.onosproject.yangutils.datamodel.YangNode;
25 import org.onosproject.yangutils.datamodel.YangNotification; 25 import org.onosproject.yangutils.datamodel.YangNotification;
26 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule; 26 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
27 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule; 27 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule;
28 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 28 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
29 29
30 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_CLASS; 30 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_CLASS;
31 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_LISTENER_INTERFACE; 31 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_LISTENER_INTERFACE;
...@@ -46,10 +46,10 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerato ...@@ -46,10 +46,10 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerato
46 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateManagerClassFile; 46 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateManagerClassFile;
47 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateServiceInterfaceFile; 47 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateServiceInterfaceFile;
48 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getFileObject; 48 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getFileObject;
49 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; 49 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase;
50 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; 50 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
51 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getEnumJavaAttribute; 51 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getEnumJavaAttribute;
52 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase; 52 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getSmallCase;
53 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getGetterForClass; 53 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getGetterForClass;
54 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getRpcManagerMethod; 54 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getRpcManagerMethod;
55 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getRpcServiceMethod; 55 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getRpcServiceMethod;
...@@ -67,7 +67,7 @@ import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE; ...@@ -67,7 +67,7 @@ import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
67 import static org.onosproject.yangutils.utils.UtilConstants.RPC_INPUT_VAR_NAME; 67 import static org.onosproject.yangutils.utils.UtilConstants.RPC_INPUT_VAR_NAME;
68 import static org.onosproject.yangutils.utils.UtilConstants.SLASH; 68 import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
69 import static org.onosproject.yangutils.utils.UtilConstants.VOID; 69 import static org.onosproject.yangutils.utils.UtilConstants.VOID;
70 -import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage; 70 +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.createPackage;
71 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.generateJavaDocForRpc; 71 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.generateJavaDocForRpc;
72 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc; 72 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
73 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.ENUM_ATTRIBUTE; 73 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.ENUM_ATTRIBUTE;
......
...@@ -26,7 +26,7 @@ import org.onosproject.yangutils.datamodel.YangType; ...@@ -26,7 +26,7 @@ import org.onosproject.yangutils.datamodel.YangType;
26 import org.onosproject.yangutils.datamodel.YangTypeHolder; 26 import org.onosproject.yangutils.datamodel.YangTypeHolder;
27 import org.onosproject.yangutils.translator.exception.TranslatorException; 27 import org.onosproject.yangutils.translator.exception.TranslatorException;
28 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaType; 28 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaType;
29 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 29 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
30 30
31 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_TYPEDEF_CLASS; 31 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_TYPEDEF_CLASS;
32 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS; 32 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS;
...@@ -36,13 +36,13 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. ...@@ -36,13 +36,13 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.
36 import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; 36 import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData;
37 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateTypeDefClassFile; 37 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateTypeDefClassFile;
38 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateUnionClassFile; 38 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateUnionClassFile;
39 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; 39 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase;
40 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getOfMethodStringAndJavaDoc; 40 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getOfMethodStringAndJavaDoc;
41 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getTypeConstructorStringAndJavaDoc; 41 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getTypeConstructorStringAndJavaDoc;
42 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.closeFile; 42 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.closeFile;
43 import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING; 43 import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
44 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE; 44 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
45 -import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage; 45 +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.createPackage;
46 46
47 /** 47 /**
48 * Represents implementation of java data type code fragments temporary implementations. 48 * Represents implementation of java data type code fragments temporary implementations.
......
...@@ -14,10 +14,9 @@ ...@@ -14,10 +14,9 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -package org.onosproject.yangutils.translator.tojava.utils; 17 +package org.onosproject.yangutils.translator.tojava.javamodel;
18 18
19 import java.util.Stack; 19 import java.util.Stack;
20 -
21 import org.onosproject.yangutils.datamodel.YangDataTypes; 20 import org.onosproject.yangutils.datamodel.YangDataTypes;
22 import org.onosproject.yangutils.datamodel.YangDerivedInfo; 21 import org.onosproject.yangutils.datamodel.YangDerivedInfo;
23 import org.onosproject.yangutils.datamodel.YangEnumeration; 22 import org.onosproject.yangutils.datamodel.YangEnumeration;
...@@ -26,48 +25,35 @@ import org.onosproject.yangutils.datamodel.YangType; ...@@ -26,48 +25,35 @@ import org.onosproject.yangutils.datamodel.YangType;
26 import org.onosproject.yangutils.datamodel.YangTypeDef; 25 import org.onosproject.yangutils.datamodel.YangTypeDef;
27 import org.onosproject.yangutils.datamodel.YangUnion; 26 import org.onosproject.yangutils.datamodel.YangUnion;
28 import org.onosproject.yangutils.translator.exception.TranslatorException; 27 import org.onosproject.yangutils.translator.exception.TranslatorException;
28 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
29 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 29 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
30 import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; 30 import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
31 -import org.onosproject.yangutils.translator.tojava.javamodel.JavaCodeGeneratorInfo; 31 +import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
32 -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration;
33 -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
34 -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule;
35 -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeDef;
36 -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaUnion;
37 32
38 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; 33 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.getCurNodePackage;
39 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase;
40 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCurNodePackage;
41 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
42 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage; 34 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
43 import static org.onosproject.yangutils.utils.UtilConstants.BIG_INTEGER; 35 import static org.onosproject.yangutils.utils.UtilConstants.BIG_INTEGER;
44 import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_DATA_TYPE; 36 import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_DATA_TYPE;
45 import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_WRAPPER; 37 import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_WRAPPER;
46 import static org.onosproject.yangutils.utils.UtilConstants.BYTE; 38 import static org.onosproject.yangutils.utils.UtilConstants.BYTE;
47 import static org.onosproject.yangutils.utils.UtilConstants.BYTE_WRAPPER; 39 import static org.onosproject.yangutils.utils.UtilConstants.BYTE_WRAPPER;
48 -import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
49 -import static org.onosproject.yangutils.utils.UtilConstants.FROM_STRING_METHOD_NAME;
50 import static org.onosproject.yangutils.utils.UtilConstants.INT; 40 import static org.onosproject.yangutils.utils.UtilConstants.INT;
51 import static org.onosproject.yangutils.utils.UtilConstants.INTEGER_WRAPPER; 41 import static org.onosproject.yangutils.utils.UtilConstants.INTEGER_WRAPPER;
52 import static org.onosproject.yangutils.utils.UtilConstants.JAVA_LANG; 42 import static org.onosproject.yangutils.utils.UtilConstants.JAVA_LANG;
53 import static org.onosproject.yangutils.utils.UtilConstants.JAVA_MATH; 43 import static org.onosproject.yangutils.utils.UtilConstants.JAVA_MATH;
54 import static org.onosproject.yangutils.utils.UtilConstants.LONG; 44 import static org.onosproject.yangutils.utils.UtilConstants.LONG;
55 import static org.onosproject.yangutils.utils.UtilConstants.LONG_WRAPPER; 45 import static org.onosproject.yangutils.utils.UtilConstants.LONG_WRAPPER;
56 -import static org.onosproject.yangutils.utils.UtilConstants.NEW;
57 -import static org.onosproject.yangutils.utils.UtilConstants.PARSE_BOOLEAN;
58 -import static org.onosproject.yangutils.utils.UtilConstants.PARSE_BYTE;
59 -import static org.onosproject.yangutils.utils.UtilConstants.PARSE_INT;
60 -import static org.onosproject.yangutils.utils.UtilConstants.PARSE_LONG;
61 -import static org.onosproject.yangutils.utils.UtilConstants.PARSE_SHORT;
62 import static org.onosproject.yangutils.utils.UtilConstants.PERIOD; 46 import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
63 import static org.onosproject.yangutils.utils.UtilConstants.SHORT; 47 import static org.onosproject.yangutils.utils.UtilConstants.SHORT;
64 import static org.onosproject.yangutils.utils.UtilConstants.SHORT_WRAPPER; 48 import static org.onosproject.yangutils.utils.UtilConstants.SHORT_WRAPPER;
65 -import static org.onosproject.yangutils.utils.UtilConstants.SPACE;
66 import static org.onosproject.yangutils.utils.UtilConstants.STRING_DATA_TYPE; 49 import static org.onosproject.yangutils.utils.UtilConstants.STRING_DATA_TYPE;
67 import static org.onosproject.yangutils.utils.UtilConstants.YANG_BINARY_CLASS; 50 import static org.onosproject.yangutils.utils.UtilConstants.YANG_BINARY_CLASS;
68 import static org.onosproject.yangutils.utils.UtilConstants.YANG_BITS_CLASS; 51 import static org.onosproject.yangutils.utils.UtilConstants.YANG_BITS_CLASS;
69 import static org.onosproject.yangutils.utils.UtilConstants.YANG_DECIMAL64_CLASS; 52 import static org.onosproject.yangutils.utils.UtilConstants.YANG_DECIMAL64_CLASS;
70 import static org.onosproject.yangutils.utils.UtilConstants.YANG_TYPES_PKG; 53 import static org.onosproject.yangutils.utils.UtilConstants.YANG_TYPES_PKG;
54 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase;
55 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
56 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getPackageDirPathFromJavaJPackage;
71 57
72 /** 58 /**
73 * Represents java data types info corresponding to YANG type. 59 * Represents java data types info corresponding to YANG type.
...@@ -121,51 +107,6 @@ public final class AttributesJavaDataType { ...@@ -121,51 +107,6 @@ public final class AttributesJavaDataType {
121 } 107 }
122 108
123 /** 109 /**
124 - * Returns from string method parsed string.
125 - *
126 - * @param targetDataType target data type
127 - * @param yangType YANG type
128 - * @return parsed string
129 - */
130 - public static String getParseFromStringMethod(String targetDataType, YangType<?> yangType) {
131 -
132 - YangDataTypes type = yangType.getDataType();
133 -
134 - switch (type) {
135 - case INT8:
136 - return BYTE_WRAPPER + PERIOD + PARSE_BYTE;
137 - case INT16:
138 - return SHORT_WRAPPER + PERIOD + PARSE_SHORT;
139 - case INT32:
140 - return INTEGER_WRAPPER + PERIOD + PARSE_INT;
141 - case INT64:
142 - return LONG_WRAPPER + PERIOD + PARSE_LONG;
143 - case UINT8:
144 - return SHORT_WRAPPER + PERIOD + PARSE_SHORT;
145 - case UINT16:
146 - return INTEGER_WRAPPER + PERIOD + PARSE_INT;
147 - case UINT32:
148 - return LONG_WRAPPER + PERIOD + PARSE_LONG;
149 - case UINT64:
150 - return NEW + SPACE + BIG_INTEGER;
151 - case STRING:
152 - return EMPTY_STRING;
153 - case EMPTY:
154 - case BOOLEAN:
155 - return BOOLEAN_WRAPPER + PERIOD + PARSE_BOOLEAN;
156 - case DECIMAL64:
157 - case BITS:
158 - case BINARY:
159 - case UNION:
160 - case ENUMERATION:
161 - case DERIVED:
162 - return targetDataType + PERIOD + FROM_STRING_METHOD_NAME;
163 - default:
164 - throw new TranslatorException("given data type is not supported.");
165 - }
166 - }
167 -
168 - /**
169 * Returns java import class. 110 * Returns java import class.
170 * 111 *
171 * @param yangType YANG type 112 * @param yangType YANG type
...@@ -174,7 +115,7 @@ public final class AttributesJavaDataType { ...@@ -174,7 +115,7 @@ public final class AttributesJavaDataType {
174 * @return java import class 115 * @return java import class
175 */ 116 */
176 public static String getJavaImportClass(YangType<?> yangType, boolean isListAttr, 117 public static String getJavaImportClass(YangType<?> yangType, boolean isListAttr,
177 - YangToJavaNamingConflictUtil pluginConfig) { 118 + YangToJavaNamingConflictUtil pluginConfig) {
178 119
179 YangDataTypes type = yangType.getDataType(); 120 YangDataTypes type = yangType.getDataType();
180 121
...@@ -279,7 +220,7 @@ public final class AttributesJavaDataType { ...@@ -279,7 +220,7 @@ public final class AttributesJavaDataType {
279 * @return java import package 220 * @return java import package
280 */ 221 */
281 public static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr, 222 public static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr,
282 - YangToJavaNamingConflictUtil conflictResolver) { 223 + YangToJavaNamingConflictUtil conflictResolver) {
283 224
284 YangDataTypes type = yangType.getDataType(); 225 YangDataTypes type = yangType.getDataType();
285 226
...@@ -425,7 +366,7 @@ public final class AttributesJavaDataType { ...@@ -425,7 +366,7 @@ public final class AttributesJavaDataType {
425 * @return java package from parent node 366 * @return java package from parent node
426 */ 367 */
427 private static String getPackageFromParent(YangNode parent, 368 private static String getPackageFromParent(YangNode parent,
428 - YangToJavaNamingConflictUtil conflictResolver) { 369 + YangToJavaNamingConflictUtil conflictResolver) {
429 if (!(parent instanceof JavaFileInfoContainer)) { 370 if (!(parent instanceof JavaFileInfoContainer)) {
430 throw new TranslatorException("invalid child node is being processed."); 371 throw new TranslatorException("invalid child node is being processed.");
431 } 372 }
...@@ -444,7 +385,7 @@ public final class AttributesJavaDataType { ...@@ -444,7 +385,7 @@ public final class AttributesJavaDataType {
444 * @param conflictResolver yang plugin config 385 * @param conflictResolver yang plugin config
445 */ 386 */
446 public static void updateJavaFileInfo(YangNode yangNode, 387 public static void updateJavaFileInfo(YangNode yangNode,
447 - YangToJavaNamingConflictUtil conflictResolver) { 388 + YangToJavaNamingConflictUtil conflictResolver) {
448 Stack<YangNode> nodesToUpdatePackage = new Stack<YangNode>(); 389 Stack<YangNode> nodesToUpdatePackage = new Stack<YangNode>();
449 390
450 /* 391 /*
......
...@@ -17,7 +17,7 @@ package org.onosproject.yangutils.translator.tojava.javamodel; ...@@ -17,7 +17,7 @@ package org.onosproject.yangutils.translator.tojava.javamodel;
17 17
18 import org.onosproject.yangutils.datamodel.YangType; 18 import org.onosproject.yangutils.datamodel.YangType;
19 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoContainer; 19 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoContainer;
20 -import org.onosproject.yangutils.translator.tojava.utils.YangToJavaNamingConflictUtil; 20 +import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
21 21
22 /** 22 /**
23 * Represent java based identification of the YANG leaves. 23 * Represent java based identification of the YANG leaves.
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
16 package org.onosproject.yangutils.translator.tojava.javamodel; 16 package org.onosproject.yangutils.translator.tojava.javamodel;
17 17
18 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoContainer; 18 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoContainer;
19 -import org.onosproject.yangutils.translator.tojava.utils.YangToJavaNamingConflictUtil; 19 +import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
20 20
21 /** 21 /**
22 * Represent java based identification of the YANG leaves. 22 * Represent java based identification of the YANG leaves.
......
...@@ -20,12 +20,13 @@ import java.io.IOException; ...@@ -20,12 +20,13 @@ import java.io.IOException;
20 import org.onosproject.yangutils.datamodel.YangAugment; 20 import org.onosproject.yangutils.datamodel.YangAugment;
21 import org.onosproject.yangutils.translator.exception.TranslatorException; 21 import org.onosproject.yangutils.translator.exception.TranslatorException;
22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
23 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
23 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 24 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
24 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
25 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 26 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
26 27
27 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; 28 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
28 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfAugmentableNode; 29 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeOfAugmentableNode;
29 30
30 /** 31 /**
31 * Represents augment information extended to support java code generation. 32 * Represents augment information extended to support java code generation.
......
...@@ -20,12 +20,13 @@ import java.io.IOException; ...@@ -20,12 +20,13 @@ import java.io.IOException;
20 import org.onosproject.yangutils.datamodel.YangCase; 20 import org.onosproject.yangutils.datamodel.YangCase;
21 import org.onosproject.yangutils.translator.exception.TranslatorException; 21 import org.onosproject.yangutils.translator.exception.TranslatorException;
22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
23 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
23 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 24 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
24 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
25 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 26 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
26 27
27 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; 28 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
28 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfAugmentableNode; 29 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeOfAugmentableNode;
29 30
30 /** 31 /**
31 * Represents case information extended to support java code generation. 32 * Represents case information extended to support java code generation.
......
...@@ -20,12 +20,13 @@ import java.io.IOException; ...@@ -20,12 +20,13 @@ import java.io.IOException;
20 import org.onosproject.yangutils.datamodel.YangChoice; 20 import org.onosproject.yangutils.datamodel.YangChoice;
21 import org.onosproject.yangutils.translator.exception.TranslatorException; 21 import org.onosproject.yangutils.translator.exception.TranslatorException;
22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
23 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
23 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 24 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
24 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
25 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 26 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
26 27
27 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.INTERFACE_MASK; 28 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.INTERFACE_MASK;
28 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeAndUpdateInParent; 29 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeAndUpdateInParent;
29 30
30 /** 31 /**
31 * Represents choice information extended to support java code generation. 32 * Represents choice information extended to support java code generation.
......
...@@ -20,12 +20,13 @@ import java.io.IOException; ...@@ -20,12 +20,13 @@ import java.io.IOException;
20 import org.onosproject.yangutils.datamodel.YangContainer; 20 import org.onosproject.yangutils.datamodel.YangContainer;
21 import org.onosproject.yangutils.translator.exception.TranslatorException; 21 import org.onosproject.yangutils.translator.exception.TranslatorException;
22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
23 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
23 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 24 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
24 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
25 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 26 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
26 27
27 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; 28 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
28 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeAndUpdateInParent; 29 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeAndUpdateInParent;
29 30
30 /** 31 /**
31 * Represents container information extended to support java code generation. 32 * Represents container information extended to support java code generation.
......
...@@ -21,12 +21,13 @@ import java.io.IOException; ...@@ -21,12 +21,13 @@ import java.io.IOException;
21 import org.onosproject.yangutils.datamodel.YangEnumeration; 21 import org.onosproject.yangutils.datamodel.YangEnumeration;
22 import org.onosproject.yangutils.translator.exception.TranslatorException; 22 import org.onosproject.yangutils.translator.exception.TranslatorException;
23 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 23 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
24 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
24 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 25 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 26 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
26 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 27 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
27 28
28 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ENUM_CLASS; 29 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_ENUM_CLASS;
29 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode; 30 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeOfNode;
30 31
31 /** 32 /**
32 * Represents YANG java enumeration information extended to support java code generation. 33 * Represents YANG java enumeration information extended to support java code generation.
......
...@@ -20,11 +20,12 @@ import java.io.IOException; ...@@ -20,11 +20,12 @@ import java.io.IOException;
20 import org.onosproject.yangutils.datamodel.YangGrouping; 20 import org.onosproject.yangutils.datamodel.YangGrouping;
21 import org.onosproject.yangutils.translator.exception.TranslatorException; 21 import org.onosproject.yangutils.translator.exception.TranslatorException;
22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
23 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
23 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 24 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
24 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
25 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 26 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
26 27
27 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.updatePackageInfo; 28 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.updatePackageInfo;
28 29
29 /** 30 /**
30 * Represents grouping information extended to support java code generation. 31 * Represents grouping information extended to support java code generation.
......
...@@ -21,12 +21,13 @@ import java.io.IOException; ...@@ -21,12 +21,13 @@ import java.io.IOException;
21 import org.onosproject.yangutils.datamodel.YangInput; 21 import org.onosproject.yangutils.datamodel.YangInput;
22 import org.onosproject.yangutils.translator.exception.TranslatorException; 22 import org.onosproject.yangutils.translator.exception.TranslatorException;
23 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 23 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
24 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
24 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 25 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 26 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
26 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 27 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
27 28
28 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; 29 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
29 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfAugmentableNode; 30 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeOfAugmentableNode;
30 31
31 /** 32 /**
32 * Represents input information extended to support java code generation. 33 * Represents input information extended to support java code generation.
......
...@@ -17,10 +17,10 @@ package org.onosproject.yangutils.translator.tojava.javamodel; ...@@ -17,10 +17,10 @@ package org.onosproject.yangutils.translator.tojava.javamodel;
17 17
18 import org.onosproject.yangutils.datamodel.YangLeaf; 18 import org.onosproject.yangutils.datamodel.YangLeaf;
19 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; 19 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
20 -import org.onosproject.yangutils.translator.tojava.utils.YangToJavaNamingConflictUtil; 20 +import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
21 21
22 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.updateLeavesJavaQualifiedInfo; 22 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.updateLeavesJavaQualifiedInfo;
23 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; 23 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase;
24 24
25 /** 25 /**
26 * Represents java information corresponding to the YANG leaf. 26 * Represents java information corresponding to the YANG leaf.
......
...@@ -17,10 +17,10 @@ package org.onosproject.yangutils.translator.tojava.javamodel; ...@@ -17,10 +17,10 @@ package org.onosproject.yangutils.translator.tojava.javamodel;
17 17
18 import org.onosproject.yangutils.datamodel.YangLeafList; 18 import org.onosproject.yangutils.datamodel.YangLeafList;
19 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; 19 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
20 -import org.onosproject.yangutils.translator.tojava.utils.YangToJavaNamingConflictUtil; 20 +import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
21 21
22 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.updateLeavesJavaQualifiedInfo; 22 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.updateLeavesJavaQualifiedInfo;
23 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; 23 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase;
24 24
25 /** 25 /**
26 * Represents java information corresponding to the YANG leaf-list. 26 * Represents java information corresponding to the YANG leaf-list.
......
...@@ -20,12 +20,13 @@ import java.io.IOException; ...@@ -20,12 +20,13 @@ import java.io.IOException;
20 import org.onosproject.yangutils.datamodel.YangList; 20 import org.onosproject.yangutils.datamodel.YangList;
21 import org.onosproject.yangutils.translator.exception.TranslatorException; 21 import org.onosproject.yangutils.translator.exception.TranslatorException;
22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
23 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
23 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 24 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
24 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
25 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 26 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
26 27
27 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; 28 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
28 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeAndUpdateInParent; 29 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeAndUpdateInParent;
29 30
30 /** 31 /**
31 * Represents YANG list information extended to support java code generation. 32 * Represents YANG list information extended to support java code generation.
......
...@@ -14,24 +14,23 @@ ...@@ -14,24 +14,23 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -package org.onosproject.yangutils.translator.tojava.utils; 17 +package org.onosproject.yangutils.translator.tojava.javamodel;
18 18
19 import java.io.IOException; 19 import java.io.IOException;
20 -
21 import org.onosproject.yangutils.datamodel.RpcNotificationContainer; 20 import org.onosproject.yangutils.datamodel.RpcNotificationContainer;
22 import org.onosproject.yangutils.datamodel.YangCase; 21 import org.onosproject.yangutils.datamodel.YangCase;
23 import org.onosproject.yangutils.datamodel.YangChoice; 22 import org.onosproject.yangutils.datamodel.YangChoice;
24 import org.onosproject.yangutils.datamodel.YangLeavesHolder; 23 import org.onosproject.yangutils.datamodel.YangLeavesHolder;
25 import org.onosproject.yangutils.datamodel.YangNode; 24 import org.onosproject.yangutils.datamodel.YangNode;
26 import org.onosproject.yangutils.datamodel.YangTypeHolder; 25 import org.onosproject.yangutils.datamodel.YangTypeHolder;
26 +import org.onosproject.yangutils.datamodel.utils.DataModelUtils;
27 import org.onosproject.yangutils.translator.exception.TranslatorException; 27 import org.onosproject.yangutils.translator.exception.TranslatorException;
28 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
29 +import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
28 import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; 30 import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
29 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; 31 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
30 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 32 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
31 -import org.onosproject.yangutils.translator.tojava.javamodel.JavaCodeGeneratorInfo; 33 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
32 -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration;
33 -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
34 -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule;
35 34
36 import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.isRpcChildNodePresent; 35 import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.isRpcChildNodePresent;
37 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_CLASS; 36 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_CLASS;
...@@ -39,10 +38,10 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType. ...@@ -39,10 +38,10 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.
39 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_SUBJECT_CLASS; 38 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_SUBJECT_CLASS;
40 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER; 39 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER;
41 import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.addCurNodeInfoInParentTempFile; 40 import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.addCurNodeInfoInParentTempFile;
42 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; 41 +import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
43 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; 42 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase;
44 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCurNodePackage; 43 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
45 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage; 44 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getPackageDirPathFromJavaJPackage;
46 45
47 /** 46 /**
48 * Represents utility class for YANG java model. 47 * Represents utility class for YANG java model.
...@@ -316,7 +315,7 @@ public final class YangJavaModelUtils { ...@@ -316,7 +315,7 @@ public final class YangJavaModelUtils {
316 * @throws IOException IO operations fails 315 * @throws IOException IO operations fails
317 */ 316 */
318 public static void generateCodeOfRootNode(JavaCodeGeneratorInfo javaCodeGeneratorInfo, 317 public static void generateCodeOfRootNode(JavaCodeGeneratorInfo javaCodeGeneratorInfo,
319 - YangPluginConfig yangPluginConfig, String rootPkg) 318 + YangPluginConfig yangPluginConfig, String rootPkg)
320 throws IOException { 319 throws IOException {
321 if (!(javaCodeGeneratorInfo instanceof YangNode)) { 320 if (!(javaCodeGeneratorInfo instanceof YangNode)) {
322 // TODO:throw exception 321 // TODO:throw exception
...@@ -349,4 +348,26 @@ public final class YangJavaModelUtils { ...@@ -349,4 +348,26 @@ public final class YangJavaModelUtils {
349 javaCodeGeneratorInfo.getJavaFileInfo().addGeneratedFileTypes(GENERATE_EVENT_LISTENER_INTERFACE); 348 javaCodeGeneratorInfo.getJavaFileInfo().addGeneratedFileTypes(GENERATE_EVENT_LISTENER_INTERFACE);
350 } 349 }
351 350
351 + /**
352 + * Returns the node package string.
353 + *
354 + * @param curNode current java node whose package string needs to be set
355 + * @return returns the root package string
356 + */
357 + public static String getCurNodePackage(YangNode curNode) {
358 +
359 + String pkg;
360 + if (!(curNode instanceof JavaFileInfoContainer)
361 + || curNode.getParent() == null) {
362 + throw new TranslatorException("missing parent node to get current node's package");
363 + }
364 +
365 + YangNode parentNode = DataModelUtils.getParentNodeInGenCode(curNode);
366 + if (!(parentNode instanceof JavaFileInfoContainer)) {
367 + throw new TranslatorException("missing parent java node to get current node's package");
368 + }
369 + JavaFileInfo parentJavaFileHandle = ((JavaFileInfoContainer) parentNode).getJavaFileInfo();
370 + pkg = parentJavaFileHandle.getPackage() + PERIOD + parentJavaFileHandle.getJavaName();
371 + return pkg.toLowerCase();
372 + }
352 } 373 }
......
...@@ -24,16 +24,17 @@ import org.onosproject.yangutils.datamodel.YangNode; ...@@ -24,16 +24,17 @@ import org.onosproject.yangutils.datamodel.YangNode;
24 import org.onosproject.yangutils.datamodel.YangNotification; 24 import org.onosproject.yangutils.datamodel.YangNotification;
25 import org.onosproject.yangutils.translator.exception.TranslatorException; 25 import org.onosproject.yangutils.translator.exception.TranslatorException;
26 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 26 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
27 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
27 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 28 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
28 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 29 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
29 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 30 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
30 31
31 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_CLASS; 32 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_CLASS;
32 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_LISTENER_INTERFACE; 33 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_LISTENER_INTERFACE;
33 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_SUBJECT_CLASS; 34 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_SUBJECT_CLASS;
34 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER; 35 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER;
35 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage; 36 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
36 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfRootNode; 37 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeOfRootNode;
37 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDeleteTempDir; 38 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDeleteTempDir;
38 39
39 /** 40 /**
......
...@@ -22,17 +22,18 @@ import org.onosproject.yangutils.datamodel.YangNode; ...@@ -22,17 +22,18 @@ import org.onosproject.yangutils.datamodel.YangNode;
22 import org.onosproject.yangutils.datamodel.YangNotification; 22 import org.onosproject.yangutils.datamodel.YangNotification;
23 import org.onosproject.yangutils.translator.exception.TranslatorException; 23 import org.onosproject.yangutils.translator.exception.TranslatorException;
24 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 24 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
25 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
25 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 26 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
26 import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; 27 import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
27 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; 28 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
28 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 29 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
29 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; 30 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer;
30 import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; 31 import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder;
31 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 32 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
32 33
33 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; 34 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
34 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; 35 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
35 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfAugmentableNode; 36 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeOfAugmentableNode;
36 import static org.onosproject.yangutils.utils.UtilConstants.EVENT_LISTENER_STRING; 37 import static org.onosproject.yangutils.utils.UtilConstants.EVENT_LISTENER_STRING;
37 import static org.onosproject.yangutils.utils.UtilConstants.EVENT_STRING; 38 import static org.onosproject.yangutils.utils.UtilConstants.EVENT_STRING;
38 39
......
...@@ -21,12 +21,13 @@ import java.io.IOException; ...@@ -21,12 +21,13 @@ import java.io.IOException;
21 import org.onosproject.yangutils.datamodel.YangOutput; 21 import org.onosproject.yangutils.datamodel.YangOutput;
22 import org.onosproject.yangutils.translator.exception.TranslatorException; 22 import org.onosproject.yangutils.translator.exception.TranslatorException;
23 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 23 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
24 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
24 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 25 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 26 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
26 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 27 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
27 28
28 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER; 29 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
29 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfAugmentableNode; 30 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeOfAugmentableNode;
30 31
31 /** 32 /**
32 * Represents output information extended to support java code generation. 33 * Represents output information extended to support java code generation.
......
...@@ -26,19 +26,20 @@ import org.onosproject.yangutils.datamodel.YangRpc; ...@@ -26,19 +26,20 @@ import org.onosproject.yangutils.datamodel.YangRpc;
26 import org.onosproject.yangutils.translator.exception.TranslatorException; 26 import org.onosproject.yangutils.translator.exception.TranslatorException;
27 import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo; 27 import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo;
28 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 28 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
29 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
29 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 30 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
30 import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; 31 import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
31 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; 32 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
32 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 33 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
33 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; 34 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer;
34 import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles; 35 import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles;
35 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 36 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
36 37
37 import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode; 38 import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode;
38 import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; 39 import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData;
39 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode; 40 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode;
40 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; 41 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
41 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.updatePackageInfo; 42 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.updatePackageInfo;
42 import static org.onosproject.yangutils.utils.UtilConstants.ACTIVATE; 43 import static org.onosproject.yangutils.utils.UtilConstants.ACTIVATE;
43 import static org.onosproject.yangutils.utils.UtilConstants.COMPONENT; 44 import static org.onosproject.yangutils.utils.UtilConstants.COMPONENT;
44 import static org.onosproject.yangutils.utils.UtilConstants.DEACTIVATE; 45 import static org.onosproject.yangutils.utils.UtilConstants.DEACTIVATE;
......
...@@ -26,16 +26,17 @@ import org.onosproject.yangutils.datamodel.YangNotification; ...@@ -26,16 +26,17 @@ import org.onosproject.yangutils.datamodel.YangNotification;
26 import org.onosproject.yangutils.datamodel.YangSubModule; 26 import org.onosproject.yangutils.datamodel.YangSubModule;
27 import org.onosproject.yangutils.translator.exception.TranslatorException; 27 import org.onosproject.yangutils.translator.exception.TranslatorException;
28 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 28 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
29 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
29 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 30 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
30 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 31 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
31 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 32 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
32 33
33 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_CLASS; 34 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_CLASS;
34 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_LISTENER_INTERFACE; 35 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_LISTENER_INTERFACE;
35 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_SUBJECT_CLASS; 36 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_EVENT_SUBJECT_CLASS;
36 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER; 37 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER;
37 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage; 38 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
38 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfRootNode; 39 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeOfRootNode;
39 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDeleteTempDir; 40 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.searchAndDeleteTempDir;
40 41
41 /** 42 /**
......
...@@ -18,8 +18,7 @@ package org.onosproject.yangutils.translator.tojava.javamodel; ...@@ -18,8 +18,7 @@ package org.onosproject.yangutils.translator.tojava.javamodel;
18 import org.onosproject.yangutils.datamodel.YangType; 18 import org.onosproject.yangutils.datamodel.YangType;
19 import org.onosproject.yangutils.translator.exception.TranslatorException; 19 import org.onosproject.yangutils.translator.exception.TranslatorException;
20 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; 20 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
21 -import org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType; 21 +import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
22 -import org.onosproject.yangutils.translator.tojava.utils.YangToJavaNamingConflictUtil;
23 22
24 /** 23 /**
25 * Represents java information corresponding to the YANG type. 24 * Represents java information corresponding to the YANG type.
......
...@@ -20,12 +20,13 @@ import java.io.IOException; ...@@ -20,12 +20,13 @@ import java.io.IOException;
20 import org.onosproject.yangutils.datamodel.YangTypeDef; 20 import org.onosproject.yangutils.datamodel.YangTypeDef;
21 import org.onosproject.yangutils.translator.exception.TranslatorException; 21 import org.onosproject.yangutils.translator.exception.TranslatorException;
22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
23 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
23 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 24 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
24 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
25 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 26 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
26 27
27 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_TYPEDEF_CLASS; 28 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_TYPEDEF_CLASS;
28 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode; 29 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeOfNode;
29 30
30 /** 31 /**
31 * Represents type define information extended to support java code generation. 32 * Represents type define information extended to support java code generation.
......
...@@ -20,12 +20,13 @@ import java.io.IOException; ...@@ -20,12 +20,13 @@ import java.io.IOException;
20 import org.onosproject.yangutils.datamodel.YangUnion; 20 import org.onosproject.yangutils.datamodel.YangUnion;
21 import org.onosproject.yangutils.translator.exception.TranslatorException; 21 import org.onosproject.yangutils.translator.exception.TranslatorException;
22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 22 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
23 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
23 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 24 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
24 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
25 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 26 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
26 27
27 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS; 28 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS;
28 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode; 29 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.generateCodeOfNode;
29 30
30 /** 31 /**
31 * Represents union information extended to support java code generation. 32 * Represents union information extended to support java code generation.
......
...@@ -25,13 +25,14 @@ import org.onosproject.yangutils.datamodel.YangNode; ...@@ -25,13 +25,14 @@ import org.onosproject.yangutils.datamodel.YangNode;
25 import org.onosproject.yangutils.datamodel.YangUses; 25 import org.onosproject.yangutils.datamodel.YangUses;
26 import org.onosproject.yangutils.translator.exception.TranslatorException; 26 import org.onosproject.yangutils.translator.exception.TranslatorException;
27 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator; 27 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
28 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
28 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 29 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
29 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 30 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
30 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 31 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
31 32
32 import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode; 33 import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode;
33 import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.addCurNodeAsAttributeInTargetTempFile; 34 import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.addCurNodeAsAttributeInTargetTempFile;
34 -import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.updatePackageInfo; 35 +import static org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModelUtils.updatePackageInfo;
35 36
36 /** 37 /**
37 * Represents uses information extended to support java code generation. 38 * Represents uses information extended to support java code generation.
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
17 package org.onosproject.yangutils.translator.tojava.utils; 17 package org.onosproject.yangutils.translator.tojava.utils;
18 18
19 import org.onosproject.yangutils.datamodel.YangNode; 19 import org.onosproject.yangutils.datamodel.YangNode;
20 +import org.onosproject.yangutils.datamodel.YangNotification;
20 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; 21 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
21 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; 22 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer;
22 -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaNotification;
23 23
24 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; 24 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK;
25 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK; 25 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK;
...@@ -75,7 +75,7 @@ public final class ClassDefinitionGenerator { ...@@ -75,7 +75,7 @@ public final class ClassDefinitionGenerator {
75 * / interface definition start. 75 * / interface definition start.
76 * 76 *
77 * @param genFileTypes generated file type 77 * @param genFileTypes generated file type
78 - * @param yangName class name 78 + * @param yangName class name
79 * @return class definition 79 * @return class definition
80 */ 80 */
81 public static String generateClassDefinition(int genFileTypes, String yangName) { 81 public static String generateClassDefinition(int genFileTypes, String yangName) {
...@@ -85,19 +85,19 @@ public final class ClassDefinitionGenerator { ...@@ -85,19 +85,19 @@ public final class ClassDefinitionGenerator {
85 * class / interface definition start. 85 * class / interface definition start.
86 */ 86 */
87 switch (genFileTypes) { 87 switch (genFileTypes) {
88 - case BUILDER_CLASS_MASK: 88 + case BUILDER_CLASS_MASK:
89 - return getBuilderClassDefinition(yangName); 89 + return getBuilderClassDefinition(yangName);
90 - case IMPL_CLASS_MASK: 90 + case IMPL_CLASS_MASK:
91 - return getImplClassDefinition(yangName); 91 + return getImplClassDefinition(yangName);
92 - case BUILDER_INTERFACE_MASK: 92 + case BUILDER_INTERFACE_MASK:
93 - return getBuilderInterfaceDefinition(yangName); 93 + return getBuilderInterfaceDefinition(yangName);
94 - case GENERATE_TYPEDEF_CLASS: 94 + case GENERATE_TYPEDEF_CLASS:
95 - case GENERATE_UNION_CLASS: 95 + case GENERATE_UNION_CLASS:
96 - return getTypeClassDefinition(yangName); 96 + return getTypeClassDefinition(yangName);
97 - case GENERATE_ENUM_CLASS: 97 + case GENERATE_ENUM_CLASS:
98 - return getEnumClassDefinition(yangName); 98 + return getEnumClassDefinition(yangName);
99 - default: 99 + default:
100 - return null; 100 + return null;
101 } 101 }
102 } 102 }
103 103
...@@ -106,8 +106,8 @@ public final class ClassDefinitionGenerator { ...@@ -106,8 +106,8 @@ public final class ClassDefinitionGenerator {
106 * / interface definition start. 106 * / interface definition start.
107 * 107 *
108 * @param genFileTypes generated file type 108 * @param genFileTypes generated file type
109 - * @param yangName class name 109 + * @param yangName class name
110 - * @param curNode current YANG node 110 + * @param curNode current YANG node
111 * @return class definition 111 * @return class definition
112 */ 112 */
113 public static String generateClassDefinition(int genFileTypes, String yangName, YangNode curNode) { 113 public static String generateClassDefinition(int genFileTypes, String yangName, YangNode curNode) {
...@@ -117,19 +117,19 @@ public final class ClassDefinitionGenerator { ...@@ -117,19 +117,19 @@ public final class ClassDefinitionGenerator {
117 * class / interface definition start. 117 * class / interface definition start.
118 */ 118 */
119 switch (genFileTypes) { 119 switch (genFileTypes) {
120 - case INTERFACE_MASK: 120 + case INTERFACE_MASK:
121 - return getInterfaceDefinition(yangName, curNode); 121 + return getInterfaceDefinition(yangName, curNode);
122 - case GENERATE_SERVICE_AND_MANAGER: 122 + case GENERATE_SERVICE_AND_MANAGER:
123 - return getRpcInterfaceDefinition(yangName, curNode); 123 + return getRpcInterfaceDefinition(yangName, curNode);
124 - case GENERATE_EVENT_CLASS: 124 + case GENERATE_EVENT_CLASS:
125 - String eventName = yangName + SUBJECT; 125 + String eventName = yangName + SUBJECT;
126 - return getEventDefinition(yangName, eventName); 126 + return getEventDefinition(yangName, eventName);
127 - case GENERATE_EVENT_LISTENER_INTERFACE: 127 + case GENERATE_EVENT_LISTENER_INTERFACE:
128 - return getEventListenerDefinition(yangName); 128 + return getEventListenerDefinition(yangName);
129 - case GENERATE_EVENT_SUBJECT_CLASS: 129 + case GENERATE_EVENT_SUBJECT_CLASS:
130 - return getClassDefinition(yangName); 130 + return getClassDefinition(yangName);
131 - default: 131 + default:
132 - return null; 132 + return null;
133 } 133 }
134 } 134 }
135 135
...@@ -174,7 +174,7 @@ public final class ClassDefinitionGenerator { ...@@ -174,7 +174,7 @@ public final class ClassDefinitionGenerator {
174 * Returns builder interface file class definition. 174 * Returns builder interface file class definition.
175 * 175 *
176 * @param yangName java class name, corresponding to which the builder class 176 * @param yangName java class name, corresponding to which the builder class
177 - * is being generated 177 + * is being generated
178 * @return definition 178 * @return definition
179 */ 179 */
180 private static String getBuilderInterfaceDefinition(String yangName) { 180 private static String getBuilderInterfaceDefinition(String yangName) {
...@@ -227,7 +227,7 @@ public final class ClassDefinitionGenerator { ...@@ -227,7 +227,7 @@ public final class ClassDefinitionGenerator {
227 * Returns RPC file interface definition. 227 * Returns RPC file interface definition.
228 * 228 *
229 * @param yangName file name 229 * @param yangName file name
230 - * @param curNode current YANG node 230 + * @param curNode current YANG node
231 * @return definition 231 * @return definition
232 */ 232 */
233 private static String getRpcInterfaceDefinition(String yangName, YangNode curNode) { 233 private static String getRpcInterfaceDefinition(String yangName, YangNode curNode) {
...@@ -236,7 +236,7 @@ public final class ClassDefinitionGenerator { ...@@ -236,7 +236,7 @@ public final class ClassDefinitionGenerator {
236 if (holder.getExtendsList() != null && !holder.getExtendsList().isEmpty()) { 236 if (holder.getExtendsList() != null && !holder.getExtendsList().isEmpty()) {
237 curNode = curNode.getChild(); 237 curNode = curNode.getChild();
238 while (curNode != null) { 238 while (curNode != null) {
239 - if (curNode instanceof YangJavaNotification) { 239 + if (curNode instanceof YangNotification) {
240 return getRpcInterfaceDefinitionWhenItExtends(yangName, holder); 240 return getRpcInterfaceDefinitionWhenItExtends(yangName, holder);
241 } 241 }
242 curNode = curNode.getNextSibling(); 242 curNode = curNode.getNextSibling();
...@@ -251,7 +251,7 @@ public final class ClassDefinitionGenerator { ...@@ -251,7 +251,7 @@ public final class ClassDefinitionGenerator {
251 251
252 /* Provides class definition when RPC interface needs to extends any event.*/ 252 /* Provides class definition when RPC interface needs to extends any event.*/
253 private static String getRpcInterfaceDefinitionWhenItExtends(String yangName, 253 private static String getRpcInterfaceDefinitionWhenItExtends(String yangName,
254 - JavaExtendsListHolder holder) { 254 + JavaExtendsListHolder holder) {
255 255
256 if (yangName.matches(REGEX_FOR_ANY_STRING_ENDING_WITH_SERVICE)) { 256 if (yangName.matches(REGEX_FOR_ANY_STRING_ENDING_WITH_SERVICE)) {
257 String[] strArray = yangName.split(SERVICE); 257 String[] strArray = yangName.split(SERVICE);
......
...@@ -17,9 +17,10 @@ ...@@ -17,9 +17,10 @@
17 package org.onosproject.yangutils.translator.tojava.utils; 17 package org.onosproject.yangutils.translator.tojava.utils;
18 18
19 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; 19 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
20 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
20 21
21 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getEnumJavaAttribute; 22 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getEnumJavaAttribute;
22 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase; 23 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getSmallCase;
23 import static org.onosproject.yangutils.utils.UtilConstants.ARRAY_LIST; 24 import static org.onosproject.yangutils.utils.UtilConstants.ARRAY_LIST;
24 import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED_INFO; 25 import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED_INFO;
25 import static org.onosproject.yangutils.utils.UtilConstants.CLOSE_CURLY_BRACKET; 26 import static org.onosproject.yangutils.utils.UtilConstants.CLOSE_CURLY_BRACKET;
......
...@@ -27,7 +27,7 @@ import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer; ...@@ -27,7 +27,7 @@ import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
27 import org.onosproject.yangutils.translator.tojava.JavaImportData; 27 import org.onosproject.yangutils.translator.tojava.JavaImportData;
28 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; 28 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
29 29
30 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; 30 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
31 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.getTempJavaFragement; 31 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.getTempJavaFragement;
32 32
33 /** 33 /**
......
...@@ -28,7 +28,8 @@ import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; ...@@ -28,7 +28,8 @@ import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
28 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; 28 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer;
29 import org.onosproject.yangutils.translator.tojava.TempJavaEnumerationFragmentFiles; 29 import org.onosproject.yangutils.translator.tojava.TempJavaEnumerationFragmentFiles;
30 import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles; 30 import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles;
31 -import org.onosproject.yangutils.translator.tojava.javamodel.JavaCodeGeneratorInfo; 31 +import org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorInfo;
32 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
32 33
33 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; 34 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK;
34 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK; 35 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK;
...@@ -65,7 +66,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetG ...@@ -65,7 +66,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetG
65 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getDataFromTempFileHandle; 66 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getDataFromTempFileHandle;
66 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getEnumsValueAttribute; 67 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getEnumsValueAttribute;
67 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.initiateJavaFileGeneration; 68 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.initiateJavaFileGeneration;
68 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; 69 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
69 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.addActivateMethod; 70 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.addActivateMethod;
70 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.addDeActivateMethod; 71 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.addDeActivateMethod;
71 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getAddAugmentInfoMethodImpl; 72 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getAddAugmentInfoMethodImpl;
......
...@@ -31,6 +31,7 @@ import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles; ...@@ -31,6 +31,7 @@ import org.onosproject.yangutils.translator.tojava.TempJavaServiceFragmentFiles;
31 import org.onosproject.yangutils.translator.tojava.TempJavaTypeFragmentFiles; 31 import org.onosproject.yangutils.translator.tojava.TempJavaTypeFragmentFiles;
32 import org.onosproject.yangutils.utils.io.impl.CopyrightHeader; 32 import org.onosproject.yangutils.utils.io.impl.CopyrightHeader;
33 import org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType; 33 import org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType;
34 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
34 35
35 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK; 36 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_CLASS_MASK;
36 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK; 37 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.BUILDER_INTERFACE_MASK;
...@@ -64,8 +65,8 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. ...@@ -64,8 +65,8 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.
64 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK; 65 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.SETTER_FOR_INTERFACE_MASK;
65 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK; 66 import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.TO_STRING_IMPL_MASK;
66 import static org.onosproject.yangutils.translator.tojava.utils.ClassDefinitionGenerator.generateClassDefinition; 67 import static org.onosproject.yangutils.translator.tojava.utils.ClassDefinitionGenerator.generateClassDefinition;
67 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getJavaPackageFromPackagePath; 68 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getJavaPackageFromPackagePath;
68 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase; 69 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getSmallCase;
69 import static org.onosproject.yangutils.utils.UtilConstants.CLOSE_PARENTHESIS; 70 import static org.onosproject.yangutils.utils.UtilConstants.CLOSE_PARENTHESIS;
70 import static org.onosproject.yangutils.utils.UtilConstants.COMPONENT_ANNOTATION; 71 import static org.onosproject.yangutils.utils.UtilConstants.COMPONENT_ANNOTATION;
71 import static org.onosproject.yangutils.utils.UtilConstants.EQUAL; 72 import static org.onosproject.yangutils.utils.UtilConstants.EQUAL;
......
...@@ -19,51 +19,29 @@ package org.onosproject.yangutils.translator.tojava.utils; ...@@ -19,51 +19,29 @@ package org.onosproject.yangutils.translator.tojava.utils;
19 import java.io.File; 19 import java.io.File;
20 import java.io.IOException; 20 import java.io.IOException;
21 import java.util.List; 21 import java.util.List;
22 -
23 import org.onosproject.yangutils.datamodel.YangNode; 22 import org.onosproject.yangutils.datamodel.YangNode;
24 -import org.onosproject.yangutils.datamodel.YangNodeIdentifier;
25 -import org.onosproject.yangutils.translator.exception.TranslatorException;
26 -import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
27 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; 23 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
28 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; 24 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
29 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer; 25 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer;
30 import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles; 26 import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles;
31 -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaAugment;
32 -import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
33 27
34 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase;
35 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase;
36 import static org.onosproject.yangutils.utils.UtilConstants.ACTIVATE_ANNOTATION_IMPORT; 28 import static org.onosproject.yangutils.utils.UtilConstants.ACTIVATE_ANNOTATION_IMPORT;
37 -import static org.onosproject.yangutils.utils.UtilConstants.ADD_STRING;
38 -import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTATION;
39 import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTATION_HOLDER; 29 import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTATION_HOLDER;
40 import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED_INFO; 30 import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED_INFO;
41 -import static org.onosproject.yangutils.utils.UtilConstants.BUILDER;
42 -import static org.onosproject.yangutils.utils.UtilConstants.CLOSE_PARENTHESIS;
43 import static org.onosproject.yangutils.utils.UtilConstants.COMPONENT_ANNOTATION_IMPORT; 31 import static org.onosproject.yangutils.utils.UtilConstants.COMPONENT_ANNOTATION_IMPORT;
44 import static org.onosproject.yangutils.utils.UtilConstants.DEACTIVATE_ANNOTATION_IMPORT; 32 import static org.onosproject.yangutils.utils.UtilConstants.DEACTIVATE_ANNOTATION_IMPORT;
45 -import static org.onosproject.yangutils.utils.UtilConstants.EIGHT_SPACE_INDENTATION;
46 import static org.onosproject.yangutils.utils.UtilConstants.ENUM; 33 import static org.onosproject.yangutils.utils.UtilConstants.ENUM;
47 -import static org.onosproject.yangutils.utils.UtilConstants.EQUAL;
48 import static org.onosproject.yangutils.utils.UtilConstants.FOUR_SPACE_INDENTATION; 34 import static org.onosproject.yangutils.utils.UtilConstants.FOUR_SPACE_INDENTATION;
49 -import static org.onosproject.yangutils.utils.UtilConstants.IMPL;
50 -import static org.onosproject.yangutils.utils.UtilConstants.IMPORT;
51 import static org.onosproject.yangutils.utils.UtilConstants.LISTENER_SERVICE; 35 import static org.onosproject.yangutils.utils.UtilConstants.LISTENER_SERVICE;
52 import static org.onosproject.yangutils.utils.UtilConstants.LOGGER_FACTORY_IMPORT; 36 import static org.onosproject.yangutils.utils.UtilConstants.LOGGER_FACTORY_IMPORT;
53 import static org.onosproject.yangutils.utils.UtilConstants.LOGGER_IMPORT; 37 import static org.onosproject.yangutils.utils.UtilConstants.LOGGER_IMPORT;
54 -import static org.onosproject.yangutils.utils.UtilConstants.NEW;
55 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE; 38 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
56 import static org.onosproject.yangutils.utils.UtilConstants.OPEN_CURLY_BRACKET; 39 import static org.onosproject.yangutils.utils.UtilConstants.OPEN_CURLY_BRACKET;
57 -import static org.onosproject.yangutils.utils.UtilConstants.OPEN_PARENTHESIS;
58 -import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
59 import static org.onosproject.yangutils.utils.UtilConstants.PUBLIC; 40 import static org.onosproject.yangutils.utils.UtilConstants.PUBLIC;
60 -import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN;
61 import static org.onosproject.yangutils.utils.UtilConstants.SERVICE_ANNOTATION_IMPORT; 41 import static org.onosproject.yangutils.utils.UtilConstants.SERVICE_ANNOTATION_IMPORT;
62 import static org.onosproject.yangutils.utils.UtilConstants.SPACE; 42 import static org.onosproject.yangutils.utils.UtilConstants.SPACE;
63 -import static org.onosproject.yangutils.utils.UtilConstants.THIS;
64 import static org.onosproject.yangutils.utils.UtilConstants.TYPE; 43 import static org.onosproject.yangutils.utils.UtilConstants.TYPE;
65 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.updateFileHandle; 44 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.updateFileHandle;
66 -
67 import static java.util.Collections.sort; 45 import static java.util.Collections.sort;
68 46
69 /** 47 /**
...@@ -121,84 +99,6 @@ public final class TempJavaCodeFragmentFilesUtils { ...@@ -121,84 +99,6 @@ public final class TempJavaCodeFragmentFilesUtils {
121 } 99 }
122 100
123 /** 101 /**
124 - * Updated imports with augmented nodes import.
125 - *
126 - * @param curNode current YANG node
127 - * @param imports list of imports
128 - * @param operation to add or to delete
129 - */
130 - public static void addAugmentedNodesImport(YangNode curNode, List<String> imports, boolean operation) {
131 -
132 - String nodesImport = "";
133 -
134 - if (!(curNode instanceof YangJavaAugment)) {
135 - throw new TranslatorException("current node should be of type augment node.");
136 - }
137 - YangJavaAugment augment = (YangJavaAugment) curNode;
138 - List<YangNodeIdentifier> targetNodes = augment.getTargetNode();
139 - YangNode parent = curNode.getParent();
140 - if (parent instanceof YangJavaModule) {
141 - // Add impl class import.
142 - nodesImport = getAugmendtedNodesImports(parent, targetNodes, true) + SEMI_COLAN + NEW_LINE;
143 - performOperationOnImports(imports, nodesImport, operation);
144 - // Add builder class import.
145 - if (targetNodes.size() > 2) {
146 - nodesImport = getAugmendtedNodesImports(parent, targetNodes, false) + SEMI_COLAN + NEW_LINE;
147 - performOperationOnImports(imports, nodesImport, operation);
148 - }
149 - }
150 - // TODO: add functionality for submodule and uses.
151 - }
152 -
153 - /**
154 - * Returns imports for augmented node.
155 - *
156 - * @param parent parent YANG node
157 - * @param targetNodes list of target nodes
158 - * @param isImplClass if impl class's import required
159 - * @return imports for augmented node
160 - */
161 - private static String getAugmendtedNodesImports(YangNode parent, List<YangNodeIdentifier> targetNodes,
162 - boolean isImplClass) {
163 - String pkgInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo().getPackage();
164 -
165 - for (int i = 0; i < targetNodes.size() - 1; i++) {
166 - pkgInfo = pkgInfo + PERIOD + targetNodes.get(i).getName();
167 - }
168 - String classInfo = targetNodes.get(targetNodes.size() - 1).getName();
169 - if (!isImplClass) {
170 - return IMPORT + pkgInfo.toLowerCase() + PERIOD + getCapitalCase(classInfo) + BUILDER;
171 - }
172 - return IMPORT + pkgInfo.toLowerCase() + PERIOD + getCapitalCase(classInfo) + BUILDER + PERIOD
173 - + getCapitalCase(classInfo) + IMPL;
174 - }
175 -
176 - /**
177 - * Provides string to be added in augment node's constructor.
178 - *
179 - * @param curNode current YANG node
180 - * @return constructors string
181 - */
182 - public static String getAugmentsAddToAugmentedClassString(YangNode curNode) {
183 -
184 - if (!(curNode instanceof YangJavaAugment)) {
185 - throw new TranslatorException("current node should be of type augment node.");
186 - }
187 - YangJavaAugment augment = (YangJavaAugment) curNode;
188 - List<YangNodeIdentifier> targetNodes = augment.getTargetNode();
189 -
190 - String name = targetNodes.get(targetNodes.size() - 1).getName();
191 - String captialCase = getCapitalCase(name);
192 - String smallCase = getSmallCase(captialCase);
193 - return EIGHT_SPACE_INDENTATION + captialCase + IMPL + SPACE + smallCase + IMPL + SPACE + EQUAL + SPACE + NEW
194 - + SPACE + captialCase + BUILDER + OPEN_PARENTHESIS + CLOSE_PARENTHESIS + PERIOD + NEW + SPACE
195 - + captialCase + IMPL + OPEN_PARENTHESIS + CLOSE_PARENTHESIS + SEMI_COLAN + NEW_LINE
196 - + EIGHT_SPACE_INDENTATION + smallCase + IMPL + PERIOD + ADD_STRING + AUGMENTATION + OPEN_PARENTHESIS
197 - + THIS + CLOSE_PARENTHESIS + SEMI_COLAN + NEW_LINE;
198 -
199 - }
200 -
201 - /**
202 * Adds import for array list. 102 * Adds import for array list.
203 * 103 *
204 * @param curNode current YANG node 104 * @param curNode current YANG node
...@@ -227,7 +127,7 @@ public final class TempJavaCodeFragmentFilesUtils { ...@@ -227,7 +127,7 @@ public final class TempJavaCodeFragmentFilesUtils {
227 * @param classInfo class info to be added to import list 127 * @param classInfo class info to be added to import list
228 */ 128 */
229 public static void addListnersImport(YangNode curNode, List<String> imports, boolean operation, 129 public static void addListnersImport(YangNode curNode, List<String> imports, boolean operation,
230 - String classInfo) { 130 + String classInfo) {
231 String thisImport = ""; 131 String thisImport = "";
232 if (classInfo.equals(LISTENER_SERVICE)) { 132 if (classInfo.equals(LISTENER_SERVICE)) {
233 thisImport = getTempJavaFragement(curNode).getJavaImportData().getListenerServiceImport(); 133 thisImport = getTempJavaFragement(curNode).getJavaImportData().getListenerServiceImport();
...@@ -272,7 +172,7 @@ public final class TempJavaCodeFragmentFilesUtils { ...@@ -272,7 +172,7 @@ public final class TempJavaCodeFragmentFilesUtils {
272 * @return import list 172 * @return import list
273 */ 173 */
274 private static List<String> performOperationOnImports(List<String> imports, String curImport, 174 private static List<String> performOperationOnImports(List<String> imports, String curImport,
275 - boolean operation) { 175 + boolean operation) {
276 if (operation) { 176 if (operation) {
277 imports.add(curImport); 177 imports.add(curImport);
278 } else { 178 } else {
......
...@@ -25,24 +25,12 @@ import java.io.PrintWriter; ...@@ -25,24 +25,12 @@ import java.io.PrintWriter;
25 import java.util.ArrayList; 25 import java.util.ArrayList;
26 import java.util.List; 26 import java.util.List;
27 27
28 -import org.onosproject.yangutils.datamodel.YangNode;
29 -import org.onosproject.yangutils.translator.exception.TranslatorException;
30 -import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
31 -import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
32 -
33 -import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode;
34 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getJavaPackageFromPackagePath;
35 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
36 import static org.onosproject.yangutils.utils.UtilConstants.EIGHT_SPACE_INDENTATION; 28 import static org.onosproject.yangutils.utils.UtilConstants.EIGHT_SPACE_INDENTATION;
37 import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING; 29 import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
38 import static org.onosproject.yangutils.utils.UtilConstants.FOUR_SPACE_INDENTATION; 30 import static org.onosproject.yangutils.utils.UtilConstants.FOUR_SPACE_INDENTATION;
39 import static org.onosproject.yangutils.utils.UtilConstants.MULTIPLE_NEW_LINE; 31 import static org.onosproject.yangutils.utils.UtilConstants.MULTIPLE_NEW_LINE;
40 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE; 32 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
41 -import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
42 import static org.onosproject.yangutils.utils.UtilConstants.SPACE; 33 import static org.onosproject.yangutils.utils.UtilConstants.SPACE;
43 -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.addPackageInfo;
44 -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.createDirectories;
45 -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
46 34
47 /** 35 /**
48 * Represents utility to handle file system operations. 36 * Represents utility to handle file system operations.
...@@ -56,57 +44,13 @@ public final class FileSystemUtil { ...@@ -56,57 +44,13 @@ public final class FileSystemUtil {
56 } 44 }
57 45
58 /** 46 /**
59 - * Checks if the package directory structure created.
60 - *
61 - * @param pkg Package to check if it is created
62 - * @return existence status of package
63 - */
64 - public static boolean doesPackageExist(String pkg) {
65 - File pkgDir = new File(getPackageDirPathFromJavaJPackage(pkg));
66 - File pkgWithFile = new File(pkgDir + SLASH + "package-info.java");
67 - return pkgDir.exists() && pkgWithFile.isFile();
68 - }
69 -
70 - /**
71 - * Creates a package structure with package info java file if not present.
72 - *
73 - * @param yangNode YANG node for which code is being generated
74 - * @throws IOException any IO exception
75 - */
76 - public static void createPackage(YangNode yangNode) throws IOException {
77 - if (!(yangNode instanceof JavaFileInfoContainer)) {
78 - throw new TranslatorException("current node must have java file info");
79 - }
80 - String pkgInfo;
81 - JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) yangNode).getJavaFileInfo();
82 - String pkg = getAbsolutePackagePath(javaFileInfo.getBaseCodeGenPath(), javaFileInfo.getPackageFilePath());
83 - if (!doesPackageExist(pkg)) {
84 - try {
85 - File pack = createDirectories(pkg);
86 - YangNode parent = getParentNodeInGenCode(yangNode);
87 - if (parent != null) {
88 - pkgInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo().getJavaName();
89 - addPackageInfo(pack, pkgInfo, getJavaPackageFromPackagePath(pkg), true,
90 - ((JavaFileInfoContainer) parent).getJavaFileInfo().getPluginConfig());
91 - } else {
92 - pkgInfo = ((JavaFileInfoContainer) yangNode).getJavaFileInfo().getJavaName();
93 - addPackageInfo(pack, pkgInfo, getJavaPackageFromPackagePath(pkg), false,
94 - ((JavaFileInfoContainer) yangNode).getJavaFileInfo().getPluginConfig());
95 - }
96 - } catch (IOException e) {
97 - throw new IOException("failed to create package-info file");
98 - }
99 - }
100 - }
101 -
102 - /**
103 * Reads the contents from source file and append its contents to append 47 * Reads the contents from source file and append its contents to append
104 * file. 48 * file.
105 * 49 *
106 * @param toAppend destination file in which the contents of source file is 50 * @param toAppend destination file in which the contents of source file is
107 - * appended 51 + * appended
108 - * @param srcFile source file from which data is read and added to to append 52 + * @param srcFile source file from which data is read and added to to append
109 - * file 53 + * file
110 * @throws IOException any IO errors 54 * @throws IOException any IO errors
111 */ 55 */
112 public static void appendFileContents(File toAppend, File srcFile) 56 public static void appendFileContents(File toAppend, File srcFile)
...@@ -118,7 +62,7 @@ public final class FileSystemUtil { ...@@ -118,7 +62,7 @@ public final class FileSystemUtil {
118 * Reads file and convert it to string. 62 * Reads file and convert it to string.
119 * 63 *
120 * @param toAppend file to be converted 64 * @param toAppend file to be converted
121 - * @param spaces spaces to be appended 65 + * @param spaces spaces to be appended
122 * @return string of file 66 * @return string of file
123 * @throws IOException when fails to convert to string 67 * @throws IOException when fails to convert to string
124 */ 68 */
...@@ -153,9 +97,9 @@ public final class FileSystemUtil { ...@@ -153,9 +97,9 @@ public final class FileSystemUtil {
153 /** 97 /**
154 * Updates the generated file handle. 98 * Updates the generated file handle.
155 * 99 *
156 - * @param inputFile input file 100 + * @param inputFile input file
157 * @param contentTobeAdded content to be appended to the file 101 * @param contentTobeAdded content to be appended to the file
158 - * @param isClose when close of file is called. 102 + * @param isClose when close of file is called.
159 * @throws IOException if the named file exists but is a directory rather than a regular file, 103 * @throws IOException if the named file exists but is a directory rather than a regular file,
160 * does not exist but cannot be created, or cannot be opened for any other reason 104 * does not exist but cannot be created, or cannot be opened for any other reason
161 */ 105 */
......
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
16 16
17 package org.onosproject.yangutils.utils.io.impl; 17 package org.onosproject.yangutils.utils.io.impl;
18 18
19 -import org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax; 19 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase;
20 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
21 -
22 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
23 import static org.onosproject.yangutils.utils.UtilConstants.BUILDER; 20 import static org.onosproject.yangutils.utils.UtilConstants.BUILDER;
24 import static org.onosproject.yangutils.utils.UtilConstants.BUILDER_CLASS_JAVA_DOC; 21 import static org.onosproject.yangutils.utils.UtilConstants.BUILDER_CLASS_JAVA_DOC;
25 import static org.onosproject.yangutils.utils.UtilConstants.BUILDER_INTERFACE_JAVA_DOC; 22 import static org.onosproject.yangutils.utils.UtilConstants.BUILDER_INTERFACE_JAVA_DOC;
...@@ -202,7 +199,7 @@ public final class JavaDocGen { ...@@ -202,7 +199,7 @@ public final class JavaDocGen {
202 */ 199 */
203 public static String getJavaDoc(JavaDocType type, String name, boolean isList, YangPluginConfig pluginConfig) { 200 public static String getJavaDoc(JavaDocType type, String name, boolean isList, YangPluginConfig pluginConfig) {
204 201
205 - name = JavaIdentifierSyntax.getSmallCase(getCamelCase(name, pluginConfig.getConflictResolver())); 202 + name = YangIoUtils.getSmallCase(getCamelCase(name, pluginConfig.getConflictResolver()));
206 switch (type) { 203 switch (type) {
207 case IMPL_CLASS: { 204 case IMPL_CLASS: {
208 return generateForClass(name); 205 return generateForClass(name);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -package org.onosproject.yangutils.translator.tojava.utils; 17 +package org.onosproject.yangutils.utils.io.impl;
18 18
19 /** 19 /**
20 * Representation of plugin configurations required for YANG utils. 20 * Representation of plugin configurations required for YANG utils.
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -package org.onosproject.yangutils.translator.tojava.utils; 17 +package org.onosproject.yangutils.utils.io.impl;
18 18
19 /** 19 /**
20 * Representation of YANG to java naming conflict resolver util. 20 * Representation of YANG to java naming conflict resolver util.
......
...@@ -22,7 +22,7 @@ import org.onosproject.yangutils.linker.impl.YangLinkerManager; ...@@ -22,7 +22,7 @@ import org.onosproject.yangutils.linker.impl.YangLinkerManager;
22 import org.onosproject.yangutils.parser.exceptions.ParserException; 22 import org.onosproject.yangutils.parser.exceptions.ParserException;
23 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; 23 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
24 import org.onosproject.yangutils.plugin.manager.YangUtilManager; 24 import org.onosproject.yangutils.plugin.manager.YangUtilManager;
25 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; 25 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
26 import org.onosproject.yangutils.utils.io.impl.YangFileScanner; 26 import org.onosproject.yangutils.utils.io.impl.YangFileScanner;
27 27
28 import java.io.IOException; 28 import java.io.IOException;
......
1 -/*
2 - * Copyright 2016-present Open Networking Laboratory
3 - *
4 - * Licensed under the Apache License, Version 2.0 (the "License");
5 - * you may not use this file except in compliance with the License.
6 - * You may obtain a copy of the License at
7 - *
8 - * http://www.apache.org/licenses/LICENSE-2.0
9 - *
10 - * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS,
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 - * See the License for the specific language governing permissions and
14 - * limitations under the License.
15 - */
16 -
17 -package org.onosproject.yangutils.linker;
18 -
19 -import java.io.File;
20 -import java.io.IOException;
21 -import java.util.ArrayList;
22 -import java.util.Iterator;
23 -import java.util.List;
24 -import java.util.ListIterator;
25 -
26 -import org.apache.maven.plugin.MojoExecutionException;
27 -import org.junit.Test;
28 -import org.onosproject.yangutils.datamodel.YangContainer;
29 -import org.onosproject.yangutils.datamodel.YangDerivedInfo;
30 -import org.onosproject.yangutils.datamodel.YangGrouping;
31 -import org.onosproject.yangutils.datamodel.YangLeaf;
32 -import org.onosproject.yangutils.datamodel.YangNode;
33 -import org.onosproject.yangutils.plugin.manager.YangFileInfo;
34 -import org.onosproject.yangutils.plugin.manager.YangUtilManager;
35 -import org.onosproject.yangutils.utils.io.impl.YangFileScanner;
36 -
37 -import static org.hamcrest.MatcherAssert.assertThat;
38 -import static org.hamcrest.core.Is.is;
39 -import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
40 -import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
41 -import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED;
42 -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deSerializeDataModel;
43 -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
44 -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.parseJarFile;
45 -
46 -/**
47 - * Unit test case for inter-jar linker.
48 - */
49 -public class InterJarLinkingTest {
50 -
51 - private final YangUtilManager utilManager = new YangUtilManager();
52 -
53 - private static final String TARGET = "target/interJarFileLinking";
54 - private static final String SEARCH_DIR_FOR_YANG_FILES = "src/test/resources/interJarFileLinking/yangFiles";
55 - private static final String SEARCH_DIR_FOR_SINGLE_JAR_FILES = "src/test/resources/interJarFileLinking/"
56 - + "jarFiles/single";
57 - private static final String SEARCH_DIR_FOR_MULTI_JAR_FILES = "src/test/resources/interJarFileLinking/"
58 - + "jarFiles/multi";
59 -
60 - /**
61 - * Unit test case for a single jar dependency.
62 - *
63 - * @throws IOException when fails to do IO operations
64 - * @throws MojoExecutionException when fails to do mojo operations
65 - */
66 - @Test
67 - public void processSingleJarLinking()
68 - throws IOException, MojoExecutionException {
69 - utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(SEARCH_DIR_FOR_YANG_FILES));
70 -
71 - int size1 = utilManager.getYangFileInfoSet().size();
72 -
73 - for (String file : getListOfTestJar(SEARCH_DIR_FOR_SINGLE_JAR_FILES)) {
74 - addInterJarRootNodes(file);
75 - }
76 -
77 - utilManager.parseYangFileInfoSet();
78 -
79 - utilManager.resolveDependenciesUsingLinker();
80 -
81 - Iterator<YangFileInfo> yangFileInfoIterator = utilManager.getYangFileInfoSet().iterator();
82 -
83 - YangFileInfo yangFileInfo = yangFileInfoIterator.next();
84 -
85 - int size2 = utilManager.getYangFileInfoSet().size();
86 - assertThat(true, is(size1 != size2));
87 - assertThat(true, is(yangFileInfo.getRootNode().getName().equals("port-pair")));
88 -
89 - deleteDirectory(TARGET);
90 -
91 - }
92 -
93 - /**
94 - * Unit test case for a multiple jar dependency.
95 - *
96 - * @throws IOException when fails to do IO operations
97 - * @throws MojoExecutionException when fails to do mojo operations
98 - */
99 - @Test
100 - public void processMultipleJarLinking()
101 - throws IOException, MojoExecutionException {
102 - utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(SEARCH_DIR_FOR_YANG_FILES));
103 -
104 - int size1 = utilManager.getYangFileInfoSet().size();
105 -
106 - for (String file : getListOfTestJar(SEARCH_DIR_FOR_MULTI_JAR_FILES)) {
107 - addInterJarRootNodes(file);
108 - }
109 -
110 - utilManager.parseYangFileInfoSet();
111 -
112 - utilManager.resolveDependenciesUsingLinker();
113 -
114 - Iterator<YangFileInfo> yangFileInfoIterator = utilManager.getYangFileInfoSet().iterator();
115 -
116 - YangFileInfo yangFileInfo = yangFileInfoIterator.next();
117 -
118 - int size2 = utilManager.getYangFileInfoSet().size();
119 - assertThat(true, is(size1 != size2));
120 - assertThat(true, is(yangFileInfo.getRootNode().getName().equals("port-pair")));
121 -
122 - yangFileInfo = yangFileInfoIterator.next();
123 - assertThat(true, is(yangFileInfo.getRootNode().getName().equals("flow-classifier")));
124 -
125 - /*
126 - * grouping flow-classifier {
127 - * container flow-classifier {
128 - * leaf id {
129 - * type flow-classifier-id;
130 - * }
131 - *
132 - * leaf tenant-id {
133 - * type port-pair:tenant-id;
134 - * }
135 - * .
136 - * .
137 - * .
138 - *
139 - */
140 -
141 - YangNode node = yangFileInfo.getRootNode();
142 - node = node.getChild();
143 - while (node != null) {
144 - if (node instanceof YangGrouping) {
145 - break;
146 - }
147 - node = node.getNextSibling();
148 - }
149 -
150 - node = node.getChild();
151 - ListIterator<YangLeaf> leafIterator = ((YangContainer) node).getListOfLeaf().listIterator();
152 - YangLeaf leafInfo = leafIterator.next();
153 -
154 - assertThat(leafInfo.getName(), is("id"));
155 - assertThat(leafInfo.getDataType().getDataTypeName(), is("flow-classifier-id"));
156 - assertThat(leafInfo.getDataType().getDataType(), is(DERIVED));
157 -
158 - leafInfo = leafIterator.next();
159 -
160 - assertThat(leafInfo.getName(), is("tenant-id"));
161 - assertThat(leafInfo.getDataType().getDataType(), is(DERIVED));
162 -
163 - assertThat(true, is(((YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo()).getReferredTypeDef()
164 - .getName().equals("tenant-id")));
165 -
166 - assertThat(leafInfo.getDataType().getResolvableStatus(), is(RESOLVED));
167 -
168 - YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo();
169 -
170 - // Check for the effective built-in type.
171 - assertThat(derivedInfo.getEffectiveBuiltInType(), is(STRING));
172 -
173 - deleteDirectory(TARGET);
174 - }
175 -
176 - /**
177 - * Returns list of test jar files.
178 - *
179 - * @param searchdir search directory
180 - * @return list of test jar files
181 - */
182 - private List<String> getListOfTestJar(String searchdir) {
183 - List<String> jarFiles = new ArrayList<>();
184 -
185 - File directory = new File(searchdir + "/");
186 - File[] files = directory.listFiles();
187 -
188 - for (File file : files) {
189 - jarFiles.add(file.toString());
190 - }
191 -
192 - return jarFiles;
193 - }
194 -
195 - /**
196 - * Adds data model nodes of jar to file info set.
197 - *
198 - * @param jarFile jar file name
199 - * @throws IOException when fails to do IO operations
200 - */
201 - private void addInterJarRootNodes(String jarFile) throws IOException {
202 - try {
203 - List<YangNode> interJarResolvedNodes = deSerializeDataModel(parseJarFile(jarFile, TARGET));
204 -
205 - for (YangNode node : interJarResolvedNodes) {
206 - YangFileInfo dependentFileInfo = new YangFileInfo();
207 - dependentFileInfo.setRootNode(node);
208 - dependentFileInfo.setForTranslator(false);
209 - dependentFileInfo.setYangFileName(node.getName());
210 - utilManager.getYangFileInfoSet().add(dependentFileInfo);
211 - }
212 - } catch (IOException e) {
213 - throw new IOException("failed to resolve in interjar scenario.");
214 - }
215 - }
216 -
217 -}
...@@ -26,8 +26,10 @@ import org.onosproject.yangutils.datamodel.YangNode; ...@@ -26,8 +26,10 @@ import org.onosproject.yangutils.datamodel.YangNode;
26 import org.onosproject.yangutils.datamodel.YangType; 26 import org.onosproject.yangutils.datamodel.YangType;
27 import org.onosproject.yangutils.datamodel.exceptions.DataModelException; 27 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
28 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 28 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
29 +import org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType;
29 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule; 30 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
30 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeDef; 31 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeDef;
32 +import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
31 33
32 import static org.hamcrest.core.Is.is; 34 import static org.hamcrest.core.Is.is;
33 import static org.hamcrest.core.IsNot.not; 35 import static org.hamcrest.core.IsNot.not;
...@@ -37,9 +39,9 @@ import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED; ...@@ -37,9 +39,9 @@ import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
37 import static org.onosproject.yangutils.datamodel.YangDataTypes.INT32; 39 import static org.onosproject.yangutils.datamodel.YangDataTypes.INT32;
38 import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING; 40 import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
39 import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT8; 41 import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT8;
40 -import static org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType.getJavaDataType; 42 +import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaDataType;
41 -import static org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType.getJavaImportClass; 43 +import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaImportClass;
42 -import static org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType.getJavaImportPackage; 44 +import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaImportPackage;
43 import static org.onosproject.yangutils.utils.UtilConstants.JAVA_LANG; 45 import static org.onosproject.yangutils.utils.UtilConstants.JAVA_LANG;
44 46
45 /** 47 /**
......
...@@ -22,6 +22,7 @@ import org.junit.Test; ...@@ -22,6 +22,7 @@ import org.junit.Test;
22 import org.onosproject.yangutils.datamodel.YangNode; 22 import org.onosproject.yangutils.datamodel.YangNode;
23 import org.onosproject.yangutils.parser.exceptions.ParserException; 23 import org.onosproject.yangutils.parser.exceptions.ParserException;
24 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; 24 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
25 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
25 26
26 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; 27 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode;
27 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; 28 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
......
...@@ -22,6 +22,7 @@ import org.junit.Test; ...@@ -22,6 +22,7 @@ import org.junit.Test;
22 import org.onosproject.yangutils.datamodel.YangNode; 22 import org.onosproject.yangutils.datamodel.YangNode;
23 import org.onosproject.yangutils.parser.exceptions.ParserException; 23 import org.onosproject.yangutils.parser.exceptions.ParserException;
24 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; 24 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
25 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
25 26
26 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; 27 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode;
27 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; 28 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
......
...@@ -23,16 +23,17 @@ import org.junit.Rule; ...@@ -23,16 +23,17 @@ import org.junit.Rule;
23 import org.junit.Test; 23 import org.junit.Test;
24 import org.junit.rules.ExpectedException; 24 import org.junit.rules.ExpectedException;
25 import org.onosproject.yangutils.translator.exception.TranslatorException; 25 import org.onosproject.yangutils.translator.exception.TranslatorException;
26 +import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
26 27
27 import static org.hamcrest.core.Is.is; 28 import static org.hamcrest.core.Is.is;
28 import static org.hamcrest.core.IsNot.not; 29 import static org.hamcrest.core.IsNot.not;
29 import static org.junit.Assert.assertThat; 30 import static org.junit.Assert.assertThat;
30 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; 31 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase;
31 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; 32 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
32 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getJavaPackageFromPackagePath; 33 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getJavaPackageFromPackagePath;
33 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage; 34 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getPackageDirPathFromJavaJPackage;
34 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage; 35 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
35 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase; 36 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getSmallCase;
36 import static org.onosproject.yangutils.utils.UtilConstants.DEFAULT_BASE_PKG; 37 import static org.onosproject.yangutils.utils.UtilConstants.DEFAULT_BASE_PKG;
37 import static org.onosproject.yangutils.utils.UtilConstants.PERIOD; 38 import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
38 39
......
...@@ -23,13 +23,14 @@ import org.junit.Test; ...@@ -23,13 +23,14 @@ import org.junit.Test;
23 import org.onosproject.yangutils.datamodel.YangType; 23 import org.onosproject.yangutils.datamodel.YangType;
24 import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo; 24 import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo;
25 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo; 25 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
26 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
26 27
27 import static org.hamcrest.core.Is.is; 28 import static org.hamcrest.core.Is.is;
28 import static org.hamcrest.core.IsNot.not; 29 import static org.hamcrest.core.IsNot.not;
29 import static org.junit.Assert.assertThat; 30 import static org.junit.Assert.assertThat;
30 import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING; 31 import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
31 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER; 32 import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER;
32 -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; 33 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
33 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuild; 34 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuild;
34 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuildForInterface; 35 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuildForInterface;
35 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getCheckNotNull; 36 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getCheckNotNull;
......
...@@ -22,6 +22,7 @@ import org.junit.Test; ...@@ -22,6 +22,7 @@ import org.junit.Test;
22 import org.onosproject.yangutils.datamodel.YangNode; 22 import org.onosproject.yangutils.datamodel.YangNode;
23 import org.onosproject.yangutils.parser.exceptions.ParserException; 23 import org.onosproject.yangutils.parser.exceptions.ParserException;
24 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; 24 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
25 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
25 26
26 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; 27 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode;
27 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; 28 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
......
...@@ -22,6 +22,7 @@ import org.junit.Test; ...@@ -22,6 +22,7 @@ import org.junit.Test;
22 import org.onosproject.yangutils.datamodel.YangNode; 22 import org.onosproject.yangutils.datamodel.YangNode;
23 import org.onosproject.yangutils.parser.exceptions.ParserException; 23 import org.onosproject.yangutils.parser.exceptions.ParserException;
24 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; 24 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
25 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
25 26
26 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; 27 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode;
27 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; 28 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
......
...@@ -22,6 +22,7 @@ import org.junit.Test; ...@@ -22,6 +22,7 @@ import org.junit.Test;
22 import org.onosproject.yangutils.datamodel.YangNode; 22 import org.onosproject.yangutils.datamodel.YangNode;
23 import org.onosproject.yangutils.parser.exceptions.ParserException; 23 import org.onosproject.yangutils.parser.exceptions.ParserException;
24 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; 24 import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
25 +import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
25 26
26 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode; 27 import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode;
27 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; 28 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
......
...@@ -25,7 +25,6 @@ import org.junit.Test; ...@@ -25,7 +25,6 @@ import org.junit.Test;
25 import org.onosproject.yangutils.datamodel.YangNode; 25 import org.onosproject.yangutils.datamodel.YangNode;
26 import org.onosproject.yangutils.translator.tojava.JavaFileInfo; 26 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
27 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule; 27 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
28 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
29 28
30 import static org.apache.commons.io.FileUtils.deleteDirectory; 29 import static org.apache.commons.io.FileUtils.deleteDirectory;
31 import static org.hamcrest.core.Is.is; 30 import static org.hamcrest.core.Is.is;
...@@ -34,8 +33,8 @@ import static org.junit.Assert.assertThat; ...@@ -34,8 +33,8 @@ import static org.junit.Assert.assertThat;
34 import static org.onosproject.yangutils.utils.UtilConstants.PERIOD; 33 import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
35 import static org.onosproject.yangutils.utils.UtilConstants.SLASH; 34 import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
36 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.appendFileContents; 35 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.appendFileContents;
37 -import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage; 36 +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.createPackage;
38 -import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.doesPackageExist; 37 +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.doesPackageExist;
39 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.updateFileHandle; 38 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.updateFileHandle;
40 39
41 /** 40 /**
......
...@@ -22,7 +22,6 @@ import java.lang.reflect.InvocationTargetException; ...@@ -22,7 +22,6 @@ import java.lang.reflect.InvocationTargetException;
22 import org.junit.Rule; 22 import org.junit.Rule;
23 import org.junit.Test; 23 import org.junit.Test;
24 import org.junit.rules.ExpectedException; 24 import org.junit.rules.ExpectedException;
25 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
26 25
27 import static org.hamcrest.core.Is.is; 26 import static org.hamcrest.core.Is.is;
28 import static org.hamcrest.core.IsNot.not; 27 import static org.hamcrest.core.IsNot.not;
...@@ -207,4 +206,4 @@ public final class JavaDocGenTest { ...@@ -207,4 +206,4 @@ public final class JavaDocGenTest {
207 pluginConfig.setConflictResolver(null); 206 pluginConfig.setConflictResolver(null);
208 return pluginConfig; 207 return pluginConfig;
209 } 208 }
210 -}
...\ No newline at end of file ...\ No newline at end of file
209 +}
......
...@@ -26,17 +26,15 @@ import org.apache.maven.project.MavenProject; ...@@ -26,17 +26,15 @@ import org.apache.maven.project.MavenProject;
26 import org.junit.Rule; 26 import org.junit.Rule;
27 import org.junit.Test; 27 import org.junit.Test;
28 import org.junit.rules.ExpectedException; 28 import org.junit.rules.ExpectedException;
29 -import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
30 import org.onosproject.yangutils.utils.UtilConstants; 29 import org.onosproject.yangutils.utils.UtilConstants;
31 import org.sonatype.plexus.build.incremental.BuildContext; 30 import org.sonatype.plexus.build.incremental.BuildContext;
32 import org.sonatype.plexus.build.incremental.DefaultBuildContext; 31 import org.sonatype.plexus.build.incremental.DefaultBuildContext;
33 32
34 -import static org.apache.commons.io.FileUtils.deleteDirectory;
35 import static org.hamcrest.core.Is.is; 33 import static org.hamcrest.core.Is.is;
36 import static org.hamcrest.core.IsNot.not; 34 import static org.hamcrest.core.IsNot.not;
37 import static org.junit.Assert.assertThat; 35 import static org.junit.Assert.assertThat;
38 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.addPackageInfo; 36 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.addPackageInfo;
39 -import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.addToCompilationRoot; 37 +import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.addToCompilationRoot;
40 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; 38 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
41 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.createDirectories; 39 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.createDirectories;
42 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.trimAtLast; 40 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.trimAtLast;
......