blob: eeee061c6b4d438e4ac9af8e7d1fb268b31e7f8b [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
44 /**
45 * JavaDocs for builder interface class.
46 */
Bharat saraswal708abc02016-02-12 20:48:30 +053047 public static final String BUILDER_INTERFACE_JAVA_DOC = " * Builder for ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053048
49 /**
Bharat saraswald72411a2016-04-19 01:00:16 +053050 * JavaDocs for enum class.
51 */
52 public static final String ENUM_CLASS_JAVADOC = " * Represents ENUM data of ";
53
54 /**
55 * JavaDocs for enum attribute.
56 */
57 public static final String ENUM_ATTRIBUTE_JAVADOC = " * Represents ";
58
59 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +053060 * JavaDocs for package info class.
61 */
Bharat saraswald72411a2016-04-19 01:00:16 +053062 public static final String PACKAGE_INFO_JAVADOC = " * Implementation of YANG node ";
63
64 /**
65 * JavaDocs for package info class.
66 */
67 public static final String PACKAGE_INFO_JAVADOC_OF_CHILD = "'s children nodes";
Bharat saraswal2f11f652016-03-25 18:19:46 +053068
69 /**
70 * JavaDocs's first line.
71 */
Bharat saraswal708abc02016-02-12 20:48:30 +053072 public static final String JAVA_DOC_FIRST_LINE = "/**\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +053073
74 /**
75 * JavaDocs's last line.
76 */
Bharat saraswal708abc02016-02-12 20:48:30 +053077 public static final String JAVA_DOC_END_LINE = " */\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +053078
79 /**
80 * JavaDocs's param annotation.
81 */
Bharat saraswal708abc02016-02-12 20:48:30 +053082 public static final String JAVA_DOC_PARAM = " * @param ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053083
84 /**
85 * JavaDocs's return annotation.
86 */
Bharat saraswal708abc02016-02-12 20:48:30 +053087 public static final String JAVA_DOC_RETURN = " * @return ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053088
89 /**
90 * JavaDocs's throw annotation.
91 */
Bharat saraswal708abc02016-02-12 20:48:30 +053092 public static final String JAVA_DOC_THROWS = " * @throws ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053093
94 /**
95 * JavaDocs's description for setter method.
96 */
Bharat saraswal708abc02016-02-12 20:48:30 +053097 public static final String JAVA_DOC_SETTERS = " * Returns the builder object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053098
99 /**
100 * JavaDocs's description for OF method.
101 */
b.janani1fef2732016-03-04 12:29:05 +0530102 public static final String JAVA_DOC_OF = " * Returns the object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530103
104 /**
105 * JavaDocs's description for typedef' setter method.
106 */
b.janani1fef2732016-03-04 12:29:05 +0530107 public static final String JAVA_DOC_SETTERS_COMMON = " * Sets the value of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530108
109 /**
110 * JavaDocs's description for getter method.
111 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530112 public static final String JAVA_DOC_GETTERS = " * Returns the attribute ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530113
114 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530115 * JavaDocs's description for constructor.
116 */
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530117 public static final String JAVA_DOC_CONSTRUCTOR = " * Creates an instance of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530118
119 /**
120 * JavaDocs's description for build method.
121 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530122 public static final String JAVA_DOC_BUILD = " * Builds object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530123
124 /**
125 * JavaDocs's return statement for build method.
126 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530127 public static final String JAVA_DOC_BUILD_RETURN = "object of ";
128
129 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530130 * JavaDocs's statement for builder object.
131 */
132 public static final String BUILDER_OBJECT = "builder object of ";
133
134 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530135 * JavaDocs's statement for rpc method.
136 */
137 public static final String JAVA_DOC_RPC = " * Service interface of ";
138
139 /**
140 * JavaDocs's statement for rpc's input string.
141 */
142 public static final String RPC_INPUT_STRING = "input of service interface ";
143
144 /**
145 * JavaDocs's statement for rpc's output string.
146 */
147 public static final String RPC_OUTPUT_STRING = "output of service interface ";
148
149 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530150 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530151 */
152 public static final String NEW_LINE = "\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530153
154 /**
155 * Static attribute for multiple new line.
156 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530157 public static final String MULTIPLE_NEW_LINE = "\n\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530158
159 /**
160 * Static attribute for empty line.
161 */
b.janani1fef2732016-03-04 12:29:05 +0530162 public static final String EMPTY_STRING = "";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530163
164 /**
165 * Static attribute for new line with asterisk.
166 */
167 public static final String NEW_LINE_ASTERISK = " *\n";
168
169 /**
170 * Static attribute for period.
171 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530172 public static final String PERIOD = ".";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530173
174 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530175 * Static attribute for parse byte.
176 */
177 public static final String PARSE_BYTE = "parseByte";
178
179 /**
180 * Static attribute for parse short.
181 */
182 public static final String PARSE_SHORT = "parseShort";
183
184 /**
185 * Static attribute for parse int.
186 */
187 public static final String PARSE_INT = "parseInt";
188
189 /**
190 * Static attribute for parse long.
191 */
192 public static final String PARSE_LONG = "parseLong";
193
194 /**
195 * Static attribute for omit null value.
196 */
197 public static final String OMIT_NULL_VALUE_STRING = "omitNullValues()";
198
199 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530200 * Static attribute for colan.
201 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530202 public static final String COLAN = ":";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530203
204 /**
205 * Static attribute for underscore.
206 */
b.janani1fef2732016-03-04 12:29:05 +0530207 public static final String UNDER_SCORE = "_";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530208
209 /**
210 * Static attribute for semi-colan.
211 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530212 public static final String SEMI_COLAN = ";";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530213
214 /**
215 * Static attribute for hyphen.
216 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530217 public static final String HYPHEN = "-";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530218
219 /**
220 * Static attribute for space.
221 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530222 public static final String SPACE = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530223
224 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530225 * Static attribute for input string.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530226 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530227 public static final String INPUT = "input";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530228
229 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530230 * Static attribute for output variable of rpc.
231 */
232 public static final String RPC_INPUT_VAR_NAME = "inputVar";
233
234 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530235 * Static attribute for new line.
236 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530237 public static final String EQUAL = "=";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530238
239 /**
240 * Static attribute for slash syntax.
241 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530242 public static final String SLASH = File.separator;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530243
244 /**
245 * Static attribute for add syntax.
246 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530247 public static final String ADD = "+";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530248
249 /**
250 * Static attribute for asterisk.
251 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530252 public static final String ASTERISK = "*";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530253
254 /**
255 * Static attribute for at.
256 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530257 public static final String AT = "@";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530258
259 /**
260 * Static attribute for quotes.
261 */
b.janani1fef2732016-03-04 12:29:05 +0530262 public static final String QUOTES = "\"";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530263
264 /**
265 * Static attribute for ampersand.
266 */
b.janani1fef2732016-03-04 12:29:05 +0530267 public static final String AND = "&";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530268
269 /**
270 * Static attribute for comma.
271 */
b.janani1fef2732016-03-04 12:29:05 +0530272 public static final String COMMA = ",";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530273
274 /**
275 * Static attribute for add syntax.
276 */
b.janani1fef2732016-03-04 12:29:05 +0530277 public static final String ADD_STRING = "add";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530278
279 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530280 * Static attribute for from syntax.
281 */
282 public static final String FROM_STRING_METHOD_NAME = "fromString";
283
284 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530285 * Static attribute for check not null syntax.
286 */
b.janani1fef2732016-03-04 12:29:05 +0530287 public static final String CHECK_NOT_NULL_STRING = "checkNotNull";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530288
289 /**
290 * Static attribute for hash code syntax.
291 */
b.janani1fef2732016-03-04 12:29:05 +0530292 public static final String HASH_CODE_STRING = "hashCode";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530293
294 /**
295 * Static attribute for equals syntax.
296 */
b.janani1fef2732016-03-04 12:29:05 +0530297 public static final String EQUALS_STRING = "equals";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530298
299 /**
300 * Static attribute for object.
301 */
b.janani1fef2732016-03-04 12:29:05 +0530302 public static final String OBJECT_STRING = "Object";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530303
304 /**
305 * Static attribute for instance of syntax.
306 */
b.janani1fef2732016-03-04 12:29:05 +0530307 public static final String INSTANCE_OF = " instanceof ";
308
Bharat saraswal2f11f652016-03-25 18:19:46 +0530309 /**
310 * Static attribute for value syntax.
311 */
b.janani1fef2732016-03-04 12:29:05 +0530312 public static final String VALUE = "value";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530313
314 /**
Bharat saraswald72411a2016-04-19 01:00:16 +0530315 * Static attribute for enumValue syntax.
316 */
317 public static final String ENUM_VALUE = "enumValue";
318
319 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530320 * Static attribute for suffix s.
321 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530322 public static final String SUFFIX_S = "s";
b.janani1fef2732016-03-04 12:29:05 +0530323
Bharat saraswal2f11f652016-03-25 18:19:46 +0530324 /**
325 * Static attribute for if.
326 */
b.janani1fef2732016-03-04 12:29:05 +0530327 public static final String IF = "if";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530328
329 /**
330 * Static attribute for for.
331 */
b.janani1fef2732016-03-04 12:29:05 +0530332 public static final String FOR = "for";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530333
334 /**
335 * Static attribute for while.
336 */
b.janani1fef2732016-03-04 12:29:05 +0530337 public static final String WHILE = "while";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530338
339 /**
340 * Static attribute for of.
341 */
b.janani1fef2732016-03-04 12:29:05 +0530342 public static final String OF = "of";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530343
344 /**
345 * Static attribute for other.
346 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530347 public static final String OTHER = "other";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530348
349 /**
350 * Static attribute for obj syntax.
351 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530352 public static final String OBJ = "obj";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530353
354 /**
355 * Static attribute for hash syntax.
356 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530357 public static final String HASH = "hash";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530358
359 /**
360 * Static attribute for to syntax.
361 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530362 public static final String TO = "to";
b.janani1fef2732016-03-04 12:29:05 +0530363
Bharat saraswal2f11f652016-03-25 18:19:46 +0530364 /**
365 * Static attribute for true syntax.
366 */
b.janani1fef2732016-03-04 12:29:05 +0530367 public static final String TRUE = "true";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530368
369 /**
370 * Static attribute for false syntax.
371 */
b.janani1fef2732016-03-04 12:29:05 +0530372 public static final String FALSE = "false";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530373
374 /**
375 * Static attribute for org.
376 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530377 public static final String ORG = "org";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530378
379 /**
380 * Static attribute for temp.
381 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530382 public static final String TEMP = "temp";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530383
384 /**
385 * Static attribute for YANG file directory.
386 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530387 public static final String YANG_RESOURCES = "yang/resources";
Bharat saraswal708abc02016-02-12 20:48:30 +0530388
389 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530390 * Static attribute for diamond close bracket syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530391 */
392 public static final String DIAMOND_OPEN_BRACKET = "<";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530393
394 /**
395 * Static attribute for diamond close bracket syntax.
396 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530397 public static final String DIAMOND_CLOSE_BRACKET = ">";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530398
399 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530400 * Static attribute for exception syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530401 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530402 public static final String EXCEPTION = "Exception";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530403
404 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530405 * Static attribute for exception variable syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530406 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530407 public static final String EXCEPTION_VAR = "e";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530408
409 /**
410 * Static attribute for open parenthesis syntax.
411 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530412 public static final String OPEN_PARENTHESIS = "(";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530413
414 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530415 * Static attribute for clear syntax.
416 */
417 public static final String CLEAR = "clear";
418
419 /**
420 * Static attribute for temp val syntax.
421 */
422 public static final String TMP_VAL = "tmpVal";
423
424 /**
425 * From string parameter name.
426 */
427 public static final String FROM_STRING_PARAM_NAME = "valInString";
428
429 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530430 * Static attribute for close parenthesis syntax.
431 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530432 public static final String CLOSE_PARENTHESIS = ")";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530433
434 /**
435 * Static attribute for open curly bracket syntax.
436 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530437 public static final String OPEN_CURLY_BRACKET = "{";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530438
439 /**
440 * Static attribute for close curly bracket syntax.
441 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530442 public static final String CLOSE_CURLY_BRACKET = "}";
443
444 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530445 * Static attribute for getter method prefix.
Bharat saraswal708abc02016-02-12 20:48:30 +0530446 */
447 public static final String GET_METHOD_PREFIX = "get";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530448
449 /**
450 * Static attribute for setter method prefix.
451 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530452 public static final String SET_METHOD_PREFIX = "set";
453
454 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530455 * Static attribute for four space indentation.
Bharat saraswal708abc02016-02-12 20:48:30 +0530456 */
457 public static final String FOUR_SPACE_INDENTATION = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530458
459 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530460 * Static attribute for not syntax.
461 */
462 public static final String NOT = "!";
463
464 /**
465 * Static attribute for try syntax.
466 */
467 public static final String TRY = "try";
468
469 /**
470 * Static attribute for catch syntax.
471 */
472 public static final String CATCH = "catch";
473
474 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530475 * Static attribute for eight space indentation.
476 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530477 public static final String EIGHT_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + FOUR_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530478
479 /**
480 * Static attribute for twelve space indentation.
481 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530482 public static final String TWELVE_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530483
484 /**
485 * Static attribute for sixteen space indentation.
486 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530487 public static final String SIXTEEN_SPACE_INDENTATION = EIGHT_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
488
489 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530490 * Static attribute for generated code path.
Bharat saraswal708abc02016-02-12 20:48:30 +0530491 */
Bharat saraswal8f2a6c52016-03-09 18:34:56 +0530492 public static final String YANG_GEN_DIR = "src/main/java/";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530493
494 /**
495 * Static attribute for base package.
496 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530497 public static final String DEFAULT_BASE_PKG = "org.onosproject.yang.gen";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530498
499 /**
500 * Static attribute for YANG date prefix.
501 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530502 public static final String REVISION_PREFIX = "rev";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530503
504 /**
janani bde4ffab2016-04-15 16:18:30 +0530505 * Static attribute for YANG automatic prefix for identifiers with keywords and beginning with digits.
506 */
507 public static final String YANG_AUTO_PREFIX = "yangAutoPrefix";
508
509 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530510 * Static attribute for YANG version perifx.
511 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530512 public static final String VERSION_PREFIX = "v";
513
514 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530515 * Static attribute for private modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530516 */
517 public static final String PRIVATE = "private";
Bharat saraswal708abc02016-02-12 20:48:30 +0530518
519 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530520 * Static attribute for public modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530521 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530522 public static final String PUBLIC = "public";
523
524 /**
525 * Static attribute for protected modifier.
526 */
527 public static final String PROTECTED = "protected";
528
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530529 /**
530 * Void java type.
531 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530532 public static final String VOID = "void";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530533
534 /**
535 * String built in java type.
536 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530537 public static final String STRING_DATA_TYPE = "String";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530538
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530539 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530540 * Java.lang.* packages.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530541 */
542 public static final String JAVA_LANG = "java.lang";
543
544 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530545 * Java.math.* packages.
546 */
547 public static final String JAVA_MATH = "java.math";
548
549 /**
550 * Boolean built in java type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530551 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530552 public static final String BOOLEAN_DATA_TYPE = "boolean";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530553
554 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530555 * BigInteger built in java type.
556 */
557 public static final String BIG_INTEGER = "BigInteger";
558
559 /**
560 * Byte java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530561 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530562 public static final String BYTE = "byte";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530563
564 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530565 * Short java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530566 */
567 public static final String SHORT = "short";
568
569 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530570 * Int java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530571 */
572 public static final String INT = "int";
573
574 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530575 * Long java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530576 */
577 public static final String LONG = "long";
578
579 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530580 * Float java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530581 */
582 public static final String FLOAT = "float";
583
584 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530585 * Double java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530586 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530587 public static final String DOUBLE = "double";
588
589 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530590 * Boolean built in java wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530591 */
592 public static final String BOOLEAN_WRAPPER = "Boolean";
593
594 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530595 * Byte java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530596 */
597 public static final String BYTE_WRAPPER = "Byte";
598
599 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530600 * Short java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530601 */
602 public static final String SHORT_WRAPPER = "Short";
603
604 /**
605 * Integer java built in wrapper type.
606 */
607 public static final String INTEGER_WRAPPER = "Integer";
608
609 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530610 * Long java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530611 */
612 public static final String LONG_WRAPPER = "Long";
613
614 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530615 * YangUint64 java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530616 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530617 public static final String YANG_UINT64 = "YangUint64";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530618
619 /**
Bharat saraswale2d51d62016-03-23 19:40:35 +0530620 * 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 +0530621 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530622 public static final List<String> JAVA_KEY_WORDS = Arrays.asList(
623 "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue",
624 "default", "do", "double", "else", "extends", "false", "final", "finally", "float", "for", "goto", "if",
625 "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "null", "package",
626 "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch",
627 "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while");
b.janani1fef2732016-03-04 12:29:05 +0530628
629 /**
janani bde4ffab2016-04-15 16:18:30 +0530630 * Static attribute for regex for all the special characters.
b.janani1fef2732016-03-04 12:29:05 +0530631 */
janani bde4ffab2016-04-15 16:18:30 +0530632 public static final String REGEX_WITH_ALL_SPECIAL_CHAR = "\\p{Punct}+";
633
634 /**
635 * Static attribute for regex for three special characters used in identifier.
636 */
637 public static final String REGEX_FOR_IDENTIFIER_SPECIAL_CHAR = "[. _ -]+";
638
639 /**
640 * Static attribute for regex for period.
641 */
642 public static final String REGEX_FOR_PERIOD = "[.]";
643
644 /**
645 * Static attribute for regex for underscore.
646 */
647 public static final String REGEX_FOR_UNDERSCORE = "[_]";
648
649 /**
650 * Static attribute for regex for hyphen.
651 */
652 public static final String REGEX_FOR_HYPHEN = "[-]";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530653
654 /**
655 * Static attribute for regex for digits.
656 */
b.janani1fef2732016-03-04 12:29:05 +0530657 public static final String REGEX_FOR_FIRST_DIGIT = "\\d.*";
658
659 /**
janani bde4ffab2016-04-15 16:18:30 +0530660 * Static attribute for regex for single letter.
661 */
662 public static final String REGEX_FOR_SINGLE_LETTER = "[a-zA-Z]";
663
664 /**
665 * Static attribute for regex for digits with single letter.
666 */
667 public static final String REGEX_FOR_DIGITS_WITH_SINGLE_LETTER = "[0-9]+[a-zA-Z]";
668
669 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530670 * Static attribute for class syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530671 */
672 public static final String CLASS = "class";
Bharat saraswal708abc02016-02-12 20:48:30 +0530673
674 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530675 * Static attribute for builder syntax.
676 */
677 public static final String BUILDER = "Builder";
678
679 /**
680 * Static attribute for interface syntax.
681 */
682 public static final String INTERFACE = "interface";
683
684 /**
685 * Static attribute for enum syntax.
686 */
687 public static final String ENUM = "enum";
688
689 /**
690 * Static attribute for static syntax.
691 */
692 public static final String STATIC = "static";
693
694 /**
695 * Static attribute for final syntax.
696 */
697 public static final String FINAL = "final";
698
699 /**
700 * Static attribute for package syntax.
701 */
702 public static final String PACKAGE = "package";
703
704 /**
705 * Static attribute for import syntax.
706 */
707 public static final String IMPORT = "import ";
708
709 /**
710 * Static attribute for null syntax.
711 */
712 public static final String NULL = "null";
713
714 /**
715 * Static attribute for return syntax.
716 */
717 public static final String RETURN = "return";
718
719 /**
720 * Static attribute for java new syntax.
721 */
722 public static final String NEW = "new";
723
724 /**
725 * Static attribute for this syntax.
726 */
727 public static final String THIS = "this";
728
729 /**
730 * Static attribute for implements syntax.
731 */
732 public static final String IMPLEMENTS = "implements";
733
734 /**
735 * Static attribute for extends syntax.
736 */
737 public static final String EXTEND = "extends";
738
739 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530740 * Static attribute for service interface suffix syntax.
741 */
742 public static final String SERVICE_METHOD_STRING = "Service";
743
744 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530745 * Static attribute for impl syntax.
746 */
747 public static final String IMPL = "Impl";
748
749 /**
750 * Static attribute for build method syntax.
751 */
752 public static final String BUILD = "build";
753
754 /**
755 * Static attribute for object.
756 */
757 public static final String OBJECT = "Object";
758
759 /**
760 * Static attribute for override annotation.
761 */
762 public static final String OVERRIDE = "@Override";
763
764 /**
765 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530766 */
b.janani1fef2732016-03-04 12:29:05 +0530767 public static final String COLLECTION_IMPORTS = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530768
769 /**
770 * Static attribute for more object import package.
771 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530772 public static final String GOOGLE_MORE_OBJECT_IMPORT_PKG = "com.google.common.base";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530773
774 /**
775 * Static attribute for more object import class.
776 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530777 public static final String GOOGLE_MORE_OBJECT_IMPORT_CLASS = "MoreObjects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530778
779 /**
780 * Static attribute for to string method.
781 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530782 public static final String GOOGLE_MORE_OBJECT_METHOD_STRING = " MoreObjects.toStringHelper(getClass())";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530783
784 /**
785 * Static attribute for java utilities import package.
786 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530787 public static final String JAVA_UTIL_OBJECTS_IMPORT_PKG = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530788
789 /**
790 * Static attribute for java utilities objects import class.
791 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530792 public static final String JAVA_UTIL_OBJECTS_IMPORT_CLASS = "Objects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530793
794 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530795 * Static attribute for HasAugmentation class import package.
796 */
797 public static final String HAS_AUGMENTATION_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
798
799 /**
800 * Static attribute for HasAugmentation class import class.
801 */
802 public static final String HAS_AUGMENTATION_CLASS_IMPORT_CLASS = "HasAugmentation;\n";
803
804 /**
805 * Static attribute for AugmentedInfo class import package.
806 */
807 public static final String AUGMENTED_INFO_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
808
809 /**
810 * Static attribute for AugmentedInfo class import class.
811 */
812 public static final String AUGMENTED_INFO_CLASS_IMPORT_CLASS = "AugmentedInfo;\n";
813
814 /**
815 * Static attribute for augmentation class.
816 */
817 public static final String AUGMENTATION = "Augmentation";
818
819 /**
820 * Static attribute for HasAugmentation class.
821 */
822 public static final String HAS_AUGMENTATION = "HasAugmentation";
823
824 /**
825 * Static attribute for AugmentedInfo class.
826 */
827 public static final String AUGMENTED_INFO = "AugmentedInfo";
828
829 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530830 * Static attribute for list.
831 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530832 public static final String LIST = "List";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530833
834 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530835 * Static attribute for array list.
836 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530837 public static final String ARRAY_LIST = "ArrayList";
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530838
839 /**
840 * Creates an instance of util constants.
841 */
842 private UtilConstants() {
843 }
Bharat saraswal708abc02016-02-12 20:48:30 +0530844}