blob: 72407257a79334f386bd18b7d5652afeb723079a [file] [log] [blame]
Vinod Kumar S7a004de2016-02-05 16:15:09 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Vinod Kumar S7a004de2016-02-05 16:15:09 +05303 *
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
17package org.onosproject.yangutils.plugin.manager;
18
Bharat saraswal6ef0b762016-04-05 12:45:45 +053019import java.io.IOException;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053020import java.util.HashSet;
Bharat saraswalec4ef7c2016-02-11 22:00:49 +053021import java.util.Iterator;
22import java.util.List;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053023import java.util.Set;
Bharat saraswal96dfef02016-06-16 00:29:12 +053024import org.apache.maven.artifact.repository.ArtifactRepository;
Vinod Kumar S7a004de2016-02-05 16:15:09 +053025import org.apache.maven.plugin.AbstractMojo;
26import org.apache.maven.plugin.MojoExecutionException;
27import org.apache.maven.plugin.MojoFailureException;
Bharat saraswal870c56f2016-02-20 21:57:16 +053028import org.apache.maven.plugins.annotations.Component;
Vinod Kumar S7a004de2016-02-05 16:15:09 +053029import org.apache.maven.plugins.annotations.Mojo;
Bharat saraswal870c56f2016-02-20 21:57:16 +053030import org.apache.maven.plugins.annotations.Parameter;
Bharat saraswalec4ef7c2016-02-11 22:00:49 +053031import org.apache.maven.project.MavenProject;
Bharat saraswalec4ef7c2016-02-11 22:00:49 +053032import org.onosproject.yangutils.datamodel.YangNode;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053033import org.onosproject.yangutils.linker.YangLinker;
34import org.onosproject.yangutils.linker.exceptions.LinkerException;
35import org.onosproject.yangutils.linker.impl.YangLinkerManager;
Bharat saraswalec4ef7c2016-02-11 22:00:49 +053036import org.onosproject.yangutils.parser.YangUtilsParser;
37import org.onosproject.yangutils.parser.exceptions.ParserException;
Bharat saraswal870c56f2016-02-20 21:57:16 +053038import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
Bharat saraswalec4ef7c2016-02-11 22:00:49 +053039import org.onosproject.yangutils.utils.io.impl.YangFileScanner;
Gaurav Agrawal8a5af142016-06-15 13:58:01 +053040import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
41import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
Bharat saraswal870c56f2016-02-20 21:57:16 +053042import org.sonatype.plexus.build.incremental.BuildContext;
Vinod Kumar S7a004de2016-02-05 16:15:09 +053043
Bharat saraswale2d51d62016-03-23 19:40:35 +053044import static org.apache.maven.plugins.annotations.LifecyclePhase.GENERATE_SOURCES;
45import static org.apache.maven.plugins.annotations.ResolutionScope.COMPILE;
Gaurav Agrawal8a5af142016-06-15 13:58:01 +053046import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.addToCompilationRoot;
47import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.copyYangFilesToTarget;
48import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.resolveInterJarDependencies;
49import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.serializeDataModel;
Vinod Kumar S38046502016-03-23 15:30:27 +053050import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode;
Bharat saraswal6ef0b762016-04-05 12:45:45 +053051import static org.onosproject.yangutils.translator.tojava.JavaCodeGeneratorUtil.translatorErrorHandler;
Bharat saraswale2d51d62016-03-23 19:40:35 +053052import static org.onosproject.yangutils.utils.UtilConstants.DEFAULT_BASE_PKG;
53import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
54import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053055import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
Vinod Kumar S38046502016-03-23 15:30:27 +053056import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getDirectory;
Gaurav Agrawal8a5af142016-06-15 13:58:01 +053057import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getPackageDirPathFromJavaJPackage;
Vinod Kumar S38046502016-03-23 15:30:27 +053058
Vinod Kumar S7a004de2016-02-05 16:15:09 +053059/**
Bharat saraswald9822e92016-04-05 15:13:44 +053060 * Represents ONOS YANG utility maven plugin.
Bharat saraswalef2e6392016-04-19 19:50:32 +053061 * Goal of plugin is yang2java.
62 * Execution phase is generate-sources.
63 * requiresDependencyResolution at compile time.
Bharat saraswalec4ef7c2016-02-11 22:00:49 +053064 */
Bharat saraswale2d51d62016-03-23 19:40:35 +053065@Mojo(name = "yang2java", defaultPhase = GENERATE_SOURCES, requiresDependencyResolution = COMPILE,
Gaurav Agrawal8a5af142016-06-15 13:58:01 +053066 requiresProject = true)
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +053067public class YangUtilManager
68 extends AbstractMojo {
Vinod Kumar S7a004de2016-02-05 16:15:09 +053069
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053070 private YangNode rootNode;
71 // YANG file information set.
72 private Set<YangFileInfo> yangFileInfoSet = new HashSet<>();
73 private YangUtilsParser yangUtilsParser = new YangUtilsParserManager();
74 private YangLinker yangLinker = new YangLinkerManager();
Bharat saraswal33dfa012016-05-17 19:59:16 +053075 private YangFileInfo curYangFileInfo = new YangFileInfo();
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053076
Gaurav Agrawal8a5af142016-06-15 13:58:01 +053077 private Set<YangNode> yangNodeSet = new HashSet<>();
78
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053079 private static final String DEFAULT_PKG = SLASH + getPackageDirPathFromJavaJPackage(DEFAULT_BASE_PKG);
80
Bharat saraswalec4ef7c2016-02-11 22:00:49 +053081 /**
82 * Source directory for YANG files.
83 */
84 @Parameter(property = "yangFilesDir", defaultValue = "src/main/yang")
85 private String yangFilesDir;
86
87 /**
Bharat saraswal8f2a6c52016-03-09 18:34:56 +053088 * Source directory for generated files.
89 */
90 @Parameter(property = "genFilesDir", defaultValue = "src/main/java")
91 private String genFilesDir;
92
93 /**
Bharat saraswal2f00b4b2016-03-04 20:08:09 +053094 * Base directory for project.
95 */
96 @Parameter(property = "basedir", defaultValue = "${basedir}")
97 private String baseDir;
98
99 /**
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530100 * Output directory.
101 */
102 @Parameter(property = "project.build.outputDirectory", required = true, defaultValue = "target/classes")
Vinod Kumar S38046502016-03-23 15:30:27 +0530103 private String outputDirectory;
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530104
105 /**
106 * Current maven project.
107 */
108 @Parameter(property = "project", required = true, readonly = true, defaultValue = "${project}")
109 private MavenProject project;
110
111 /**
janani bde4ffab2016-04-15 16:18:30 +0530112 * Replacement required for period special character in the identifier.
113 */
114 @Parameter(property = "replacementForPeriod")
115 private String replacementForPeriod;
116
117 /**
118 * Replacement required for underscore special character in the identifier.
119 */
120 @Parameter(property = "replacementForUnderscore")
121 private String replacementForUnderscore;
122
123 /**
124 * Replacement required for hyphen special character in the identifier.
125 */
126 @Parameter(property = "replacementForHyphen")
127 private String replacementForHyphen;
128
129 /**
janani bdd1314f2016-05-19 17:39:50 +0530130 * Prefix which is required for adding with the identifier.
131 */
132 @Parameter(property = "prefixForIdentifier")
133 private String prefixForIdentifier;
134
135 /**
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530136 * Build context.
137 */
138 @Component
139 private BuildContext context;
140
Bharat saraswal96dfef02016-06-16 00:29:12 +0530141 @Parameter(readonly = true, defaultValue = "${localRepository}")
142 private ArtifactRepository localRepository;
143
144 @Parameter(readonly = true, defaultValue = "${project.remoteArtifactRepositories}")
145 private List<ArtifactRepository> remoteRepository;
146
Vinod Kumar S7a004de2016-02-05 16:15:09 +0530147 @Override
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530148 public void execute()
149 throws MojoExecutionException, MojoFailureException {
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530150
151 try {
Bharat saraswal870c56f2016-02-20 21:57:16 +0530152
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530153 /*
Bharat saraswal870c56f2016-02-20 21:57:16 +0530154 * For deleting the generated code in previous build.
155 */
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530156 deleteDirectory(getDirectory(baseDir, genFilesDir) + DEFAULT_PKG);
157 deleteDirectory(getDirectory(baseDir, outputDirectory));
Bharat saraswal870c56f2016-02-20 21:57:16 +0530158
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530159 String searchDir = getDirectory(baseDir, yangFilesDir);
160 String codeGenDir = getDirectory(baseDir, genFilesDir) + SLASH;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530161
162 // Creates conflict resolver and set values to it.
janani bde4ffab2016-04-15 16:18:30 +0530163 YangToJavaNamingConflictUtil conflictResolver = new YangToJavaNamingConflictUtil();
164 conflictResolver.setReplacementForPeriod(replacementForPeriod);
165 conflictResolver.setReplacementForHyphen(replacementForHyphen);
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530166 conflictResolver.setReplacementForUnderscore(replacementForUnderscore);
janani bdd1314f2016-05-19 17:39:50 +0530167 conflictResolver.setPrefixForIdentifier(prefixForIdentifier);
janani bde4ffab2016-04-15 16:18:30 +0530168 YangPluginConfig yangPlugin = new YangPluginConfig();
169 yangPlugin.setCodeGenDir(codeGenDir);
170 yangPlugin.setConflictResolver(conflictResolver);
Vidyashree Rama1db15562016-05-17 16:16:15 +0530171
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530172 /*
173 * Obtain the YANG files at a path mentioned in plugin and creates
174 * YANG file information set.
175 */
176 createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
Bharat saraswal870c56f2016-02-20 21:57:16 +0530177
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530178 // Check if there are any file to translate, if not return.
179 if (getYangFileInfoSet() == null || getYangFileInfoSet().isEmpty()) {
180 // No files to translate
181 return;
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530182 }
Bharat saraswal96dfef02016-06-16 00:29:12 +0530183 // Resolve inter jar dependency.
184 resolveInterJardependency();
Bharat saraswal870c56f2016-02-20 21:57:16 +0530185
Bharat saraswal33dfa012016-05-17 19:59:16 +0530186 // Carry out the parsing for all the YANG files.
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530187 parseYangFileInfoSet();
Vidyashree Rama1db15562016-05-17 16:16:15 +0530188
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530189 // Resolve dependencies using linker.
190 resolveDependenciesUsingLinker();
191
192 // Perform translation to JAVA.
193 translateToJava(getYangFileInfoSet(), yangPlugin);
Vidyashree Rama1db15562016-05-17 16:16:15 +0530194
Bharat saraswal96dfef02016-06-16 00:29:12 +0530195 // Serialize data model.
196 serializeDataModel(getDirectory(baseDir, outputDirectory), getYangFileInfoSet(), project, true);
197
198 addToCompilationRoot(getDirectory(baseDir, genFilesDir), project, context);
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530199
200 copyYangFilesToTarget(getYangFileInfoSet(), getDirectory(baseDir, outputDirectory), project);
janani bdd1314f2016-05-19 17:39:50 +0530201 } catch (IOException | ParserException e) {
Bharat saraswal96dfef02016-06-16 00:29:12 +0530202 getLog().info(e);
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530203 String fileName = "";
Bharat saraswal33dfa012016-05-17 19:59:16 +0530204 if (getCurYangFileInfo() != null) {
205 fileName = getCurYangFileInfo().getYangFileName();
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530206 }
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530207 try {
208 translatorErrorHandler(getRootNode());
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530209 deleteDirectory(getDirectory(baseDir, genFilesDir) + DEFAULT_PKG);
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530210 } catch (IOException ex) {
211 throw new MojoExecutionException(
212 "Error handler failed to delete files for data model node.");
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530213 }
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530214 throw new MojoExecutionException(
215 "Exception occured due to " + e.getLocalizedMessage() + " in " + fileName
216 + " YANG file.");
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530217 }
Vinod Kumar S7a004de2016-02-05 16:15:09 +0530218 }
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530219
220 /**
Gaurav Agrawal8a5af142016-06-15 13:58:01 +0530221 * Returns the YANG node set.
222 *
223 * @return YANG node set
224 */
225 public Set<YangNode> getYangNodeSet() {
226 return yangNodeSet;
227 }
228
229 /**
Bharat saraswal96dfef02016-06-16 00:29:12 +0530230 * Resolved inter-jar dependencies.
231 *
232 * @throws IOException when fails to do IO operations
233 */
234 public void resolveInterJardependency() throws IOException {
235 try {
236 List<YangNode> interJarResolvedNodes = resolveInterJarDependencies(project, localRepository,
237 remoteRepository, getDirectory(baseDir, outputDirectory));
238 for (YangNode node : interJarResolvedNodes) {
239 YangFileInfo dependentFileInfo = new YangFileInfo();
240 dependentFileInfo.setRootNode(node);
241 dependentFileInfo.setForTranslator(false);
242 dependentFileInfo.setYangFileName(node.getName());
243 getYangFileInfoSet().add(dependentFileInfo);
244 }
245 } catch (IOException e) {
246 throw new IOException("failed to resolve in interjar scenario.");
247 }
248 }
249
250 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530251 * Links all the provided with the YANG file info set.
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530252 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530253 * @throws MojoExecutionException a violation in mojo excecution
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530254 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530255 public void resolveDependenciesUsingLinker()
256 throws MojoExecutionException {
Gaurav Agrawal8a5af142016-06-15 13:58:01 +0530257 createYangNodeSet();
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530258 for (YangFileInfo yangFileInfo : getYangFileInfoSet()) {
Bharat saraswal33dfa012016-05-17 19:59:16 +0530259 setCurYangFileInfo(yangFileInfo);
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530260 try {
Gaurav Agrawal8a5af142016-06-15 13:58:01 +0530261 yangLinker.resolveDependencies(getYangNodeSet());
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530262 } catch (LinkerException e) {
263 throw new MojoExecutionException(e.getMessage());
264 }
265 }
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530266 }
267
268 /**
Gaurav Agrawal8a5af142016-06-15 13:58:01 +0530269 * Creates YANG nodes set.
270 */
271 public void createYangNodeSet() {
272 for (YangFileInfo yangFileInfo : getYangFileInfoSet()) {
273 getYangNodeSet().add(yangFileInfo.getRootNode());
274 }
275 }
276
277 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530278 * Parses all the provided YANG files and generates YANG data model tree.
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530279 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530280 * @throws IOException a violation in IO
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530281 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530282 public void parseYangFileInfoSet()
283 throws IOException {
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530284 for (YangFileInfo yangFileInfo : getYangFileInfoSet()) {
Bharat saraswal33dfa012016-05-17 19:59:16 +0530285 setCurYangFileInfo(yangFileInfo);
Bharat saraswal96dfef02016-06-16 00:29:12 +0530286 if (yangFileInfo.isForTranslator()) {
287 try {
288 YangNode yangNode = yangUtilsParser.getDataModel(yangFileInfo.getYangFileName());
289 yangFileInfo.setRootNode(yangNode);
290 setRootNode(yangNode);
291 } catch (ParserException e) {
292 String logInfo = "Error in file: " + e.getFileName();
293 if (e.getLineNumber() != 0) {
294 logInfo = logInfo + " at line: " + e.getLineNumber() + " at position: "
295 + e.getCharPositionInLine();
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530296
Bharat saraswal96dfef02016-06-16 00:29:12 +0530297 }
298 if (e.getMessage() != null) {
299 logInfo = logInfo + NEW_LINE + e.getMessage();
300 }
301 getLog().info(logInfo);
302 throw e;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530303 }
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530304 }
305 }
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530306 }
307
308 /**
309 * Returns current root YANG node of data-model tree.
310 *
311 * @return current root YANG node of data-model tree
312 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530313 private YangNode getRootNode() {
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530314 return rootNode;
315 }
316
317 /**
318 * Sets current root YANG node of data-model tree.
319 *
320 * @param rootNode current root YANG node of data-model tree
321 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530322 private void setRootNode(YangNode rootNode) {
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530323 this.rootNode = rootNode;
324 }
325
Vidyashree Rama1db15562016-05-17 16:16:15 +0530326 /**
327 * Translates to java code corresponding to the YANG schema.
328 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530329 * @param yangFileInfoSet YANG file information
330 * @param yangPlugin YANG plugin config
Vidyashree Rama1db15562016-05-17 16:16:15 +0530331 * @throws IOException when fails to generate java code file the current
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530332 * node
Vidyashree Rama1db15562016-05-17 16:16:15 +0530333 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530334 public void translateToJava(Set<YangFileInfo> yangFileInfoSet, YangPluginConfig yangPlugin)
Vidyashree Rama1db15562016-05-17 16:16:15 +0530335 throws IOException {
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530336 Iterator<YangFileInfo> yangFileIterator = yangFileInfoSet.iterator();
Vidyashree Rama1db15562016-05-17 16:16:15 +0530337 while (yangFileIterator.hasNext()) {
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530338 YangFileInfo yangFileInfo = yangFileIterator.next();
Bharat saraswal33dfa012016-05-17 19:59:16 +0530339 setCurYangFileInfo(yangFileInfo);
Bharat saraswal96dfef02016-06-16 00:29:12 +0530340 if (yangFileInfo.isForTranslator()) {
341 generateJavaCode(yangFileInfo.getRootNode(), yangPlugin);
342 }
Vidyashree Rama1db15562016-05-17 16:16:15 +0530343 }
344 }
345
346 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530347 * Creates a YANG file info set.
Vidyashree Rama1db15562016-05-17 16:16:15 +0530348 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530349 * @param yangFileList YANG files list
Vidyashree Rama1db15562016-05-17 16:16:15 +0530350 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530351 public void createYangFileInfoSet(List<String> yangFileList) {
352 for (String yangFile : yangFileList) {
353 YangFileInfo yangFileInfo = new YangFileInfo();
354 yangFileInfo.setYangFileName(yangFile);
355 getYangFileInfoSet().add(yangFileInfo);
Vidyashree Rama1db15562016-05-17 16:16:15 +0530356 }
357 }
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530358
359 /**
360 * Returns the YANG file info set.
361 *
362 * @return the YANG file info set
363 */
364 public Set<YangFileInfo> getYangFileInfoSet() {
365 return yangFileInfoSet;
366 }
367
368 /**
369 * Sets the YANG file info set.
370 *
371 * @param yangFileInfoSet the YANG file info set
372 */
373 public void setYangFileInfoSet(Set<YangFileInfo> yangFileInfoSet) {
374 this.yangFileInfoSet = yangFileInfoSet;
375 }
Bharat saraswal33dfa012016-05-17 19:59:16 +0530376
377 /**
378 * Returns current YANG file's info.
379 *
380 * @return the yangFileInfo
381 */
382 public YangFileInfo getCurYangFileInfo() {
383 return curYangFileInfo;
384 }
385
386 /**
387 * Sets current YANG file's info.
388 *
389 * @param yangFileInfo the yangFileInfo to set
390 */
391 public void setCurYangFileInfo(YangFileInfo yangFileInfo) {
Bharat saraswal96dfef02016-06-16 00:29:12 +0530392 curYangFileInfo = yangFileInfo;
Bharat saraswal33dfa012016-05-17 19:59:16 +0530393 }
Vinod Kumar S38046502016-03-23 15:30:27 +0530394}