Revert "Review comments fix for the code in master"
This patch set currently does not build with maven This reverts commit cbdf0f2b. Change-Id: Ib49e29bbef1d3592ac1fbbb782ffceb29c0aad83
Showing
4 changed files
with
14 additions
and
41 deletions
... | @@ -76,8 +76,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.resolveLi | ... | @@ -76,8 +76,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.resolveLi |
76 | /** | 76 | /** |
77 | * Represents data model node to maintain information defined in YANG sub-module. | 77 | * Represents data model node to maintain information defined in YANG sub-module. |
78 | */ | 78 | */ |
79 | -public class YangSubModule | 79 | +public class YangSubModule extends YangNode |
80 | - extends YangNode | ||
81 | implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, YangReferenceResolver, | 80 | implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, YangReferenceResolver, |
82 | RpcNotificationContainer { | 81 | RpcNotificationContainer { |
83 | 82 | ||
... | @@ -151,7 +150,6 @@ public class YangSubModule | ... | @@ -151,7 +150,6 @@ public class YangSubModule |
151 | * Prefix of parent module. | 150 | * Prefix of parent module. |
152 | */ | 151 | */ |
153 | private String prefix; | 152 | private String prefix; |
154 | - | ||
155 | /*- | 153 | /*- |
156 | * Reference RFC 6020. | 154 | * Reference RFC 6020. |
157 | * | 155 | * |
... | @@ -333,8 +331,7 @@ public class YangSubModule | ... | @@ -333,8 +331,7 @@ public class YangSubModule |
333 | } | 331 | } |
334 | 332 | ||
335 | @Override | 333 | @Override |
336 | - public void resolveSelfFileLinking() | 334 | + public void resolveSelfFileLinking() throws DataModelException { |
337 | - throws DataModelException { | ||
338 | // Get the list to be resolved. | 335 | // Get the list to be resolved. |
339 | List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList(); | 336 | List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList(); |
340 | // Resolve linking for a resolution list. | 337 | // Resolve linking for a resolution list. |
... | @@ -471,8 +468,7 @@ public class YangSubModule | ... | @@ -471,8 +468,7 @@ public class YangSubModule |
471 | * @throws DataModelException a violation of data model rules | 468 | * @throws DataModelException a violation of data model rules |
472 | */ | 469 | */ |
473 | @Override | 470 | @Override |
474 | - public void validateDataOnEntry() | 471 | + public void validateDataOnEntry() throws DataModelException { |
475 | - throws DataModelException { | ||
476 | // TODO auto-generated method stub, to be implemented by parser | 472 | // TODO auto-generated method stub, to be implemented by parser |
477 | } | 473 | } |
478 | 474 | ||
... | @@ -482,21 +478,18 @@ public class YangSubModule | ... | @@ -482,21 +478,18 @@ public class YangSubModule |
482 | * @throws DataModelException a violation of data model rules | 478 | * @throws DataModelException a violation of data model rules |
483 | */ | 479 | */ |
484 | @Override | 480 | @Override |
485 | - public void validateDataOnExit() | 481 | + public void validateDataOnExit() throws DataModelException { |
486 | - throws DataModelException { | ||
487 | // TODO auto-generated method stub, to be implemented by parser | 482 | // TODO auto-generated method stub, to be implemented by parser |
488 | } | 483 | } |
489 | 484 | ||
490 | @Override | 485 | @Override |
491 | - public void detectCollidingChild(String identifierName, YangConstructType dataType) | 486 | + public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException { |
492 | - throws DataModelException { | ||
493 | // Asks helper to detect colliding child. | 487 | // Asks helper to detect colliding child. |
494 | detectCollidingChildUtil(identifierName, dataType, this); | 488 | detectCollidingChildUtil(identifierName, dataType, this); |
495 | } | 489 | } |
496 | 490 | ||
497 | @Override | 491 | @Override |
498 | - public void detectSelfCollision(String identifierName, YangConstructType dataType) | 492 | + public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException { |
499 | - throws DataModelException { | ||
500 | // Not required as module doesn't have any parent. | 493 | // Not required as module doesn't have any parent. |
501 | } | 494 | } |
502 | 495 | ... | ... |
utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
... | @@ -114,38 +114,31 @@ public class TempJavaFragmentFiles { | ... | @@ -114,38 +114,31 @@ public class TempJavaFragmentFiles { |
114 | * Information about the java files being generated. | 114 | * Information about the java files being generated. |
115 | */ | 115 | */ |
116 | private JavaFileInfo javaFileInfo; | 116 | private JavaFileInfo javaFileInfo; |
117 | - | ||
118 | /** | 117 | /** |
119 | * Imported class info. | 118 | * Imported class info. |
120 | */ | 119 | */ |
121 | private JavaImportData javaImportData; | 120 | private JavaImportData javaImportData; |
122 | - | ||
123 | /** | 121 | /** |
124 | * The variable which guides the types of temporary files generated using | 122 | * The variable which guides the types of temporary files generated using |
125 | * the temporary generated file types mask. | 123 | * the temporary generated file types mask. |
126 | */ | 124 | */ |
127 | private int generatedTempFiles; | 125 | private int generatedTempFiles; |
128 | - | ||
129 | /** | 126 | /** |
130 | * Absolute path where the target java file needs to be generated. | 127 | * Absolute path where the target java file needs to be generated. |
131 | */ | 128 | */ |
132 | private String absoluteDirPath; | 129 | private String absoluteDirPath; |
133 | - | ||
134 | /** | 130 | /** |
135 | * Contains all the interface(s)/class name which will be extended by generated files. | 131 | * Contains all the interface(s)/class name which will be extended by generated files. |
136 | */ | 132 | */ |
137 | private List<String> extendsList = new ArrayList<>(); | 133 | private List<String> extendsList = new ArrayList<>(); |
138 | - | ||
139 | /** | 134 | /** |
140 | * File type extension for java classes. | 135 | * File type extension for java classes. |
141 | */ | 136 | */ |
142 | private static final String JAVA_FILE_EXTENSION = ".java"; | 137 | private static final String JAVA_FILE_EXTENSION = ".java"; |
143 | - | ||
144 | /** | 138 | /** |
145 | * File type extension for temporary classes. | 139 | * File type extension for temporary classes. |
146 | */ | 140 | */ |
147 | private static final String TEMP_FILE_EXTENSION = ".tmp"; | 141 | private static final String TEMP_FILE_EXTENSION = ".tmp"; |
148 | - | ||
149 | /** | 142 | /** |
150 | * Folder suffix for temporary files folder. | 143 | * Folder suffix for temporary files folder. |
151 | */ | 144 | */ |
... | @@ -175,17 +168,14 @@ public class TempJavaFragmentFiles { | ... | @@ -175,17 +168,14 @@ public class TempJavaFragmentFiles { |
175 | * File name for attributes. | 168 | * File name for attributes. |
176 | */ | 169 | */ |
177 | private static final String ATTRIBUTE_FILE_NAME = "Attributes"; | 170 | private static final String ATTRIBUTE_FILE_NAME = "Attributes"; |
178 | - | ||
179 | /** | 171 | /** |
180 | * File name for to string method. | 172 | * File name for to string method. |
181 | */ | 173 | */ |
182 | private static final String TO_STRING_METHOD_FILE_NAME = "ToString"; | 174 | private static final String TO_STRING_METHOD_FILE_NAME = "ToString"; |
183 | - | ||
184 | /** | 175 | /** |
185 | * File name for hash code method. | 176 | * File name for hash code method. |
186 | */ | 177 | */ |
187 | private static final String HASH_CODE_METHOD_FILE_NAME = "HashCode"; | 178 | private static final String HASH_CODE_METHOD_FILE_NAME = "HashCode"; |
188 | - | ||
189 | /** | 179 | /** |
190 | * File name for equals method. | 180 | * File name for equals method. |
191 | */ | 181 | */ |
... | @@ -200,17 +190,14 @@ public class TempJavaFragmentFiles { | ... | @@ -200,17 +190,14 @@ public class TempJavaFragmentFiles { |
200 | * File name for interface java file name suffix. | 190 | * File name for interface java file name suffix. |
201 | */ | 191 | */ |
202 | private static final String INTERFACE_FILE_NAME_SUFFIX = EMPTY_STRING; | 192 | private static final String INTERFACE_FILE_NAME_SUFFIX = EMPTY_STRING; |
203 | - | ||
204 | /** | 193 | /** |
205 | * File name for builder interface file name suffix. | 194 | * File name for builder interface file name suffix. |
206 | */ | 195 | */ |
207 | private static final String BUILDER_INTERFACE_FILE_NAME_SUFFIX = BUILDER + INTERFACE; | 196 | private static final String BUILDER_INTERFACE_FILE_NAME_SUFFIX = BUILDER + INTERFACE; |
208 | - | ||
209 | /** | 197 | /** |
210 | * File name for builder class file name suffix. | 198 | * File name for builder class file name suffix. |
211 | */ | 199 | */ |
212 | private static final String BUILDER_CLASS_FILE_NAME_SUFFIX = BUILDER; | 200 | private static final String BUILDER_CLASS_FILE_NAME_SUFFIX = BUILDER; |
213 | - | ||
214 | /** | 201 | /** |
215 | * File name for impl class file name suffix. | 202 | * File name for impl class file name suffix. |
216 | */ | 203 | */ |
... | @@ -225,17 +212,14 @@ public class TempJavaFragmentFiles { | ... | @@ -225,17 +212,14 @@ public class TempJavaFragmentFiles { |
225 | * Java file handle for interface file. | 212 | * Java file handle for interface file. |
226 | */ | 213 | */ |
227 | private File interfaceJavaFileHandle; | 214 | private File interfaceJavaFileHandle; |
228 | - | ||
229 | /** | 215 | /** |
230 | * Java file handle for builder interface file. | 216 | * Java file handle for builder interface file. |
231 | */ | 217 | */ |
232 | private File builderInterfaceJavaFileHandle; | 218 | private File builderInterfaceJavaFileHandle; |
233 | - | ||
234 | /** | 219 | /** |
235 | * Java file handle for builder class file. | 220 | * Java file handle for builder class file. |
236 | */ | 221 | */ |
237 | private File builderClassJavaFileHandle; | 222 | private File builderClassJavaFileHandle; |
238 | - | ||
239 | /** | 223 | /** |
240 | * Java file handle for impl class file. | 224 | * Java file handle for impl class file. |
241 | */ | 225 | */ |
... | @@ -270,17 +254,14 @@ public class TempJavaFragmentFiles { | ... | @@ -270,17 +254,14 @@ public class TempJavaFragmentFiles { |
270 | * Temporary file handle for hash code method of class. | 254 | * Temporary file handle for hash code method of class. |
271 | */ | 255 | */ |
272 | private File hashCodeImplTempFileHandle; | 256 | private File hashCodeImplTempFileHandle; |
273 | - | ||
274 | /** | 257 | /** |
275 | * Temporary file handle for equals method of class. | 258 | * Temporary file handle for equals method of class. |
276 | */ | 259 | */ |
277 | private File equalsImplTempFileHandle; | 260 | private File equalsImplTempFileHandle; |
278 | - | ||
279 | /** | 261 | /** |
280 | * Temporary file handle for to string method of class. | 262 | * Temporary file handle for to string method of class. |
281 | */ | 263 | */ |
282 | private File toStringImplTempFileHandle; | 264 | private File toStringImplTempFileHandle; |
283 | - | ||
284 | /** | 265 | /** |
285 | * Temporary file handle for enum class file. | 266 | * Temporary file handle for enum class file. |
286 | */ | 267 | */ |
... | @@ -295,17 +276,18 @@ public class TempJavaFragmentFiles { | ... | @@ -295,17 +276,18 @@ public class TempJavaFragmentFiles { |
295 | * Is attribute added. | 276 | * Is attribute added. |
296 | */ | 277 | */ |
297 | private boolean isAttributePresent = false; | 278 | private boolean isAttributePresent = false; |
298 | - | ||
299 | /** | 279 | /** |
300 | * Current enum's value. | 280 | * Current enum's value. |
301 | */ | 281 | */ |
302 | private int enumValue; | 282 | private int enumValue; |
303 | - | ||
304 | /* | 283 | /* |
305 | * Java file handle for enum class. | 284 | * Java file handle for enum class. |
306 | */ | 285 | */ |
307 | private File enumClassJavaFileHandle; | 286 | private File enumClassJavaFileHandle; |
308 | 287 | ||
288 | + public TempJavaFragmentFiles() { | ||
289 | + } | ||
290 | + | ||
309 | /** | 291 | /** |
310 | * Returns enum class java file handle. | 292 | * Returns enum class java file handle. |
311 | * | 293 | * | ... | ... |
... | @@ -60,7 +60,6 @@ public class TempJavaTypeFragmentFiles | ... | @@ -60,7 +60,6 @@ public class TempJavaTypeFragmentFiles |
60 | * File name for construction for special type like union, typedef. | 60 | * File name for construction for special type like union, typedef. |
61 | */ | 61 | */ |
62 | private static final String CONSTRUCTOR_FOR_TYPE_FILE_NAME = "ConstructorForType"; | 62 | private static final String CONSTRUCTOR_FOR_TYPE_FILE_NAME = "ConstructorForType"; |
63 | - | ||
64 | /** | 63 | /** |
65 | * File name for from string method. | 64 | * File name for from string method. |
66 | */ | 65 | */ |
... | @@ -81,7 +80,6 @@ public class TempJavaTypeFragmentFiles | ... | @@ -81,7 +80,6 @@ public class TempJavaTypeFragmentFiles |
81 | * Temporary file handle for of string method of class. | 80 | * Temporary file handle for of string method of class. |
82 | */ | 81 | */ |
83 | private File ofStringImplTempFileHandle; | 82 | private File ofStringImplTempFileHandle; |
84 | - | ||
85 | /** | 83 | /** |
86 | * Temporary file handle for constructor for type class. | 84 | * Temporary file handle for constructor for type class. |
87 | */ | 85 | */ |
... | @@ -96,7 +94,6 @@ public class TempJavaTypeFragmentFiles | ... | @@ -96,7 +94,6 @@ public class TempJavaTypeFragmentFiles |
96 | * Java file handle for typedef class file. | 94 | * Java file handle for typedef class file. |
97 | */ | 95 | */ |
98 | private File typedefClassJavaFileHandle; | 96 | private File typedefClassJavaFileHandle; |
99 | - | ||
100 | /** | 97 | /** |
101 | * Java file handle for type class like union, typedef file. | 98 | * Java file handle for type class like union, typedef file. |
102 | */ | 99 | */ | ... | ... |
... | @@ -113,7 +113,7 @@ public class YangJavaNotification | ... | @@ -113,7 +113,7 @@ public class YangJavaNotification |
113 | public void generateCodeEntry(YangPluginConfig yangPlugin) | 113 | public void generateCodeEntry(YangPluginConfig yangPlugin) |
114 | throws IOException { | 114 | throws IOException { |
115 | 115 | ||
116 | - /* | 116 | + /** |
117 | * As part of the notification support the following files needs to be generated. | 117 | * As part of the notification support the following files needs to be generated. |
118 | * 1) Subject of the notification(event), this is simple interface with builder class. | 118 | * 1) Subject of the notification(event), this is simple interface with builder class. |
119 | * 2) Event class extending "AbstractEvent" and defining event type enum. | 119 | * 2) Event class extending "AbstractEvent" and defining event type enum. |
... | @@ -121,18 +121,19 @@ public class YangJavaNotification | ... | @@ -121,18 +121,19 @@ public class YangJavaNotification |
121 | * | 121 | * |
122 | * The manager class needs to extend the ListenerRegistry. | 122 | * The manager class needs to extend the ListenerRegistry. |
123 | */ | 123 | */ |
124 | + | ||
125 | + | ||
126 | + // Generate subject of the notification(event), this is simple interface with builder class. | ||
124 | generateCodeOfNode(this, yangPlugin); | 127 | generateCodeOfNode(this, yangPlugin); |
125 | } | 128 | } |
126 | 129 | ||
127 | /** | 130 | /** |
128 | * Creates a java file using the YANG notification info. | 131 | * Creates a java file using the YANG notification info. |
129 | - * | ||
130 | - * @throws IOException input output operation fail | ||
131 | */ | 132 | */ |
132 | @Override | 133 | @Override |
133 | public void generateCodeExit() | 134 | public void generateCodeExit() |
134 | throws IOException { | 135 | throws IOException { |
135 | - /* | 136 | + /** |
136 | * As part of the notification support the following files needs to be generated. | 137 | * As part of the notification support the following files needs to be generated. |
137 | * 1) Subject of the notification(event), this is simple interface with builder class. | 138 | * 1) Subject of the notification(event), this is simple interface with builder class. |
138 | * 2) Event class extending "AbstractEvent" and defining event type enum. | 139 | * 2) Event class extending "AbstractEvent" and defining event type enum. | ... | ... |
-
Please register or login to post a comment