VinodKumarS-Huawei
Committed by Gerrit Code Review

Review comments fix for the code in master

Change-Id: I7b492cb3060d2eb83667eb52e4cb2fbfafd3415e
......@@ -76,7 +76,8 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.resolveLi
/**
* Represents data model node to maintain information defined in YANG sub-module.
*/
public class YangSubModule extends YangNode
public class YangSubModule
extends YangNode
implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, YangReferenceResolver,
RpcNotificationContainer {
......@@ -150,6 +151,7 @@ public class YangSubModule extends YangNode
* Prefix of parent module.
*/
private String prefix;
/*-
* Reference RFC 6020.
*
......@@ -331,7 +333,8 @@ public class YangSubModule extends YangNode
}
@Override
public void resolveSelfFileLinking() throws DataModelException {
public void resolveSelfFileLinking()
throws DataModelException {
// Get the list to be resolved.
List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList();
// Resolve linking for a resolution list.
......@@ -468,7 +471,8 @@ public class YangSubModule extends YangNode
* @throws DataModelException a violation of data model rules
*/
@Override
public void validateDataOnEntry() throws DataModelException {
public void validateDataOnEntry()
throws DataModelException {
// TODO auto-generated method stub, to be implemented by parser
}
......@@ -478,18 +482,21 @@ public class YangSubModule extends YangNode
* @throws DataModelException a violation of data model rules
*/
@Override
public void validateDataOnExit() throws DataModelException {
public void validateDataOnExit()
throws DataModelException {
// TODO auto-generated method stub, to be implemented by parser
}
@Override
public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
public void detectCollidingChild(String identifierName, YangConstructType dataType)
throws DataModelException {
// Asks helper to detect colliding child.
detectCollidingChildUtil(identifierName, dataType, this);
}
@Override
public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
public void detectSelfCollision(String identifierName, YangConstructType dataType)
throws DataModelException {
// Not required as module doesn't have any parent.
}
......
......@@ -114,31 +114,38 @@ public class TempJavaFragmentFiles {
* Information about the java files being generated.
*/
private JavaFileInfo javaFileInfo;
/**
* Imported class info.
*/
private JavaImportData javaImportData;
/**
* The variable which guides the types of temporary files generated using
* the temporary generated file types mask.
*/
private int generatedTempFiles;
/**
* Absolute path where the target java file needs to be generated.
*/
private String absoluteDirPath;
/**
* Contains all the interface(s)/class name which will be extended by generated files.
*/
private List<String> extendsList = new ArrayList<>();
/**
* File type extension for java classes.
*/
private static final String JAVA_FILE_EXTENSION = ".java";
/**
* File type extension for temporary classes.
*/
private static final String TEMP_FILE_EXTENSION = ".tmp";
/**
* Folder suffix for temporary files folder.
*/
......@@ -168,14 +175,17 @@ public class TempJavaFragmentFiles {
* File name for attributes.
*/
private static final String ATTRIBUTE_FILE_NAME = "Attributes";
/**
* File name for to string method.
*/
private static final String TO_STRING_METHOD_FILE_NAME = "ToString";
/**
* File name for hash code method.
*/
private static final String HASH_CODE_METHOD_FILE_NAME = "HashCode";
/**
* File name for equals method.
*/
......@@ -190,14 +200,17 @@ public class TempJavaFragmentFiles {
* File name for interface java file name suffix.
*/
private static final String INTERFACE_FILE_NAME_SUFFIX = EMPTY_STRING;
/**
* File name for builder interface file name suffix.
*/
private static final String BUILDER_INTERFACE_FILE_NAME_SUFFIX = BUILDER + INTERFACE;
/**
* File name for builder class file name suffix.
*/
private static final String BUILDER_CLASS_FILE_NAME_SUFFIX = BUILDER;
/**
* File name for impl class file name suffix.
*/
......@@ -212,14 +225,17 @@ public class TempJavaFragmentFiles {
* Java file handle for interface file.
*/
private File interfaceJavaFileHandle;
/**
* Java file handle for builder interface file.
*/
private File builderInterfaceJavaFileHandle;
/**
* Java file handle for builder class file.
*/
private File builderClassJavaFileHandle;
/**
* Java file handle for impl class file.
*/
......@@ -254,14 +270,17 @@ public class TempJavaFragmentFiles {
* Temporary file handle for hash code method of class.
*/
private File hashCodeImplTempFileHandle;
/**
* Temporary file handle for equals method of class.
*/
private File equalsImplTempFileHandle;
/**
* Temporary file handle for to string method of class.
*/
private File toStringImplTempFileHandle;
/**
* Temporary file handle for enum class file.
*/
......@@ -276,18 +295,17 @@ public class TempJavaFragmentFiles {
* Is attribute added.
*/
private boolean isAttributePresent = false;
/**
* Current enum's value.
*/
private int enumValue;
/*
* Java file handle for enum class.
*/
private File enumClassJavaFileHandle;
public TempJavaFragmentFiles() {
}
/**
* Returns enum class java file handle.
*
......
......@@ -60,6 +60,7 @@ public class TempJavaTypeFragmentFiles
* File name for construction for special type like union, typedef.
*/
private static final String CONSTRUCTOR_FOR_TYPE_FILE_NAME = "ConstructorForType";
/**
* File name for from string method.
*/
......@@ -80,6 +81,7 @@ public class TempJavaTypeFragmentFiles
* Temporary file handle for of string method of class.
*/
private File ofStringImplTempFileHandle;
/**
* Temporary file handle for constructor for type class.
*/
......@@ -94,6 +96,7 @@ public class TempJavaTypeFragmentFiles
* Java file handle for typedef class file.
*/
private File typedefClassJavaFileHandle;
/**
* Java file handle for type class like union, typedef file.
*/
......
......@@ -113,7 +113,7 @@ public class YangJavaNotification
public void generateCodeEntry(YangPluginConfig yangPlugin)
throws IOException {
/**
/*
* As part of the notification support the following files needs to be generated.
* 1) Subject of the notification(event), this is simple interface with builder class.
* 2) Event class extending "AbstractEvent" and defining event type enum.
......@@ -121,19 +121,18 @@ public class YangJavaNotification
*
* The manager class needs to extend the ListenerRegistry.
*/
// Generate subject of the notification(event), this is simple interface with builder class.
generateCodeOfNode(this, yangPlugin);
}
/**
* Creates a java file using the YANG notification info.
*
* @throws IOException input output operation fail
*/
@Override
public void generateCodeExit()
throws IOException {
/**
/*
* As part of the notification support the following files needs to be generated.
* 1) Subject of the notification(event), this is simple interface with builder class.
* 2) Event class extending "AbstractEvent" and defining event type enum.
......