blob: 32ce23582512012df18d3242dbd0f99e2903bc2b [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
Shankara-Huaweib9999eb2016-07-14 16:53:09 +0530153 /**
154 * Code generation is for nbi or sbi.
155 */
156 @Parameter(property = "generateJavaFileForsbi", defaultValue = "nbi")
157 private String generateJavaFileForsbi;
158
Vinod Kumar S7a004de2016-02-05 16:15:09 +0530159 @Override
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530160 public void execute()
161 throws MojoExecutionException, MojoFailureException {
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530162
163 try {
Bharat saraswal870c56f2016-02-20 21:57:16 +0530164
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530165 /*
Bharat saraswal870c56f2016-02-20 21:57:16 +0530166 * For deleting the generated code in previous build.
167 */
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530168 deleteDirectory(getDirectory(baseDir, classFileDir) + DEFAULT_PKG);
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530169 deleteDirectory(getDirectory(baseDir, outputDirectory));
Bharat saraswal870c56f2016-02-20 21:57:16 +0530170
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530171 String searchDir = getDirectory(baseDir, yangFilesDir);
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530172 String codeGenDir = getDirectory(baseDir, classFileDir) + SLASH;
173 String managerCodeGenDir = getDirectory(baseDir, managerFileDir) + SLASH;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530174
175 // Creates conflict resolver and set values to it.
janani bde4ffab2016-04-15 16:18:30 +0530176 YangToJavaNamingConflictUtil conflictResolver = new YangToJavaNamingConflictUtil();
177 conflictResolver.setReplacementForPeriod(replacementForPeriod);
178 conflictResolver.setReplacementForHyphen(replacementForHyphen);
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530179 conflictResolver.setReplacementForUnderscore(replacementForUnderscore);
janani bdd1314f2016-05-19 17:39:50 +0530180 conflictResolver.setPrefixForIdentifier(prefixForIdentifier);
janani bde4ffab2016-04-15 16:18:30 +0530181 YangPluginConfig yangPlugin = new YangPluginConfig();
182 yangPlugin.setCodeGenDir(codeGenDir);
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530183 yangPlugin.setManagerCodeGenDir(managerCodeGenDir);
janani bde4ffab2016-04-15 16:18:30 +0530184 yangPlugin.setConflictResolver(conflictResolver);
Vidyashree Rama1db15562016-05-17 16:16:15 +0530185
Shankara-Huaweib9999eb2016-07-14 16:53:09 +0530186 yangPlugin.setCodeGenerateForsbi(generateJavaFileForsbi.toLowerCase());
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530187 /*
188 * Obtain the YANG files at a path mentioned in plugin and creates
189 * YANG file information set.
190 */
191 createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
Bharat saraswal870c56f2016-02-20 21:57:16 +0530192
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530193 // Check if there are any file to translate, if not return.
194 if (getYangFileInfoSet() == null || getYangFileInfoSet().isEmpty()) {
195 // No files to translate
196 return;
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530197 }
Bharat saraswal96dfef02016-06-16 00:29:12 +0530198 // Resolve inter jar dependency.
199 resolveInterJardependency();
Bharat saraswal870c56f2016-02-20 21:57:16 +0530200
Bharat saraswal33dfa012016-05-17 19:59:16 +0530201 // Carry out the parsing for all the YANG files.
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530202 parseYangFileInfoSet();
Vidyashree Rama1db15562016-05-17 16:16:15 +0530203
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530204 // Resolve dependencies using linker.
205 resolveDependenciesUsingLinker();
206
207 // Perform translation to JAVA.
208 translateToJava(getYangFileInfoSet(), yangPlugin);
Vidyashree Rama1db15562016-05-17 16:16:15 +0530209
Bharat saraswal96dfef02016-06-16 00:29:12 +0530210 // Serialize data model.
211 serializeDataModel(getDirectory(baseDir, outputDirectory), getYangFileInfoSet(), project, true);
212
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530213 addToCompilationRoot(codeGenDir, project, context);
214 addToCompilationRoot(managerCodeGenDir, project, context);
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530215
216 copyYangFilesToTarget(getYangFileInfoSet(), getDirectory(baseDir, outputDirectory), project);
janani bdd1314f2016-05-19 17:39:50 +0530217 } catch (IOException | ParserException e) {
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530218 String fileName = "";
Bharat saraswal33dfa012016-05-17 19:59:16 +0530219 if (getCurYangFileInfo() != null) {
220 fileName = getCurYangFileInfo().getYangFileName();
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530221 }
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530222 try {
223 translatorErrorHandler(getRootNode());
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530224 deleteDirectory(getDirectory(baseDir, classFileDir) + DEFAULT_PKG);
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530225 } catch (IOException ex) {
226 throw new MojoExecutionException(
227 "Error handler failed to delete files for data model node.");
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530228 }
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530229 throw new MojoExecutionException(
230 "Exception occured due to " + e.getLocalizedMessage() + " in " + fileName
231 + " YANG file.");
Bharat saraswalec4ef7c2016-02-11 22:00:49 +0530232 }
Vinod Kumar S7a004de2016-02-05 16:15:09 +0530233 }
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530234
235 /**
Gaurav Agrawal8a5af142016-06-15 13:58:01 +0530236 * Returns the YANG node set.
237 *
238 * @return YANG node set
239 */
240 public Set<YangNode> getYangNodeSet() {
241 return yangNodeSet;
242 }
243
244 /**
Bharat saraswal96dfef02016-06-16 00:29:12 +0530245 * Resolved inter-jar dependencies.
246 *
247 * @throws IOException when fails to do IO operations
248 */
249 public void resolveInterJardependency() throws IOException {
250 try {
251 List<YangNode> interJarResolvedNodes = resolveInterJarDependencies(project, localRepository,
252 remoteRepository, getDirectory(baseDir, outputDirectory));
253 for (YangNode node : interJarResolvedNodes) {
254 YangFileInfo dependentFileInfo = new YangFileInfo();
255 dependentFileInfo.setRootNode(node);
256 dependentFileInfo.setForTranslator(false);
257 dependentFileInfo.setYangFileName(node.getName());
258 getYangFileInfoSet().add(dependentFileInfo);
259 }
260 } catch (IOException e) {
261 throw new IOException("failed to resolve in interjar scenario.");
262 }
263 }
264
265 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530266 * Links all the provided with the YANG file info set.
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530267 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530268 * @throws MojoExecutionException a violation in mojo excecution
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530269 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530270 public void resolveDependenciesUsingLinker()
271 throws MojoExecutionException {
Gaurav Agrawal8a5af142016-06-15 13:58:01 +0530272 createYangNodeSet();
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530273 try {
274 yangLinker.resolveDependencies(getYangNodeSet());
275 } catch (LinkerException e) {
276 throw new MojoExecutionException(e.getMessage());
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530277 }
Bharat saraswalb1170bd2016-07-14 13:26:18 +0530278
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530279 }
280
281 /**
Gaurav Agrawal8a5af142016-06-15 13:58:01 +0530282 * Creates YANG nodes set.
283 */
284 public void createYangNodeSet() {
285 for (YangFileInfo yangFileInfo : getYangFileInfoSet()) {
286 getYangNodeSet().add(yangFileInfo.getRootNode());
287 }
288 }
289
290 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530291 * Parses all the provided YANG files and generates YANG data model tree.
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530292 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530293 * @throws IOException a violation in IO
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530294 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530295 public void parseYangFileInfoSet()
296 throws IOException {
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530297 for (YangFileInfo yangFileInfo : getYangFileInfoSet()) {
Bharat saraswal33dfa012016-05-17 19:59:16 +0530298 setCurYangFileInfo(yangFileInfo);
Bharat saraswal96dfef02016-06-16 00:29:12 +0530299 if (yangFileInfo.isForTranslator()) {
300 try {
301 YangNode yangNode = yangUtilsParser.getDataModel(yangFileInfo.getYangFileName());
302 yangFileInfo.setRootNode(yangNode);
303 setRootNode(yangNode);
304 } catch (ParserException e) {
305 String logInfo = "Error in file: " + e.getFileName();
306 if (e.getLineNumber() != 0) {
307 logInfo = logInfo + " at line: " + e.getLineNumber() + " at position: "
308 + e.getCharPositionInLine();
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530309
Bharat saraswal96dfef02016-06-16 00:29:12 +0530310 }
311 if (e.getMessage() != null) {
312 logInfo = logInfo + NEW_LINE + e.getMessage();
313 }
314 getLog().info(logInfo);
315 throw e;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530316 }
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530317 }
318 }
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530319 }
320
321 /**
322 * Returns current root YANG node of data-model tree.
323 *
324 * @return current root YANG node of data-model tree
325 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530326 private YangNode getRootNode() {
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530327 return rootNode;
328 }
329
330 /**
331 * Sets current root YANG node of data-model tree.
332 *
333 * @param rootNode current root YANG node of data-model tree
334 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530335 private void setRootNode(YangNode rootNode) {
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530336 this.rootNode = rootNode;
337 }
338
Vidyashree Rama1db15562016-05-17 16:16:15 +0530339 /**
340 * Translates to java code corresponding to the YANG schema.
341 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530342 * @param yangFileInfoSet YANG file information
343 * @param yangPlugin YANG plugin config
Vidyashree Rama1db15562016-05-17 16:16:15 +0530344 * @throws IOException when fails to generate java code file the current
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530345 * node
Vidyashree Rama1db15562016-05-17 16:16:15 +0530346 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530347 public void translateToJava(Set<YangFileInfo> yangFileInfoSet, YangPluginConfig yangPlugin)
Vidyashree Rama1db15562016-05-17 16:16:15 +0530348 throws IOException {
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530349 Iterator<YangFileInfo> yangFileIterator = yangFileInfoSet.iterator();
Vidyashree Rama1db15562016-05-17 16:16:15 +0530350 while (yangFileIterator.hasNext()) {
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530351 YangFileInfo yangFileInfo = yangFileIterator.next();
Bharat saraswal33dfa012016-05-17 19:59:16 +0530352 setCurYangFileInfo(yangFileInfo);
Bharat saraswal96dfef02016-06-16 00:29:12 +0530353 if (yangFileInfo.isForTranslator()) {
354 generateJavaCode(yangFileInfo.getRootNode(), yangPlugin);
355 }
Vidyashree Rama1db15562016-05-17 16:16:15 +0530356 }
357 }
358
359 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530360 * Creates a YANG file info set.
Vidyashree Rama1db15562016-05-17 16:16:15 +0530361 *
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530362 * @param yangFileList YANG files list
Vidyashree Rama1db15562016-05-17 16:16:15 +0530363 */
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530364 public void createYangFileInfoSet(List<String> yangFileList) {
365 for (String yangFile : yangFileList) {
366 YangFileInfo yangFileInfo = new YangFileInfo();
367 yangFileInfo.setYangFileName(yangFile);
368 getYangFileInfoSet().add(yangFileInfo);
Vidyashree Rama1db15562016-05-17 16:16:15 +0530369 }
370 }
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530371
372 /**
373 * Returns the YANG file info set.
374 *
375 * @return the YANG file info set
376 */
377 public Set<YangFileInfo> getYangFileInfoSet() {
378 return yangFileInfoSet;
379 }
380
381 /**
382 * Sets the YANG file info set.
383 *
384 * @param yangFileInfoSet the YANG file info set
385 */
386 public void setYangFileInfoSet(Set<YangFileInfo> yangFileInfoSet) {
387 this.yangFileInfoSet = yangFileInfoSet;
388 }
Bharat saraswal33dfa012016-05-17 19:59:16 +0530389
390 /**
391 * Returns current YANG file's info.
392 *
393 * @return the yangFileInfo
394 */
395 public YangFileInfo getCurYangFileInfo() {
396 return curYangFileInfo;
397 }
398
399 /**
400 * Sets current YANG file's info.
401 *
402 * @param yangFileInfo the yangFileInfo to set
403 */
404 public void setCurYangFileInfo(YangFileInfo yangFileInfo) {
Bharat saraswal96dfef02016-06-16 00:29:12 +0530405 curYangFileInfo = yangFileInfo;
Bharat saraswal33dfa012016-05-17 19:59:16 +0530406 }
Vinod Kumar S38046502016-03-23 15:30:27 +0530407}