blob: 965367ccfa03bcd3c7615e70503c1bcc1cd51e9d [file] [log] [blame]
Bharat saraswal708abc02016-02-12 20:48:30 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Bharat saraswal708abc02016-02-12 20:48:30 +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.utils;
18
Vinod Kumar S38046502016-03-23 15:30:27 +053019import java.io.File;
b.janani1fef2732016-03-04 12:29:05 +053020import java.util.Arrays;
21import java.util.List;
22
Bharat saraswal708abc02016-02-12 20:48:30 +053023/**
Bharat saraswald9822e92016-04-05 15:13:44 +053024 * Represents utilities constants which are used while generating java files.
Bharat saraswal708abc02016-02-12 20:48:30 +053025 */
26public final class UtilConstants {
27
28 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +053029 * JavaDocs for impl class.
Bharat saraswal708abc02016-02-12 20:48:30 +053030 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +053031 public static final String IMPL_CLASS_JAVA_DOC = " * Represents the implementation of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053032
33 /**
34 * JavaDocs for builder class.
35 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +053036 public static final String BUILDER_CLASS_JAVA_DOC = " * Represents the builder implementation of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053037
38 /**
39 * JavaDocs for interface class.
40 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +053041 public static final String INTERFACE_JAVA_DOC = " * Abstraction of an entity which represents the"
42 + " functionality of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053043
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +053044
45 /**
46 * JavaDocs for event.
47 */
48 public static final String EVENT_JAVA_DOC = " * Represents event implementation of ";
49
50 /**
51 * JavaDocs for event listener.
52 */
53 public static final String EVENT_LISTENER_JAVA_DOC = " * Abstraction for event listener of ";
54
55
Bharat saraswal2f11f652016-03-25 18:19:46 +053056 /**
57 * JavaDocs for builder interface class.
58 */
Bharat saraswal708abc02016-02-12 20:48:30 +053059 public static final String BUILDER_INTERFACE_JAVA_DOC = " * Builder for ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053060
61 /**
Bharat saraswald72411a2016-04-19 01:00:16 +053062 * JavaDocs for enum class.
63 */
64 public static final String ENUM_CLASS_JAVADOC = " * Represents ENUM data of ";
65
66 /**
67 * JavaDocs for enum attribute.
68 */
69 public static final String ENUM_ATTRIBUTE_JAVADOC = " * Represents ";
70
71 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +053072 * JavaDocs for package info class.
73 */
Bharat saraswald72411a2016-04-19 01:00:16 +053074 public static final String PACKAGE_INFO_JAVADOC = " * Implementation of YANG node ";
75
76 /**
77 * JavaDocs for package info class.
78 */
79 public static final String PACKAGE_INFO_JAVADOC_OF_CHILD = "'s children nodes";
Bharat saraswal2f11f652016-03-25 18:19:46 +053080
81 /**
82 * JavaDocs's first line.
83 */
Bharat saraswal708abc02016-02-12 20:48:30 +053084 public static final String JAVA_DOC_FIRST_LINE = "/**\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +053085
86 /**
87 * JavaDocs's last line.
88 */
Bharat saraswal708abc02016-02-12 20:48:30 +053089 public static final String JAVA_DOC_END_LINE = " */\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +053090
91 /**
92 * JavaDocs's param annotation.
93 */
Bharat saraswal708abc02016-02-12 20:48:30 +053094 public static final String JAVA_DOC_PARAM = " * @param ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053095
96 /**
97 * JavaDocs's return annotation.
98 */
Bharat saraswal708abc02016-02-12 20:48:30 +053099 public static final String JAVA_DOC_RETURN = " * @return ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530100
101 /**
102 * JavaDocs's throw annotation.
103 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530104 public static final String JAVA_DOC_THROWS = " * @throws ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530105
106 /**
107 * JavaDocs's description for setter method.
108 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530109 public static final String JAVA_DOC_SETTERS = " * Returns the builder object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530110
111 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530112 * JavaDocs's description for setter method.
113 */
114 public static final String JAVA_DOC_MANAGER_SETTERS = " * Sets the value to attribute ";
115
116 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530117 * JavaDocs's description for OF method.
118 */
b.janani1fef2732016-03-04 12:29:05 +0530119 public static final String JAVA_DOC_OF = " * Returns the object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530120
121 /**
122 * JavaDocs's description for typedef' setter method.
123 */
b.janani1fef2732016-03-04 12:29:05 +0530124 public static final String JAVA_DOC_SETTERS_COMMON = " * Sets the value of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530125
126 /**
127 * JavaDocs's description for getter method.
128 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530129 public static final String JAVA_DOC_GETTERS = " * Returns the attribute ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530130
131 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530132 * JavaDocs's description for constructor.
133 */
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530134 public static final String JAVA_DOC_CONSTRUCTOR = " * Creates an instance of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530135
136 /**
137 * JavaDocs's description for build method.
138 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530139 public static final String JAVA_DOC_BUILD = " * Builds object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530140
141 /**
142 * JavaDocs's return statement for build method.
143 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530144 public static final String JAVA_DOC_BUILD_RETURN = "object of ";
145
146 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530147 * JavaDocs's statement for builder object.
148 */
149 public static final String BUILDER_OBJECT = "builder object of ";
150
151 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530152 * JavaDocs's statement for rpc method.
153 */
154 public static final String JAVA_DOC_RPC = " * Service interface of ";
155
156 /**
157 * JavaDocs's statement for rpc's input string.
158 */
159 public static final String RPC_INPUT_STRING = "input of service interface ";
160
161 /**
162 * JavaDocs's statement for rpc's output string.
163 */
164 public static final String RPC_OUTPUT_STRING = "output of service interface ";
165
166 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530167 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530168 */
169 public static final String NEW_LINE = "\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530170
171 /**
172 * Static attribute for multiple new line.
173 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530174 public static final String MULTIPLE_NEW_LINE = "\n\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530175
176 /**
177 * Static attribute for empty line.
178 */
b.janani1fef2732016-03-04 12:29:05 +0530179 public static final String EMPTY_STRING = "";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530180
181 /**
182 * Static attribute for new line with asterisk.
183 */
184 public static final String NEW_LINE_ASTERISK = " *\n";
185
186 /**
187 * Static attribute for period.
188 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530189 public static final String PERIOD = ".";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530190
191 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530192 * Static attribute for parse byte.
193 */
194 public static final String PARSE_BYTE = "parseByte";
195
196 /**
197 * Static attribute for parse short.
198 */
199 public static final String PARSE_SHORT = "parseShort";
200
201 /**
202 * Static attribute for parse int.
203 */
204 public static final String PARSE_INT = "parseInt";
205
206 /**
207 * Static attribute for parse long.
208 */
209 public static final String PARSE_LONG = "parseLong";
210
211 /**
212 * Static attribute for omit null value.
213 */
214 public static final String OMIT_NULL_VALUE_STRING = "omitNullValues()";
215
216 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530217 * Static attribute for colan.
218 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530219 public static final String COLAN = ":";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530220
221 /**
222 * Static attribute for underscore.
223 */
b.janani1fef2732016-03-04 12:29:05 +0530224 public static final String UNDER_SCORE = "_";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530225
226 /**
227 * Static attribute for semi-colan.
228 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530229 public static final String SEMI_COLAN = ";";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530230
231 /**
232 * Static attribute for hyphen.
233 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530234 public static final String HYPHEN = "-";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530235
236 /**
237 * Static attribute for space.
238 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530239 public static final String SPACE = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530240
241 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530242 * Static attribute for input string.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530243 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530244 public static final String INPUT = "input";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530245
246 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530247 * Static attribute for output variable of rpc.
248 */
249 public static final String RPC_INPUT_VAR_NAME = "inputVar";
250
251 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530252 * Static attribute for new line.
253 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530254 public static final String EQUAL = "=";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530255
256 /**
257 * Static attribute for slash syntax.
258 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530259 public static final String SLASH = File.separator;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530260
261 /**
262 * Static attribute for add syntax.
263 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530264 public static final String ADD = "+";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530265
266 /**
267 * Static attribute for asterisk.
268 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530269 public static final String ASTERISK = "*";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530270
271 /**
272 * Static attribute for at.
273 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530274 public static final String AT = "@";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530275
276 /**
277 * Static attribute for quotes.
278 */
b.janani1fef2732016-03-04 12:29:05 +0530279 public static final String QUOTES = "\"";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530280
281 /**
282 * Static attribute for ampersand.
283 */
b.janani1fef2732016-03-04 12:29:05 +0530284 public static final String AND = "&";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530285
286 /**
287 * Static attribute for comma.
288 */
b.janani1fef2732016-03-04 12:29:05 +0530289 public static final String COMMA = ",";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530290
291 /**
292 * Static attribute for add syntax.
293 */
b.janani1fef2732016-03-04 12:29:05 +0530294 public static final String ADD_STRING = "add";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530295
296 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530297 * Static attribute for from syntax.
298 */
299 public static final String FROM_STRING_METHOD_NAME = "fromString";
300
301 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530302 * Static attribute for check not null syntax.
303 */
b.janani1fef2732016-03-04 12:29:05 +0530304 public static final String CHECK_NOT_NULL_STRING = "checkNotNull";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530305
306 /**
307 * Static attribute for hash code syntax.
308 */
b.janani1fef2732016-03-04 12:29:05 +0530309 public static final String HASH_CODE_STRING = "hashCode";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530310
311 /**
312 * Static attribute for equals syntax.
313 */
b.janani1fef2732016-03-04 12:29:05 +0530314 public static final String EQUALS_STRING = "equals";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530315
316 /**
317 * Static attribute for object.
318 */
b.janani1fef2732016-03-04 12:29:05 +0530319 public static final String OBJECT_STRING = "Object";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530320
321 /**
322 * Static attribute for instance of syntax.
323 */
b.janani1fef2732016-03-04 12:29:05 +0530324 public static final String INSTANCE_OF = " instanceof ";
325
Bharat saraswal2f11f652016-03-25 18:19:46 +0530326 /**
327 * Static attribute for value syntax.
328 */
b.janani1fef2732016-03-04 12:29:05 +0530329 public static final String VALUE = "value";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530330
331 /**
Bharat saraswald72411a2016-04-19 01:00:16 +0530332 * Static attribute for enumValue syntax.
333 */
334 public static final String ENUM_VALUE = "enumValue";
335
336 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530337 * Static attribute for suffix s.
338 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530339 public static final String SUFFIX_S = "s";
b.janani1fef2732016-03-04 12:29:05 +0530340
Bharat saraswal2f11f652016-03-25 18:19:46 +0530341 /**
342 * Static attribute for if.
343 */
b.janani1fef2732016-03-04 12:29:05 +0530344 public static final String IF = "if";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530345
346 /**
347 * Static attribute for for.
348 */
b.janani1fef2732016-03-04 12:29:05 +0530349 public static final String FOR = "for";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530350
351 /**
352 * Static attribute for while.
353 */
b.janani1fef2732016-03-04 12:29:05 +0530354 public static final String WHILE = "while";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530355
356 /**
357 * Static attribute for of.
358 */
b.janani1fef2732016-03-04 12:29:05 +0530359 public static final String OF = "of";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530360
361 /**
362 * Static attribute for other.
363 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530364 public static final String OTHER = "other";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530365
366 /**
367 * Static attribute for obj syntax.
368 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530369 public static final String OBJ = "obj";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530370
371 /**
372 * Static attribute for hash syntax.
373 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530374 public static final String HASH = "hash";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530375
376 /**
377 * Static attribute for to syntax.
378 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530379 public static final String TO = "to";
b.janani1fef2732016-03-04 12:29:05 +0530380
Bharat saraswal2f11f652016-03-25 18:19:46 +0530381 /**
382 * Static attribute for true syntax.
383 */
b.janani1fef2732016-03-04 12:29:05 +0530384 public static final String TRUE = "true";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530385
386 /**
387 * Static attribute for false syntax.
388 */
b.janani1fef2732016-03-04 12:29:05 +0530389 public static final String FALSE = "false";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530390
391 /**
392 * Static attribute for org.
393 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530394 public static final String ORG = "org";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530395
396 /**
397 * Static attribute for temp.
398 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530399 public static final String TEMP = "temp";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530400
401 /**
402 * Static attribute for YANG file directory.
403 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530404 public static final String YANG_RESOURCES = "yang/resources";
Bharat saraswal708abc02016-02-12 20:48:30 +0530405
406 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530407 * Static attribute for diamond close bracket syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530408 */
409 public static final String DIAMOND_OPEN_BRACKET = "<";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530410
411 /**
412 * Static attribute for diamond close bracket syntax.
413 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530414 public static final String DIAMOND_CLOSE_BRACKET = ">";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530415
416 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530417 * Static attribute for exception syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530418 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530419 public static final String EXCEPTION = "Exception";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530420
421 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530422 * Static attribute for exception variable syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530423 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530424 public static final String EXCEPTION_VAR = "e";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530425
426 /**
427 * Static attribute for open parenthesis syntax.
428 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530429 public static final String OPEN_PARENTHESIS = "(";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530430
431 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530432 * Static attribute for clear syntax.
433 */
434 public static final String CLEAR = "clear";
435
436 /**
437 * Static attribute for temp val syntax.
438 */
439 public static final String TMP_VAL = "tmpVal";
440
441 /**
442 * From string parameter name.
443 */
444 public static final String FROM_STRING_PARAM_NAME = "valInString";
445
446 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530447 * Static attribute for close parenthesis syntax.
448 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530449 public static final String CLOSE_PARENTHESIS = ")";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530450
451 /**
452 * Static attribute for open curly bracket syntax.
453 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530454 public static final String OPEN_CURLY_BRACKET = "{";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530455
456 /**
457 * Static attribute for close curly bracket syntax.
458 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530459 public static final String CLOSE_CURLY_BRACKET = "}";
460
461 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530462 * Static attribute for getter method prefix.
Bharat saraswal708abc02016-02-12 20:48:30 +0530463 */
464 public static final String GET_METHOD_PREFIX = "get";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530465
466 /**
467 * Static attribute for setter method prefix.
468 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530469 public static final String SET_METHOD_PREFIX = "set";
470
471 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530472 * Static attribute for four space indentation.
Bharat saraswal708abc02016-02-12 20:48:30 +0530473 */
474 public static final String FOUR_SPACE_INDENTATION = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530475
476 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530477 * Static attribute for not syntax.
478 */
479 public static final String NOT = "!";
480
481 /**
482 * Static attribute for try syntax.
483 */
484 public static final String TRY = "try";
485
486 /**
487 * Static attribute for catch syntax.
488 */
489 public static final String CATCH = "catch";
490
491 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530492 * Static attribute for eight space indentation.
493 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530494 public static final String EIGHT_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + FOUR_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530495
496 /**
497 * Static attribute for twelve space indentation.
498 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530499 public static final String TWELVE_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530500
501 /**
502 * Static attribute for sixteen space indentation.
503 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530504 public static final String SIXTEEN_SPACE_INDENTATION = EIGHT_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
505
506 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530507 * Static attribute for generated code path.
Bharat saraswal708abc02016-02-12 20:48:30 +0530508 */
Bharat saraswal8f2a6c52016-03-09 18:34:56 +0530509 public static final String YANG_GEN_DIR = "src/main/java/";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530510
511 /**
512 * Static attribute for base package.
513 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530514 public static final String DEFAULT_BASE_PKG = "org.onosproject.yang.gen";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530515
516 /**
517 * Static attribute for YANG date prefix.
518 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530519 public static final String REVISION_PREFIX = "rev";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530520
521 /**
janani bde4ffab2016-04-15 16:18:30 +0530522 * Static attribute for YANG automatic prefix for identifiers with keywords and beginning with digits.
523 */
524 public static final String YANG_AUTO_PREFIX = "yangAutoPrefix";
525
526 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530527 * Static attribute for YANG version perifx.
528 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530529 public static final String VERSION_PREFIX = "v";
530
531 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530532 * Static attribute for private modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530533 */
534 public static final String PRIVATE = "private";
Bharat saraswal708abc02016-02-12 20:48:30 +0530535
536 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530537 * Static attribute for public modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530538 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530539 public static final String PUBLIC = "public";
540
541 /**
542 * Static attribute for protected modifier.
543 */
544 public static final String PROTECTED = "protected";
545
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530546 /**
547 * Void java type.
548 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530549 public static final String VOID = "void";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530550
551 /**
552 * String built in java type.
553 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530554 public static final String STRING_DATA_TYPE = "String";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530555
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530556 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530557 * Java.lang.* packages.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530558 */
559 public static final String JAVA_LANG = "java.lang";
560
561 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530562 * Java.math.* packages.
563 */
564 public static final String JAVA_MATH = "java.math";
565
566 /**
567 * Boolean built in java type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530568 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530569 public static final String BOOLEAN_DATA_TYPE = "boolean";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530570
571 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530572 * BigInteger built in java type.
573 */
574 public static final String BIG_INTEGER = "BigInteger";
575
576 /**
577 * Byte java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530578 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530579 public static final String BYTE = "byte";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530580
581 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530582 * Short java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530583 */
584 public static final String SHORT = "short";
585
586 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530587 * Int java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530588 */
589 public static final String INT = "int";
590
591 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530592 * Long java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530593 */
594 public static final String LONG = "long";
595
596 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530597 * Float java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530598 */
599 public static final String FLOAT = "float";
600
601 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530602 * Double java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530603 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530604 public static final String DOUBLE = "double";
605
606 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530607 * Boolean built in java wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530608 */
609 public static final String BOOLEAN_WRAPPER = "Boolean";
610
611 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530612 * Byte java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530613 */
614 public static final String BYTE_WRAPPER = "Byte";
615
616 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530617 * Short java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530618 */
619 public static final String SHORT_WRAPPER = "Short";
620
621 /**
622 * Integer java built in wrapper type.
623 */
624 public static final String INTEGER_WRAPPER = "Integer";
625
626 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530627 * Long java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530628 */
629 public static final String LONG_WRAPPER = "Long";
630
631 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530632 * YangUint64 java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530633 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530634 public static final String YANG_UINT64 = "YangUint64";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530635
636 /**
Bharat saraswale2d51d62016-03-23 19:40:35 +0530637 * List of keywords in java, this is used for checking if the input does not contain these keywords.
b.janani1fef2732016-03-04 12:29:05 +0530638 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530639 public static final List<String> JAVA_KEY_WORDS = Arrays.asList(
640 "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue",
641 "default", "do", "double", "else", "extends", "false", "final", "finally", "float", "for", "goto", "if",
642 "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "null", "package",
643 "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch",
644 "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while");
b.janani1fef2732016-03-04 12:29:05 +0530645
646 /**
janani bde4ffab2016-04-15 16:18:30 +0530647 * Static attribute for regex for all the special characters.
b.janani1fef2732016-03-04 12:29:05 +0530648 */
janani bde4ffab2016-04-15 16:18:30 +0530649 public static final String REGEX_WITH_ALL_SPECIAL_CHAR = "\\p{Punct}+";
650
651 /**
652 * Static attribute for regex for three special characters used in identifier.
653 */
654 public static final String REGEX_FOR_IDENTIFIER_SPECIAL_CHAR = "[. _ -]+";
655
656 /**
657 * Static attribute for regex for period.
658 */
659 public static final String REGEX_FOR_PERIOD = "[.]";
660
661 /**
662 * Static attribute for regex for underscore.
663 */
664 public static final String REGEX_FOR_UNDERSCORE = "[_]";
665
666 /**
667 * Static attribute for regex for hyphen.
668 */
669 public static final String REGEX_FOR_HYPHEN = "[-]";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530670
671 /**
672 * Static attribute for regex for digits.
673 */
b.janani1fef2732016-03-04 12:29:05 +0530674 public static final String REGEX_FOR_FIRST_DIGIT = "\\d.*";
675
676 /**
janani bde4ffab2016-04-15 16:18:30 +0530677 * Static attribute for regex for single letter.
678 */
679 public static final String REGEX_FOR_SINGLE_LETTER = "[a-zA-Z]";
680
681 /**
682 * Static attribute for regex for digits with single letter.
683 */
684 public static final String REGEX_FOR_DIGITS_WITH_SINGLE_LETTER = "[0-9]+[a-zA-Z]";
685
686 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530687 * Static attribute for class syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530688 */
689 public static final String CLASS = "class";
Bharat saraswal708abc02016-02-12 20:48:30 +0530690
691 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530692 * Static attribute for builder syntax.
693 */
694 public static final String BUILDER = "Builder";
695
696 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530697 * Static attribute for manager syntax.
698 */
699 public static final String MANAGER = "Manager";
700
701 /**
702 * Static attribute for service syntax.
703 */
704 public static final String SERVICE = "Service";
705
706
707 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530708 * Static attribute for interface syntax.
709 */
710 public static final String INTERFACE = "interface";
711
712 /**
713 * Static attribute for enum syntax.
714 */
715 public static final String ENUM = "enum";
716
717 /**
718 * Static attribute for static syntax.
719 */
720 public static final String STATIC = "static";
721
722 /**
723 * Static attribute for final syntax.
724 */
725 public static final String FINAL = "final";
726
727 /**
728 * Static attribute for package syntax.
729 */
730 public static final String PACKAGE = "package";
731
732 /**
733 * Static attribute for import syntax.
734 */
735 public static final String IMPORT = "import ";
736
737 /**
738 * Static attribute for null syntax.
739 */
740 public static final String NULL = "null";
741
742 /**
743 * Static attribute for return syntax.
744 */
745 public static final String RETURN = "return";
746
747 /**
748 * Static attribute for java new syntax.
749 */
750 public static final String NEW = "new";
751
752 /**
753 * Static attribute for this syntax.
754 */
755 public static final String THIS = "this";
756
757 /**
758 * Static attribute for implements syntax.
759 */
760 public static final String IMPLEMENTS = "implements";
761
762 /**
763 * Static attribute for extends syntax.
764 */
765 public static final String EXTEND = "extends";
766
767 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530768 * Static attribute for service interface suffix syntax.
769 */
770 public static final String SERVICE_METHOD_STRING = "Service";
771
772 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530773 * For event file generation.
774 */
775 public static final String EVENT_STRING = "Event";
776
777 /**
778 * For event listener file generation.
779 */
780 public static final String EVENT_LISTENER_STRING = "Listener";
781
782 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530783 * Static attribute for impl syntax.
784 */
785 public static final String IMPL = "Impl";
786
787 /**
788 * Static attribute for build method syntax.
789 */
790 public static final String BUILD = "build";
791
792 /**
793 * Static attribute for object.
794 */
795 public static final String OBJECT = "Object";
796
797 /**
798 * Static attribute for override annotation.
799 */
800 public static final String OVERRIDE = "@Override";
801
802 /**
803 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530804 */
b.janani1fef2732016-03-04 12:29:05 +0530805 public static final String COLLECTION_IMPORTS = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530806
807 /**
808 * Static attribute for more object import package.
809 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530810 public static final String GOOGLE_MORE_OBJECT_IMPORT_PKG = "com.google.common.base";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530811
812 /**
813 * Static attribute for more object import class.
814 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530815 public static final String GOOGLE_MORE_OBJECT_IMPORT_CLASS = "MoreObjects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530816
817 /**
818 * Static attribute for to string method.
819 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530820 public static final String GOOGLE_MORE_OBJECT_METHOD_STRING = " MoreObjects.toStringHelper(getClass())";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530821
822 /**
823 * Static attribute for java utilities import package.
824 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530825 public static final String JAVA_UTIL_OBJECTS_IMPORT_PKG = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530826
827 /**
828 * Static attribute for java utilities objects import class.
829 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530830 public static final String JAVA_UTIL_OBJECTS_IMPORT_CLASS = "Objects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530831
832 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530833 * Static attribute for HasAugmentation class import package.
834 */
835 public static final String HAS_AUGMENTATION_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
836
837 /**
838 * Static attribute for HasAugmentation class import class.
839 */
840 public static final String HAS_AUGMENTATION_CLASS_IMPORT_CLASS = "HasAugmentation;\n";
841
842 /**
843 * Static attribute for AugmentedInfo class import package.
844 */
845 public static final String AUGMENTED_INFO_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
846
847 /**
848 * Static attribute for AugmentedInfo class import class.
849 */
850 public static final String AUGMENTED_INFO_CLASS_IMPORT_CLASS = "AugmentedInfo;\n";
851
852 /**
853 * Static attribute for augmentation class.
854 */
855 public static final String AUGMENTATION = "Augmentation";
856
857 /**
858 * Static attribute for HasAugmentation class.
859 */
860 public static final String HAS_AUGMENTATION = "HasAugmentation";
861
862 /**
863 * Static attribute for AugmentedInfo class.
864 */
865 public static final String AUGMENTED_INFO = "AugmentedInfo";
866
867 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530868 * Static attribute for list.
869 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530870 public static final String LIST = "List";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530871
872 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530873 * Static attribute for array list.
874 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530875 public static final String ARRAY_LIST = "ArrayList";
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530876
877 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530878 * comment to be added for autogenerated impl methods.
879 */
880 public static final String YANG_UTILS_TODO = "//TODO: YANG utils generated code";
881
882 /**
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530883 * Creates an instance of util constants.
884 */
885 private UtilConstants() {
886 }
Bharat saraswal708abc02016-02-12 20:48:30 +0530887}