blob: 4b9d7b5eb52b045f0a147d08593559b4c81fea3a [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 saraswald9822e92016-04-05 15:13:44 +053029 * Creates an instance of util constants.
Bharat saraswal708abc02016-02-12 20:48:30 +053030 */
31 private UtilConstants() {
32 }
33
34 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +053035 * JavaDocs for impl class.
Bharat saraswal708abc02016-02-12 20:48:30 +053036 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +053037 public static final String IMPL_CLASS_JAVA_DOC = " * Represents the implementation of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053038
39 /**
40 * JavaDocs for builder class.
41 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +053042 public static final String BUILDER_CLASS_JAVA_DOC = " * Represents the builder implementation of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053043
44 /**
45 * JavaDocs for interface class.
46 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +053047 public static final String INTERFACE_JAVA_DOC = " * Abstraction of an entity which represents the"
48 + " functionality of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053049
50 /**
51 * JavaDocs for builder interface class.
52 */
Bharat saraswal708abc02016-02-12 20:48:30 +053053 public static final String BUILDER_INTERFACE_JAVA_DOC = " * Builder for ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053054
55 /**
Bharat saraswald72411a2016-04-19 01:00:16 +053056 * JavaDocs for enum class.
57 */
58 public static final String ENUM_CLASS_JAVADOC = " * Represents ENUM data of ";
59
60 /**
61 * JavaDocs for enum attribute.
62 */
63 public static final String ENUM_ATTRIBUTE_JAVADOC = " * Represents ";
64
65 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +053066 * JavaDocs for package info class.
67 */
Bharat saraswald72411a2016-04-19 01:00:16 +053068 public static final String PACKAGE_INFO_JAVADOC = " * Implementation of YANG node ";
69
70 /**
71 * JavaDocs for package info class.
72 */
73 public static final String PACKAGE_INFO_JAVADOC_OF_CHILD = "'s children nodes";
Bharat saraswal2f11f652016-03-25 18:19:46 +053074
75 /**
76 * JavaDocs's first line.
77 */
Bharat saraswal708abc02016-02-12 20:48:30 +053078 public static final String JAVA_DOC_FIRST_LINE = "/**\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +053079
80 /**
81 * JavaDocs's last line.
82 */
Bharat saraswal708abc02016-02-12 20:48:30 +053083 public static final String JAVA_DOC_END_LINE = " */\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +053084
85 /**
86 * JavaDocs's param annotation.
87 */
Bharat saraswal708abc02016-02-12 20:48:30 +053088 public static final String JAVA_DOC_PARAM = " * @param ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053089
90 /**
91 * JavaDocs's return annotation.
92 */
Bharat saraswal708abc02016-02-12 20:48:30 +053093 public static final String JAVA_DOC_RETURN = " * @return ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053094
95 /**
96 * JavaDocs's throw annotation.
97 */
Bharat saraswal708abc02016-02-12 20:48:30 +053098 public static final String JAVA_DOC_THROWS = " * @throws ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053099
100 /**
101 * JavaDocs's description for setter method.
102 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530103 public static final String JAVA_DOC_SETTERS = " * Returns the builder object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530104
105 /**
106 * JavaDocs's description for OF method.
107 */
b.janani1fef2732016-03-04 12:29:05 +0530108 public static final String JAVA_DOC_OF = " * Returns the object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530109
110 /**
111 * JavaDocs's description for typedef' setter method.
112 */
b.janani1fef2732016-03-04 12:29:05 +0530113 public static final String JAVA_DOC_SETTERS_COMMON = " * Sets the value of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530114
115 /**
116 * JavaDocs's description for getter method.
117 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530118 public static final String JAVA_DOC_GETTERS = " * Returns the attribute ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530119
120 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530121 * JavaDocs's description for constructor.
122 */
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530123 public static final String JAVA_DOC_CONSTRUCTOR = " * Creates an instance of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530124
125 /**
126 * JavaDocs's description for build method.
127 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530128 public static final String JAVA_DOC_BUILD = " * Builds object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530129
130 /**
131 * JavaDocs's return statement for build method.
132 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530133 public static final String JAVA_DOC_BUILD_RETURN = "object of ";
134
135 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530136 * JavaDocs's statement for builder object.
137 */
138 public static final String BUILDER_OBJECT = "builder object of ";
139
140 /**
141 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530142 */
143 public static final String NEW_LINE = "\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530144
145 /**
146 * Static attribute for multiple new line.
147 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530148 public static final String MULTIPLE_NEW_LINE = "\n\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530149
150 /**
151 * Static attribute for empty line.
152 */
b.janani1fef2732016-03-04 12:29:05 +0530153 public static final String EMPTY_STRING = "";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530154
155 /**
156 * Static attribute for new line with asterisk.
157 */
158 public static final String NEW_LINE_ASTERISK = " *\n";
159
160 /**
161 * Static attribute for period.
162 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530163 public static final String PERIOD = ".";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530164
165 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530166 * Static attribute for parse byte.
167 */
168 public static final String PARSE_BYTE = "parseByte";
169
170 /**
171 * Static attribute for parse short.
172 */
173 public static final String PARSE_SHORT = "parseShort";
174
175 /**
176 * Static attribute for parse int.
177 */
178 public static final String PARSE_INT = "parseInt";
179
180 /**
181 * Static attribute for parse long.
182 */
183 public static final String PARSE_LONG = "parseLong";
184
185 /**
186 * Static attribute for omit null value.
187 */
188 public static final String OMIT_NULL_VALUE_STRING = "omitNullValues()";
189
190 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530191 * Static attribute for colan.
192 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530193 public static final String COLAN = ":";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530194
195 /**
196 * Static attribute for underscore.
197 */
b.janani1fef2732016-03-04 12:29:05 +0530198 public static final String UNDER_SCORE = "_";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530199
200 /**
201 * Static attribute for semi-colan.
202 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530203 public static final String SEMI_COLAN = ";";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530204
205 /**
206 * Static attribute for hyphen.
207 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530208 public static final String HYPHEN = "-";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530209
210 /**
211 * Static attribute for space.
212 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530213 public static final String SPACE = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530214
215 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530216 * Static attribute for input string.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530217 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530218 public static final String INPUT = "input";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530219
220 /**
221 * Static attribute for new line.
222 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530223 public static final String EQUAL = "=";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530224
225 /**
226 * Static attribute for slash syntax.
227 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530228 public static final String SLASH = File.separator;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530229
230 /**
231 * Static attribute for add syntax.
232 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530233 public static final String ADD = "+";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530234
235 /**
236 * Static attribute for asterisk.
237 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530238 public static final String ASTERISK = "*";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530239
240 /**
241 * Static attribute for at.
242 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530243 public static final String AT = "@";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530244
245 /**
246 * Static attribute for quotes.
247 */
b.janani1fef2732016-03-04 12:29:05 +0530248 public static final String QUOTES = "\"";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530249
250 /**
251 * Static attribute for ampersand.
252 */
b.janani1fef2732016-03-04 12:29:05 +0530253 public static final String AND = "&";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530254
255 /**
256 * Static attribute for comma.
257 */
b.janani1fef2732016-03-04 12:29:05 +0530258 public static final String COMMA = ",";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530259
260 /**
261 * Static attribute for add syntax.
262 */
b.janani1fef2732016-03-04 12:29:05 +0530263 public static final String ADD_STRING = "add";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530264
265 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530266 * Static attribute for from syntax.
267 */
268 public static final String FROM_STRING_METHOD_NAME = "fromString";
269
270 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530271 * Static attribute for check not null syntax.
272 */
b.janani1fef2732016-03-04 12:29:05 +0530273 public static final String CHECK_NOT_NULL_STRING = "checkNotNull";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530274
275 /**
276 * Static attribute for hash code syntax.
277 */
b.janani1fef2732016-03-04 12:29:05 +0530278 public static final String HASH_CODE_STRING = "hashCode";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530279
280 /**
281 * Static attribute for equals syntax.
282 */
b.janani1fef2732016-03-04 12:29:05 +0530283 public static final String EQUALS_STRING = "equals";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530284
285 /**
286 * Static attribute for object.
287 */
b.janani1fef2732016-03-04 12:29:05 +0530288 public static final String OBJECT_STRING = "Object";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530289
290 /**
291 * Static attribute for instance of syntax.
292 */
b.janani1fef2732016-03-04 12:29:05 +0530293 public static final String INSTANCE_OF = " instanceof ";
294
Bharat saraswal2f11f652016-03-25 18:19:46 +0530295 /**
296 * Static attribute for value syntax.
297 */
b.janani1fef2732016-03-04 12:29:05 +0530298 public static final String VALUE = "value";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530299
300 /**
Bharat saraswald72411a2016-04-19 01:00:16 +0530301 * Static attribute for enumValue syntax.
302 */
303 public static final String ENUM_VALUE = "enumValue";
304
305 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530306 * Static attribute for suffix s.
307 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530308 public static final String SUFFIX_S = "s";
b.janani1fef2732016-03-04 12:29:05 +0530309
Bharat saraswal2f11f652016-03-25 18:19:46 +0530310 /**
311 * Static attribute for if.
312 */
b.janani1fef2732016-03-04 12:29:05 +0530313 public static final String IF = "if";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530314
315 /**
316 * Static attribute for for.
317 */
b.janani1fef2732016-03-04 12:29:05 +0530318 public static final String FOR = "for";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530319
320 /**
321 * Static attribute for while.
322 */
b.janani1fef2732016-03-04 12:29:05 +0530323 public static final String WHILE = "while";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530324
325 /**
326 * Static attribute for of.
327 */
b.janani1fef2732016-03-04 12:29:05 +0530328 public static final String OF = "of";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530329
330 /**
331 * Static attribute for other.
332 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530333 public static final String OTHER = "other";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530334
335 /**
336 * Static attribute for obj syntax.
337 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530338 public static final String OBJ = "obj";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530339
340 /**
341 * Static attribute for hash syntax.
342 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530343 public static final String HASH = "hash";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530344
345 /**
346 * Static attribute for to syntax.
347 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530348 public static final String TO = "to";
b.janani1fef2732016-03-04 12:29:05 +0530349
Bharat saraswal2f11f652016-03-25 18:19:46 +0530350 /**
351 * Static attribute for true syntax.
352 */
b.janani1fef2732016-03-04 12:29:05 +0530353 public static final String TRUE = "true";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530354
355 /**
356 * Static attribute for false syntax.
357 */
b.janani1fef2732016-03-04 12:29:05 +0530358 public static final String FALSE = "false";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530359
360 /**
361 * Static attribute for org.
362 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530363 public static final String ORG = "org";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530364
365 /**
366 * Static attribute for temp.
367 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530368 public static final String TEMP = "temp";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530369
370 /**
371 * Static attribute for YANG file directory.
372 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530373 public static final String YANG_RESOURCES = "yang/resources";
Bharat saraswal708abc02016-02-12 20:48:30 +0530374
375 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530376 * Static attribute for diamond close bracket syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530377 */
378 public static final String DIAMOND_OPEN_BRACKET = "<";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530379
380 /**
381 * Static attribute for diamond close bracket syntax.
382 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530383 public static final String DIAMOND_CLOSE_BRACKET = ">";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530384
385 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530386 * Static attribute for exception syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530387 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530388 public static final String EXCEPTION = "Exception";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530389
390 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530391 * Static attribute for exception variable syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530392 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530393 public static final String EXCEPTION_VAR = "e";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530394
395 /**
396 * Static attribute for open parenthesis syntax.
397 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530398 public static final String OPEN_PARENTHESIS = "(";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530399
400 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530401 * Static attribute for clear syntax.
402 */
403 public static final String CLEAR = "clear";
404
405 /**
406 * Static attribute for temp val syntax.
407 */
408 public static final String TMP_VAL = "tmpVal";
409
410 /**
411 * From string parameter name.
412 */
413 public static final String FROM_STRING_PARAM_NAME = "valInString";
414
415 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530416 * Static attribute for close parenthesis syntax.
417 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530418 public static final String CLOSE_PARENTHESIS = ")";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530419
420 /**
421 * Static attribute for open curly bracket syntax.
422 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530423 public static final String OPEN_CURLY_BRACKET = "{";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530424
425 /**
426 * Static attribute for close curly bracket syntax.
427 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530428 public static final String CLOSE_CURLY_BRACKET = "}";
429
430 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530431 * Static attribute for getter method prefix.
Bharat saraswal708abc02016-02-12 20:48:30 +0530432 */
433 public static final String GET_METHOD_PREFIX = "get";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530434
435 /**
436 * Static attribute for setter method prefix.
437 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530438 public static final String SET_METHOD_PREFIX = "set";
439
440 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530441 * Static attribute for four space indentation.
Bharat saraswal708abc02016-02-12 20:48:30 +0530442 */
443 public static final String FOUR_SPACE_INDENTATION = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530444
445 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530446 * Static attribute for not syntax.
447 */
448 public static final String NOT = "!";
449
450 /**
451 * Static attribute for try syntax.
452 */
453 public static final String TRY = "try";
454
455 /**
456 * Static attribute for catch syntax.
457 */
458 public static final String CATCH = "catch";
459
460 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530461 * Static attribute for eight space indentation.
462 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530463 public static final String EIGHT_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + FOUR_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530464
465 /**
466 * Static attribute for twelve space indentation.
467 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530468 public static final String TWELVE_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530469
470 /**
471 * Static attribute for sixteen space indentation.
472 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530473 public static final String SIXTEEN_SPACE_INDENTATION = EIGHT_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
474
475 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530476 * Static attribute for generated code path.
Bharat saraswal708abc02016-02-12 20:48:30 +0530477 */
Bharat saraswal8f2a6c52016-03-09 18:34:56 +0530478 public static final String YANG_GEN_DIR = "src/main/java/";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530479
480 /**
481 * Static attribute for base package.
482 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530483 public static final String DEFAULT_BASE_PKG = "org.onosproject.yang.gen";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530484
485 /**
486 * Static attribute for YANG date prefix.
487 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530488 public static final String REVISION_PREFIX = "rev";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530489
490 /**
janani bde4ffab2016-04-15 16:18:30 +0530491 * Static attribute for YANG automatic prefix for identifiers with keywords and beginning with digits.
492 */
493 public static final String YANG_AUTO_PREFIX = "yangAutoPrefix";
494
495 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530496 * Static attribute for YANG version perifx.
497 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530498 public static final String VERSION_PREFIX = "v";
499
500 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530501 * Static attribute for private modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530502 */
503 public static final String PRIVATE = "private";
Bharat saraswal708abc02016-02-12 20:48:30 +0530504
505 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530506 * Static attribute for public modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530507 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530508 public static final String PUBLIC = "public";
509
510 /**
511 * Static attribute for protected modifier.
512 */
513 public static final String PROTECTED = "protected";
514
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530515 /**
516 * Void java type.
517 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530518 public static final String VOID = "void";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530519
520 /**
521 * String built in java type.
522 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530523 public static final String STRING_DATA_TYPE = "String";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530524
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530525 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530526 * Java.lang.* packages.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530527 */
528 public static final String JAVA_LANG = "java.lang";
529
530 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530531 * Java.math.* packages.
532 */
533 public static final String JAVA_MATH = "java.math";
534
535 /**
536 * Boolean built in java type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530537 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530538 public static final String BOOLEAN_DATA_TYPE = "boolean";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530539
540 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530541 * BigInteger built in java type.
542 */
543 public static final String BIG_INTEGER = "BigInteger";
544
545 /**
546 * Byte java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530547 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530548 public static final String BYTE = "byte";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530549
550 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530551 * Short java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530552 */
553 public static final String SHORT = "short";
554
555 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530556 * Int java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530557 */
558 public static final String INT = "int";
559
560 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530561 * Long java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530562 */
563 public static final String LONG = "long";
564
565 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530566 * Float java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530567 */
568 public static final String FLOAT = "float";
569
570 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530571 * Double java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530572 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530573 public static final String DOUBLE = "double";
574
575 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530576 * Boolean built in java wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530577 */
578 public static final String BOOLEAN_WRAPPER = "Boolean";
579
580 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530581 * Byte java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530582 */
583 public static final String BYTE_WRAPPER = "Byte";
584
585 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530586 * Short java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530587 */
588 public static final String SHORT_WRAPPER = "Short";
589
590 /**
591 * Integer java built in wrapper type.
592 */
593 public static final String INTEGER_WRAPPER = "Integer";
594
595 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530596 * Long java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530597 */
598 public static final String LONG_WRAPPER = "Long";
599
600 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530601 * YangUint64 java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530602 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530603 public static final String YANG_UINT64 = "YangUint64";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530604
605 /**
Bharat saraswale2d51d62016-03-23 19:40:35 +0530606 * 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 +0530607 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530608 public static final List<String> JAVA_KEY_WORDS = Arrays.asList(
609 "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue",
610 "default", "do", "double", "else", "extends", "false", "final", "finally", "float", "for", "goto", "if",
611 "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "null", "package",
612 "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch",
613 "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while");
b.janani1fef2732016-03-04 12:29:05 +0530614
615 /**
janani bde4ffab2016-04-15 16:18:30 +0530616 * Static attribute for regex for all the special characters.
b.janani1fef2732016-03-04 12:29:05 +0530617 */
janani bde4ffab2016-04-15 16:18:30 +0530618 public static final String REGEX_WITH_ALL_SPECIAL_CHAR = "\\p{Punct}+";
619
620 /**
621 * Static attribute for regex for three special characters used in identifier.
622 */
623 public static final String REGEX_FOR_IDENTIFIER_SPECIAL_CHAR = "[. _ -]+";
624
625 /**
626 * Static attribute for regex for period.
627 */
628 public static final String REGEX_FOR_PERIOD = "[.]";
629
630 /**
631 * Static attribute for regex for underscore.
632 */
633 public static final String REGEX_FOR_UNDERSCORE = "[_]";
634
635 /**
636 * Static attribute for regex for hyphen.
637 */
638 public static final String REGEX_FOR_HYPHEN = "[-]";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530639
640 /**
641 * Static attribute for regex for digits.
642 */
b.janani1fef2732016-03-04 12:29:05 +0530643 public static final String REGEX_FOR_FIRST_DIGIT = "\\d.*";
644
645 /**
janani bde4ffab2016-04-15 16:18:30 +0530646 * Static attribute for regex for single letter.
647 */
648 public static final String REGEX_FOR_SINGLE_LETTER = "[a-zA-Z]";
649
650 /**
651 * Static attribute for regex for digits with single letter.
652 */
653 public static final String REGEX_FOR_DIGITS_WITH_SINGLE_LETTER = "[0-9]+[a-zA-Z]";
654
655 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530656 * Static attribute for class syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530657 */
658 public static final String CLASS = "class";
Bharat saraswal708abc02016-02-12 20:48:30 +0530659
660 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530661 * Static attribute for builder syntax.
662 */
663 public static final String BUILDER = "Builder";
664
665 /**
666 * Static attribute for interface syntax.
667 */
668 public static final String INTERFACE = "interface";
669
670 /**
671 * Static attribute for enum syntax.
672 */
673 public static final String ENUM = "enum";
674
675 /**
676 * Static attribute for static syntax.
677 */
678 public static final String STATIC = "static";
679
680 /**
681 * Static attribute for final syntax.
682 */
683 public static final String FINAL = "final";
684
685 /**
686 * Static attribute for package syntax.
687 */
688 public static final String PACKAGE = "package";
689
690 /**
691 * Static attribute for import syntax.
692 */
693 public static final String IMPORT = "import ";
694
695 /**
696 * Static attribute for null syntax.
697 */
698 public static final String NULL = "null";
699
700 /**
701 * Static attribute for return syntax.
702 */
703 public static final String RETURN = "return";
704
705 /**
706 * Static attribute for java new syntax.
707 */
708 public static final String NEW = "new";
709
710 /**
711 * Static attribute for this syntax.
712 */
713 public static final String THIS = "this";
714
715 /**
716 * Static attribute for implements syntax.
717 */
718 public static final String IMPLEMENTS = "implements";
719
720 /**
721 * Static attribute for extends syntax.
722 */
723 public static final String EXTEND = "extends";
724
725 /**
726 * Static attribute for impl syntax.
727 */
728 public static final String IMPL = "Impl";
729
730 /**
731 * Static attribute for build method syntax.
732 */
733 public static final String BUILD = "build";
734
735 /**
736 * Static attribute for object.
737 */
738 public static final String OBJECT = "Object";
739
740 /**
741 * Static attribute for override annotation.
742 */
743 public static final String OVERRIDE = "@Override";
744
745 /**
746 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530747 */
b.janani1fef2732016-03-04 12:29:05 +0530748 public static final String COLLECTION_IMPORTS = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530749
750 /**
751 * Static attribute for more object import package.
752 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530753 public static final String GOOGLE_MORE_OBJECT_IMPORT_PKG = "com.google.common.base";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530754
755 /**
756 * Static attribute for more object import class.
757 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530758 public static final String GOOGLE_MORE_OBJECT_IMPORT_CLASS = "MoreObjects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530759
760 /**
761 * Static attribute for to string method.
762 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530763 public static final String GOOGLE_MORE_OBJECT_METHOD_STRING = " MoreObjects.toStringHelper(getClass())";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530764
765 /**
766 * Static attribute for java utilities import package.
767 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530768 public static final String JAVA_UTIL_OBJECTS_IMPORT_PKG = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530769
770 /**
771 * Static attribute for java utilities objects import class.
772 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530773 public static final String JAVA_UTIL_OBJECTS_IMPORT_CLASS = "Objects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530774
775 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530776 * Static attribute for HasAugmentation class import package.
777 */
778 public static final String HAS_AUGMENTATION_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
779
780 /**
781 * Static attribute for HasAugmentation class import class.
782 */
783 public static final String HAS_AUGMENTATION_CLASS_IMPORT_CLASS = "HasAugmentation;\n";
784
785 /**
786 * Static attribute for AugmentedInfo class import package.
787 */
788 public static final String AUGMENTED_INFO_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
789
790 /**
791 * Static attribute for AugmentedInfo class import class.
792 */
793 public static final String AUGMENTED_INFO_CLASS_IMPORT_CLASS = "AugmentedInfo;\n";
794
795 /**
796 * Static attribute for augmentation class.
797 */
798 public static final String AUGMENTATION = "Augmentation";
799
800 /**
801 * Static attribute for HasAugmentation class.
802 */
803 public static final String HAS_AUGMENTATION = "HasAugmentation";
804
805 /**
806 * Static attribute for AugmentedInfo class.
807 */
808 public static final String AUGMENTED_INFO = "AugmentedInfo";
809
810 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530811 * Static attribute for list.
812 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530813 public static final String LIST = "List";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530814
815 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530816 * Static attribute for array list.
817 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530818 public static final String ARRAY_LIST = "ArrayList";
Bharat saraswal708abc02016-02-12 20:48:30 +0530819}