blob: 7a894e6ceaa696778002831f1a2891cbde364797 [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 */
Bharat saraswalb1170bd2016-07-14 13:26:18 +053090 @Parameter(property = "classFileDir", defaultValue = "target/generated-sources")
91 private String classFileDir;
92
93 /**
94 * Source directory for manager's generated files.
95 */
96 @Parameter(property = "managerFileDir", defaultValue = "src/main/java")
97 private String managerFileDir;
Bharat saraswal8f2a6c52016-03-09 18:34:56 +053098
99 /**
Bharat saraswal2f00b4b2016-03-04 20:08:09 +0530100 * Base directory for project.
101 */
102 @Parameter(property = "basedir", defaultValue = "${basedir}")
103 private String baseDir;
104
105 /**
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530106 * Output directory.
107 */
108 @Parameter(property = "project.build.outputDirectory", required = true, defaultValue = "target/classes")
Vinod Kumar S38046502016-03-23 15:30:27 +0530109 private String outputDirectory;
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530110
111 /**
112 * Current maven project.
113 */
114 @Parameter(property = "project", required = true, readonly = true, defaultValue = "${project}")
115 private MavenProject project;
116
117 /**
janani bde4ffab2016-04-15 16:18:30 +0530118 * Replacement required for period special character in the identifier.
119 */
120 @Parameter(property = "replacementForPeriod")
121 private String replacementForPeriod;
122
123 /**
124 * Replacement required for underscore special character in the identifier.
125 */
126 @Parameter(property = "replacementForUnderscore")
127 private String replacementForUnderscore;
128
129 /**
130 * Replacement required for hyphen special character in the identifier.
131 */
132 @Parameter(property = "replacementForHyphen")
133 private String replacementForHyphen;
134
135 /**
janani bdd1314f2016-05-19 17:39:50 +0530136 * Prefix which is required for adding with the identifier.
137 */
138 @Parameter(property = "prefixForIdentifier")
139 private String prefixForIdentifier;
140
141 /**
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530142 * Build context.
143 */
144 @Component
145 private BuildContext context;
146
Bharat saraswal96dfef02016-06-16 00:29:12 +0530147 @Parameter(readonly = true, defaultValue = "${localRepository}")
148 private ArtifactRepository localRepository;
149
150 @Parameter(readonly = true, defaultValue = "${project.remoteArtifactRepositories}")
151 private List<ArtifactRepository> remoteRepository;
152
Vinod Kumar S7a004de2016-02-05 16:15:09 +0530153 @Override
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530154 public void execute()
155 throws MojoExecutionException, MojoFailureException {
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530156
157 try {
Bharat saraswal870c56f2016-02-20 21:57:16 +0530158
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530159 /*
Bharat saraswal870c56f2016-02-20 21:57:16 +0530160 * For deleting the generated code in previous build.
161 */
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530162 deleteDirectory(getDirectory(baseDir, classFileDir) + DEFAULT_PKG);
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530163 deleteDirectory(getDirectory(baseDir, outputDirectory));
Bharat saraswal870c56f2016-02-20 21:57:16 +0530164
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530165 String searchDir = getDirectory(baseDir, yangFilesDir);
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530166 String codeGenDir = getDirectory(baseDir, classFileDir) + SLASH;
167 String managerCodeGenDir = getDirectory(baseDir, managerFileDir) + SLASH;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530168
169 // Creates conflict resolver and set values to it.
janani bde4ffab2016-04-15 16:18:30 +0530170 YangToJavaNamingConflictUtil conflictResolver = new YangToJavaNamingConflictUtil();
171 conflictResolver.setReplacementForPeriod(replacementForPeriod);
172 conflictResolver.setReplacementForHyphen(replacementForHyphen);
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530173 conflictResolver.setReplacementForUnderscore(replacementForUnderscore);
janani bdd1314f2016-05-19 17:39:50 +0530174 conflictResolver.setPrefixForIdentifier(prefixForIdentifier);
janani bde4ffab2016-04-15 16:18:30 +0530175 YangPluginConfig yangPlugin = new YangPluginConfig();
176 yangPlugin.setCodeGenDir(codeGenDir);
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530177 yangPlugin.setManagerCodeGenDir(managerCodeGenDir);
janani bde4ffab2016-04-15 16:18:30 +0530178 yangPlugin.setConflictResolver(conflictResolver);
Vidyashree Rama1db15562016-05-17 16:16:15 +0530179
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530180 /*
181 * Obtain the YANG files at a path mentioned in plugin and creates
182 * YANG file information set.
183 */
184 createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
Bharat saraswal870c56f2016-02-20 21:57:16 +0530185
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530186 // Check if there are any file to translate, if not return.
187 if (getYangFileInfoSet() == null || getYangFileInfoSet().isEmpty()) {
188 // No files to translate
189 return;
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530190 }
Bharat saraswal96dfef02016-06-16 00:29:12 +0530191 // Resolve inter jar dependency.
192 resolveInterJardependency();
Bharat saraswal870c56f2016-02-20 21:57:16 +0530193
Bharat saraswal33dfa012016-05-17 19:59:16 +0530194 // Carry out the parsing for all the YANG files.
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530195 parseYangFileInfoSet();
Vidyashree Rama1db15562016-05-17 16:16:15 +0530196
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530197 // Resolve dependencies using linker.
198 resolveDependenciesUsingLinker();
199
200 // Perform translation to JAVA.
201 translateToJava(getYangFileInfoSet(), yangPlugin);
Vidyashree Rama1db15562016-05-17 16:16:15 +0530202
Bharat saraswal96dfef02016-06-16 00:29:12 +0530203 // Serialize data model.
204 serializeDataModel(getDirectory(baseDir, outputDirectory), getYangFileInfoSet(), project, true);
205
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530206 addToCompilationRoot(codeGenDir, project, context);
207 addToCompilationRoot(managerCodeGenDir, project, context);
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530208
209 copyYangFilesToTarget(getYangFileInfoSet(), getDirectory(baseDir, outputDirectory), project);
janani bdd1314f2016-05-19 17:39:50 +0530210 } catch (IOException | ParserException e) {
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530211 String fileName = "";
Bharat saraswal33dfa012016-05-17 19:59:16 +0530212 if (getCurYangFileInfo() != null) {
213 fileName = getCurYangFileInfo().getYangFileName();
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530214 }
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530215 try {
216 translatorErrorHandler(getRootNode());
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530217 deleteDirectory(getDirectory(baseDir, classFileDir) + DEFAULT_PKG);
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530218 } catch (IOException ex) {
219 throw new MojoExecutionException(
220 "Error handler failed to delete files for data model node.");
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530221 }
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530222 throw new MojoExecutionException(
223 "Exception occured due to " + e.getLocalizedMessage() + " in " + fileName
224 + " YANG file.");
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530225 }
Vinod Kumar S7a004de2016-02-05 16:15:09 +0530226 }
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530227
228 /**
Gaurav Agrawal8a5af142016-06-15 13:58:01 +0530229 * Returns the YANG node set.
230 *
231 * @return YANG node set
232 */
233 public Set<YangNode> getYangNodeSet() {
234 return yangNodeSet;
235 }
236
237 /**
Bharat saraswal96dfef02016-06-16 00:29:12 +0530238 * Resolved inter-jar dependencies.
239 *
240 * @throws IOException when fails to do IO operations
241 */
242 public void resolveInterJardependency() throws IOException {
243 try {
244 List<YangNode> interJarResolvedNodes = resolveInterJarDependencies(project, localRepository,
245 remoteRepository, getDirectory(baseDir, outputDirectory));
246 for (YangNode node : interJarResolvedNodes) {
247 YangFileInfo dependentFileInfo = new YangFileInfo();
248 dependentFileInfo.setRootNode(node);
249 dependentFileInfo.setForTranslator(false);
250 dependentFileInfo.setYangFileName(node.getName());
251 getYangFileInfoSet().add(dependentFileInfo);
252 }
253 } catch (IOException e) {
254 throw new IOException("failed to resolve in interjar scenario.");
255 }
256 }
257
258 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530259 * Links all the provided with the YANG file info set.
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530260 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530261 * @throws MojoExecutionException a violation in mojo excecution
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530262 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530263 public void resolveDependenciesUsingLinker()
264 throws MojoExecutionException {
Gaurav Agrawal8a5af142016-06-15 13:58:01 +0530265 createYangNodeSet();
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530266 try {
267 yangLinker.resolveDependencies(getYangNodeSet());
268 } catch (LinkerException e) {
269 throw new MojoExecutionException(e.getMessage());
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530270 }
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530271
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530272 }
273
274 /**
Gaurav Agrawal8a5af142016-06-15 13:58:01 +0530275 * Creates YANG nodes set.
276 */
277 public void createYangNodeSet() {
278 for (YangFileInfo yangFileInfo : getYangFileInfoSet()) {
279 getYangNodeSet().add(yangFileInfo.getRootNode());
280 }
281 }
282
283 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530284 * Parses all the provided YANG files and generates YANG data model tree.
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530285 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530286 * @throws IOException a violation in IO
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530287 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530288 public void parseYangFileInfoSet()
289 throws IOException {
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530290 for (YangFileInfo yangFileInfo : getYangFileInfoSet()) {
Bharat saraswal33dfa012016-05-17 19:59:16 +0530291 setCurYangFileInfo(yangFileInfo);
Bharat saraswal96dfef02016-06-16 00:29:12 +0530292 if (yangFileInfo.isForTranslator()) {
293 try {
294 YangNode yangNode = yangUtilsParser.getDataModel(yangFileInfo.getYangFileName());
295 yangFileInfo.setRootNode(yangNode);
296 setRootNode(yangNode);
297 } catch (ParserException e) {
298 String logInfo = "Error in file: " + e.getFileName();
299 if (e.getLineNumber() != 0) {
300 logInfo = logInfo + " at line: " + e.getLineNumber() + " at position: "
301 + e.getCharPositionInLine();
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530302
Bharat saraswal96dfef02016-06-16 00:29:12 +0530303 }
304 if (e.getMessage() != null) {
305 logInfo = logInfo + NEW_LINE + e.getMessage();
306 }
307 getLog().info(logInfo);
308 throw e;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530309 }
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530310 }
311 }
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530312 }
313
314 /**
315 * Returns current root YANG node of data-model tree.
316 *
317 * @return current root YANG node of data-model tree
318 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530319 private YangNode getRootNode() {
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530320 return rootNode;
321 }
322
323 /**
324 * Sets current root YANG node of data-model tree.
325 *
326 * @param rootNode current root YANG node of data-model tree
327 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530328 private void setRootNode(YangNode rootNode) {
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530329 this.rootNode = rootNode;
330 }
331
Vidyashree Rama1db15562016-05-17 16:16:15 +0530332 /**
333 * Translates to java code corresponding to the YANG schema.
334 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530335 * @param yangFileInfoSet YANG file information
336 * @param yangPlugin YANG plugin config
Vidyashree Rama1db15562016-05-17 16:16:15 +0530337 * @throws IOException when fails to generate java code file the current
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530338 * node
Vidyashree Rama1db15562016-05-17 16:16:15 +0530339 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530340 public void translateToJava(Set<YangFileInfo> yangFileInfoSet, YangPluginConfig yangPlugin)
Vidyashree Rama1db15562016-05-17 16:16:15 +0530341 throws IOException {
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530342 Iterator<YangFileInfo> yangFileIterator = yangFileInfoSet.iterator();
Vidyashree Rama1db15562016-05-17 16:16:15 +0530343 while (yangFileIterator.hasNext()) {
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530344 YangFileInfo yangFileInfo = yangFileIterator.next();
Bharat saraswal33dfa012016-05-17 19:59:16 +0530345 setCurYangFileInfo(yangFileInfo);
Bharat saraswal96dfef02016-06-16 00:29:12 +0530346 if (yangFileInfo.isForTranslator()) {
347 generateJavaCode(yangFileInfo.getRootNode(), yangPlugin);
348 }
Vidyashree Rama1db15562016-05-17 16:16:15 +0530349 }
350 }
351
352 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530353 * Creates a YANG file info set.
Vidyashree Rama1db15562016-05-17 16:16:15 +0530354 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530355 * @param yangFileList YANG files list
Vidyashree Rama1db15562016-05-17 16:16:15 +0530356 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530357 public void createYangFileInfoSet(List<String> yangFileList) {
358 for (String yangFile : yangFileList) {
359 YangFileInfo yangFileInfo = new YangFileInfo();
360 yangFileInfo.setYangFileName(yangFile);
361 getYangFileInfoSet().add(yangFileInfo);
Vidyashree Rama1db15562016-05-17 16:16:15 +0530362 }
363 }
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530364
365 /**
366 * Returns the YANG file info set.
367 *
368 * @return the YANG file info set
369 */
370 public Set<YangFileInfo> getYangFileInfoSet() {
371 return yangFileInfoSet;
372 }
373
374 /**
375 * Sets the YANG file info set.
376 *
377 * @param yangFileInfoSet the YANG file info set
378 */
379 public void setYangFileInfoSet(Set<YangFileInfo> yangFileInfoSet) {
380 this.yangFileInfoSet = yangFileInfoSet;
381 }
Bharat saraswal33dfa012016-05-17 19:59:16 +0530382
383 /**
384 * Returns current YANG file's info.
385 *
386 * @return the yangFileInfo
387 */
388 public YangFileInfo getCurYangFileInfo() {
389 return curYangFileInfo;
390 }
391
392 /**
393 * Sets current YANG file's info.
394 *
395 * @param yangFileInfo the yangFileInfo to set
396 */
397 public void setCurYangFileInfo(YangFileInfo yangFileInfo) {
Bharat saraswal96dfef02016-06-16 00:29:12 +0530398 curYangFileInfo = yangFileInfo;
Bharat saraswal33dfa012016-05-17 19:59:16 +0530399 }
Vinod Kumar S38046502016-03-23 15:30:27 +0530400}