sangyun-han
Committed by sangyun han

Fix javadoc comment for JavaFileGeneratorUtils

Change-Id: I1e38b3166966e195bac27f54752961d75d8fd6ea
(cherry picked from commit 19f8d350)

Request from Gaurav Agrawal

Change-Id: I0cd20b72e87acc95106ff63374e19fcfa8a2b3f3
...@@ -111,8 +111,8 @@ public final class JavaFileGeneratorUtils { ...@@ -111,8 +111,8 @@ public final class JavaFileGeneratorUtils {
111 /** 111 /**
112 * Returns a file object for generated file. 112 * Returns a file object for generated file.
113 * 113 *
114 - * @param fileName file name
115 * @param filePath file package path 114 * @param filePath file package path
115 + * @param fileName file name
116 * @param extension file extension 116 * @param extension file extension
117 * @param handle cached file handle 117 * @param handle cached file handle
118 * @return file object 118 * @return file object
...@@ -255,19 +255,19 @@ public final class JavaFileGeneratorUtils { ...@@ -255,19 +255,19 @@ public final class JavaFileGeneratorUtils {
255 * 255 *
256 * @param file generated file 256 * @param file generated file
257 * @param className generated file class name 257 * @param className generated file class name
258 - * @param type generated file type 258 + * @param genType generated file type
259 * @param imports imports for the file 259 * @param imports imports for the file
260 * @param pkg generated file package 260 * @param pkg generated file package
261 * @param pluginConfig plugin configurations 261 * @param pluginConfig plugin configurations
262 * @throws IOException when fails to generate a file 262 * @throws IOException when fails to generate a file
263 */ 263 */
264 - public static void initiateJavaFileGeneration(File file, String className, int type, List<String> imports, 264 + public static void initiateJavaFileGeneration(File file, String className, int genType, List<String> imports,
265 String pkg, YangPluginConfig pluginConfig) 265 String pkg, YangPluginConfig pluginConfig)
266 throws IOException { 266 throws IOException {
267 267
268 try { 268 try {
269 file.createNewFile(); 269 file.createNewFile();
270 - appendContents(file, className, type, imports, pkg, pluginConfig); 270 + appendContents(file, className, genType, imports, pkg, pluginConfig);
271 } catch (IOException e) { 271 } catch (IOException e) {
272 throw new IOException("Failed to create " + file.getName() + " class file."); 272 throw new IOException("Failed to create " + file.getName() + " class file.");
273 } 273 }
...@@ -277,18 +277,18 @@ public final class JavaFileGeneratorUtils { ...@@ -277,18 +277,18 @@ public final class JavaFileGeneratorUtils {
277 * Initiates generation of file based on generated file type. 277 * Initiates generation of file based on generated file type.
278 * 278 *
279 * @param file generated file 279 * @param file generated file
280 - * @param type generated file type 280 + * @param genType generated file type
281 * @param imports imports for the file 281 * @param imports imports for the file
282 * @param curNode current YANG node 282 * @param curNode current YANG node
283 * @param className class name 283 * @param className class name
284 * @throws IOException when fails to generate a file 284 * @throws IOException when fails to generate a file
285 */ 285 */
286 - public static void initiateJavaFileGeneration(File file, int type, List<String> imports, 286 + public static void initiateJavaFileGeneration(File file, int genType, List<String> imports,
287 YangNode curNode, String className) throws IOException { 287 YangNode curNode, String className) throws IOException {
288 288
289 try { 289 try {
290 file.createNewFile(); 290 file.createNewFile();
291 - appendContents(file, type, imports, curNode, className); 291 + appendContents(file, genType, imports, curNode, className);
292 } catch (IOException e) { 292 } catch (IOException e) {
293 throw new IOException("Failed to create " + file.getName() + " class file."); 293 throw new IOException("Failed to create " + file.getName() + " class file.");
294 } 294 }
...@@ -298,13 +298,13 @@ public final class JavaFileGeneratorUtils { ...@@ -298,13 +298,13 @@ public final class JavaFileGeneratorUtils {
298 * Appends all the contents into a generated java file. 298 * Appends all the contents into a generated java file.
299 * 299 *
300 * @param file generated file 300 * @param file generated file
301 - * @param fileName generated file name 301 + * @param genType generated file type
302 - * @param type generated file type 302 + * @param importsList list of java imports
303 - * @param pkg generated file package 303 + * @param curNode current YANG node
304 - * @param importsList list of java imports. 304 + * @param className class name
305 - * @throws IOException when fails to append contents 305 + * @throws IOException
306 */ 306 */
307 - private static void appendContents(File file, int type, List<String> importsList, YangNode curNode, 307 + private static void appendContents(File file, int genType, List<String> importsList, YangNode curNode,
308 String className) throws IOException { 308 String className) throws IOException {
309 309
310 JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); 310 JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
...@@ -313,33 +313,33 @@ public final class JavaFileGeneratorUtils { ...@@ -313,33 +313,33 @@ public final class JavaFileGeneratorUtils {
313 String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); 313 String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath();
314 314
315 String pkgString = null; 315 String pkgString = null;
316 - if (type == GENERATE_EVENT_CLASS 316 + if (genType == GENERATE_EVENT_CLASS
317 - || type == GENERATE_EVENT_LISTENER_INTERFACE 317 + || genType == GENERATE_EVENT_LISTENER_INTERFACE
318 - || type == GENERATE_EVENT_SUBJECT_CLASS) { 318 + || genType == GENERATE_EVENT_SUBJECT_CLASS) {
319 pkgString = parsePackageString((path + PERIOD + name).toLowerCase(), importsList); 319 pkgString = parsePackageString((path + PERIOD + name).toLowerCase(), importsList);
320 } else { 320 } else {
321 pkgString = parsePackageString(path, importsList); 321 pkgString = parsePackageString(path, importsList);
322 } 322 }
323 - switch (type) { 323 + switch (genType) {
324 case INTERFACE_MASK: 324 case INTERFACE_MASK:
325 appendHeaderContents(file, pkgString, importsList); 325 appendHeaderContents(file, pkgString, importsList);
326 - write(file, type, INTERFACE, curNode, className); 326 + write(file, genType, INTERFACE, curNode, className);
327 break; 327 break;
328 case GENERATE_SERVICE_AND_MANAGER: 328 case GENERATE_SERVICE_AND_MANAGER:
329 appendHeaderContents(file, pkgString, importsList); 329 appendHeaderContents(file, pkgString, importsList);
330 - write(file, type, RPC_INTERFACE, curNode, className); 330 + write(file, genType, RPC_INTERFACE, curNode, className);
331 break; 331 break;
332 case GENERATE_EVENT_CLASS: 332 case GENERATE_EVENT_CLASS:
333 appendHeaderContents(file, pkgString, importsList); 333 appendHeaderContents(file, pkgString, importsList);
334 - write(file, type, EVENT, curNode, className); 334 + write(file, genType, EVENT, curNode, className);
335 break; 335 break;
336 case GENERATE_EVENT_LISTENER_INTERFACE: 336 case GENERATE_EVENT_LISTENER_INTERFACE:
337 appendHeaderContents(file, pkgString, importsList); 337 appendHeaderContents(file, pkgString, importsList);
338 - write(file, type, EVENT_LISTENER, curNode, className); 338 + write(file, genType, EVENT_LISTENER, curNode, className);
339 break; 339 break;
340 case GENERATE_EVENT_SUBJECT_CLASS: 340 case GENERATE_EVENT_SUBJECT_CLASS:
341 appendHeaderContents(file, pkgString, importsList); 341 appendHeaderContents(file, pkgString, importsList);
342 - write(file, type, EVENT_SUBJECT_CLASS, curNode, className); 342 + write(file, genType, EVENT_SUBJECT_CLASS, curNode, className);
343 break; 343 break;
344 default: 344 default:
345 break; 345 break;
...@@ -351,39 +351,40 @@ public final class JavaFileGeneratorUtils { ...@@ -351,39 +351,40 @@ public final class JavaFileGeneratorUtils {
351 * 351 *
352 * @param file generated file 352 * @param file generated file
353 * @param fileName generated file name 353 * @param fileName generated file name
354 - * @param type generated file type 354 + * @param genType generated file type
355 + * @param importsList list of java imports
355 * @param pkg generated file package 356 * @param pkg generated file package
356 - * @param importsList list of java imports. 357 + * @param pluginConfig plugin configurations
357 * @throws IOException when fails to append contents 358 * @throws IOException when fails to append contents
358 */ 359 */
359 - private static void appendContents(File file, String fileName, int type, List<String> importsList, String pkg, 360 + private static void appendContents(File file, String fileName, int genType, List<String> importsList, String pkg,
360 YangPluginConfig pluginConfig) 361 YangPluginConfig pluginConfig)
361 throws IOException { 362 throws IOException {
362 363
363 String pkgString = parsePackageString(pkg, importsList); 364 String pkgString = parsePackageString(pkg, importsList);
364 365
365 - switch (type) { 366 + switch (genType) {
366 case IMPL_CLASS_MASK: 367 case IMPL_CLASS_MASK:
367 - write(file, fileName, type, IMPL_CLASS, pluginConfig); 368 + write(file, fileName, genType, IMPL_CLASS, pluginConfig);
368 break; 369 break;
369 case BUILDER_INTERFACE_MASK: 370 case BUILDER_INTERFACE_MASK:
370 - write(file, fileName, type, BUILDER_INTERFACE, pluginConfig); 371 + write(file, fileName, genType, BUILDER_INTERFACE, pluginConfig);
371 break; 372 break;
372 case GENERATE_TYPEDEF_CLASS: 373 case GENERATE_TYPEDEF_CLASS:
373 appendHeaderContents(file, pkgString, importsList); 374 appendHeaderContents(file, pkgString, importsList);
374 - write(file, fileName, type, IMPL_CLASS, pluginConfig); 375 + write(file, fileName, genType, IMPL_CLASS, pluginConfig);
375 break; 376 break;
376 case BUILDER_CLASS_MASK: 377 case BUILDER_CLASS_MASK:
377 appendHeaderContents(file, pkgString, importsList); 378 appendHeaderContents(file, pkgString, importsList);
378 - write(file, fileName, type, BUILDER_CLASS, pluginConfig); 379 + write(file, fileName, genType, BUILDER_CLASS, pluginConfig);
379 break; 380 break;
380 case GENERATE_UNION_CLASS: 381 case GENERATE_UNION_CLASS:
381 appendHeaderContents(file, pkgString, importsList); 382 appendHeaderContents(file, pkgString, importsList);
382 - write(file, fileName, type, IMPL_CLASS, pluginConfig); 383 + write(file, fileName, genType, IMPL_CLASS, pluginConfig);
383 break; 384 break;
384 case GENERATE_ENUM_CLASS: 385 case GENERATE_ENUM_CLASS:
385 appendHeaderContents(file, pkgString, importsList); 386 appendHeaderContents(file, pkgString, importsList);
386 - write(file, fileName, type, ENUM_CLASS, pluginConfig); 387 + write(file, fileName, genType, ENUM_CLASS, pluginConfig);
387 break; 388 break;
388 default: 389 default:
389 break; 390 break;
...@@ -443,9 +444,10 @@ public final class JavaFileGeneratorUtils { ...@@ -443,9 +444,10 @@ public final class JavaFileGeneratorUtils {
443 * Writes data to the specific generated file. 444 * Writes data to the specific generated file.
444 * 445 *
445 * @param file generated file 446 * @param file generated file
446 - * @param fileName file name
447 * @param genType generated file type 447 * @param genType generated file type
448 * @param javaDocType java doc type 448 * @param javaDocType java doc type
449 + * @param curNode current YANG node
450 + * @param fileName file name
449 * @throws IOException when fails to write into a file 451 * @throws IOException when fails to write into a file
450 */ 452 */
451 private static void write(File file, int genType, JavaDocType javaDocType, YangNode curNode, String fileName) 453 private static void write(File file, int genType, JavaDocType javaDocType, YangNode curNode, String fileName)
...@@ -472,7 +474,8 @@ public final class JavaFileGeneratorUtils { ...@@ -472,7 +474,8 @@ public final class JavaFileGeneratorUtils {
472 * @param fileName file name 474 * @param fileName file name
473 * @param genType generated file type 475 * @param genType generated file type
474 * @param javaDocType java doc type 476 * @param javaDocType java doc type
475 - * @throws IOException when fails to write into a file 477 + * @param pluginConfig plugin configurations
478 + * @throws IOException
476 */ 479 */
477 private static void write(File file, String fileName, int genType, JavaDocType javaDocType, 480 private static void write(File file, String fileName, int genType, JavaDocType javaDocType,
478 YangPluginConfig pluginConfig) 481 YangPluginConfig pluginConfig)
......