blob: db3ff8fb9908adfaa18564aa60839e1422e0ab83 [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 /**
56 * JavaDocs for package info class.
57 */
Vinod Kumar S38046502016-03-23 15:30:27 +053058 public static final String PACKAGE_INFO_JAVADOC = " * Implementation of YANG file ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053059
60 /**
61 * JavaDocs's first line.
62 */
Bharat saraswal708abc02016-02-12 20:48:30 +053063 public static final String JAVA_DOC_FIRST_LINE = "/**\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +053064
65 /**
66 * JavaDocs's last line.
67 */
Bharat saraswal708abc02016-02-12 20:48:30 +053068 public static final String JAVA_DOC_END_LINE = " */\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +053069
70 /**
71 * JavaDocs's param annotation.
72 */
Bharat saraswal708abc02016-02-12 20:48:30 +053073 public static final String JAVA_DOC_PARAM = " * @param ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053074
75 /**
76 * JavaDocs's return annotation.
77 */
Bharat saraswal708abc02016-02-12 20:48:30 +053078 public static final String JAVA_DOC_RETURN = " * @return ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053079
80 /**
81 * JavaDocs's throw annotation.
82 */
Bharat saraswal708abc02016-02-12 20:48:30 +053083 public static final String JAVA_DOC_THROWS = " * @throws ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053084
85 /**
86 * JavaDocs's description for setter method.
87 */
Bharat saraswal708abc02016-02-12 20:48:30 +053088 public static final String JAVA_DOC_SETTERS = " * Returns the builder object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053089
90 /**
91 * JavaDocs's description for OF method.
92 */
b.janani1fef2732016-03-04 12:29:05 +053093 public static final String JAVA_DOC_OF = " * Returns the object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053094
95 /**
96 * JavaDocs's description for typedef' setter method.
97 */
b.janani1fef2732016-03-04 12:29:05 +053098 public static final String JAVA_DOC_SETTERS_COMMON = " * Sets the value of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053099
100 /**
101 * JavaDocs's description for getter method.
102 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530103 public static final String JAVA_DOC_GETTERS = " * Returns the attribute ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530104
105 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530106 * JavaDocs's description for constructor.
107 */
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530108 public static final String JAVA_DOC_CONSTRUCTOR = " * Creates an instance of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530109
110 /**
111 * JavaDocs's description for build method.
112 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530113 public static final String JAVA_DOC_BUILD = " * Builds object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530114
115 /**
116 * JavaDocs's return statement for build method.
117 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530118 public static final String JAVA_DOC_BUILD_RETURN = "object of ";
119
120 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530121 * JavaDocs's statement for builder object.
122 */
123 public static final String BUILDER_OBJECT = "builder object of ";
124
125 /**
126 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530127 */
128 public static final String NEW_LINE = "\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530129
130 /**
131 * Static attribute for multiple new line.
132 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530133 public static final String MULTIPLE_NEW_LINE = "\n\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530134
135 /**
136 * Static attribute for empty line.
137 */
b.janani1fef2732016-03-04 12:29:05 +0530138 public static final String EMPTY_STRING = "";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530139
140 /**
141 * Static attribute for new line with asterisk.
142 */
143 public static final String NEW_LINE_ASTERISK = " *\n";
144
145 /**
146 * Static attribute for period.
147 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530148 public static final String PERIOD = ".";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530149
150 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530151 * Static attribute for parse byte.
152 */
153 public static final String PARSE_BYTE = "parseByte";
154
155 /**
156 * Static attribute for parse short.
157 */
158 public static final String PARSE_SHORT = "parseShort";
159
160 /**
161 * Static attribute for parse int.
162 */
163 public static final String PARSE_INT = "parseInt";
164
165 /**
166 * Static attribute for parse long.
167 */
168 public static final String PARSE_LONG = "parseLong";
169
170 /**
171 * Static attribute for omit null value.
172 */
173 public static final String OMIT_NULL_VALUE_STRING = "omitNullValues()";
174
175 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530176 * Static attribute for colan.
177 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530178 public static final String COLAN = ":";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530179
180 /**
181 * Static attribute for underscore.
182 */
b.janani1fef2732016-03-04 12:29:05 +0530183 public static final String UNDER_SCORE = "_";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530184
185 /**
186 * Static attribute for semi-colan.
187 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530188 public static final String SEMI_COLAN = ";";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530189
190 /**
191 * Static attribute for hyphen.
192 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530193 public static final String HYPHEN = "-";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530194
195 /**
196 * Static attribute for space.
197 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530198 public static final String SPACE = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530199
200 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530201 * Static attribute for input string.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530202 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530203 public static final String INPUT = "input";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530204
205 /**
206 * Static attribute for new line.
207 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530208 public static final String EQUAL = "=";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530209
210 /**
211 * Static attribute for slash syntax.
212 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530213 public static final String SLASH = File.separator;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530214
215 /**
216 * Static attribute for add syntax.
217 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530218 public static final String ADD = "+";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530219
220 /**
221 * Static attribute for asterisk.
222 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530223 public static final String ASTERISK = "*";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530224
225 /**
226 * Static attribute for at.
227 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530228 public static final String AT = "@";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530229
230 /**
231 * Static attribute for quotes.
232 */
b.janani1fef2732016-03-04 12:29:05 +0530233 public static final String QUOTES = "\"";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530234
235 /**
236 * Static attribute for ampersand.
237 */
b.janani1fef2732016-03-04 12:29:05 +0530238 public static final String AND = "&";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530239
240 /**
241 * Static attribute for comma.
242 */
b.janani1fef2732016-03-04 12:29:05 +0530243 public static final String COMMA = ",";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530244
245 /**
246 * Static attribute for add syntax.
247 */
b.janani1fef2732016-03-04 12:29:05 +0530248 public static final String ADD_STRING = "add";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530249
250 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530251 * Static attribute for from syntax.
252 */
253 public static final String FROM_STRING_METHOD_NAME = "fromString";
254
255 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530256 * Static attribute for check not null syntax.
257 */
b.janani1fef2732016-03-04 12:29:05 +0530258 public static final String CHECK_NOT_NULL_STRING = "checkNotNull";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530259
260 /**
261 * Static attribute for hash code syntax.
262 */
b.janani1fef2732016-03-04 12:29:05 +0530263 public static final String HASH_CODE_STRING = "hashCode";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530264
265 /**
266 * Static attribute for equals syntax.
267 */
b.janani1fef2732016-03-04 12:29:05 +0530268 public static final String EQUALS_STRING = "equals";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530269
270 /**
271 * Static attribute for object.
272 */
b.janani1fef2732016-03-04 12:29:05 +0530273 public static final String OBJECT_STRING = "Object";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530274
275 /**
276 * Static attribute for instance of syntax.
277 */
b.janani1fef2732016-03-04 12:29:05 +0530278 public static final String INSTANCE_OF = " instanceof ";
279
Bharat saraswal2f11f652016-03-25 18:19:46 +0530280 /**
281 * Static attribute for value syntax.
282 */
b.janani1fef2732016-03-04 12:29:05 +0530283 public static final String VALUE = "value";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530284
285 /**
286 * Static attribute for suffix s.
287 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530288 public static final String SUFFIX_S = "s";
b.janani1fef2732016-03-04 12:29:05 +0530289
Bharat saraswal2f11f652016-03-25 18:19:46 +0530290 /**
291 * Static attribute for if.
292 */
b.janani1fef2732016-03-04 12:29:05 +0530293 public static final String IF = "if";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530294
295 /**
296 * Static attribute for for.
297 */
b.janani1fef2732016-03-04 12:29:05 +0530298 public static final String FOR = "for";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530299
300 /**
301 * Static attribute for while.
302 */
b.janani1fef2732016-03-04 12:29:05 +0530303 public static final String WHILE = "while";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530304
305 /**
306 * Static attribute for of.
307 */
b.janani1fef2732016-03-04 12:29:05 +0530308 public static final String OF = "of";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530309
310 /**
311 * Static attribute for other.
312 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530313 public static final String OTHER = "other";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530314
315 /**
316 * Static attribute for obj syntax.
317 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530318 public static final String OBJ = "obj";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530319
320 /**
321 * Static attribute for hash syntax.
322 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530323 public static final String HASH = "hash";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530324
325 /**
326 * Static attribute for to syntax.
327 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530328 public static final String TO = "to";
b.janani1fef2732016-03-04 12:29:05 +0530329
Bharat saraswal2f11f652016-03-25 18:19:46 +0530330 /**
331 * Static attribute for true syntax.
332 */
b.janani1fef2732016-03-04 12:29:05 +0530333 public static final String TRUE = "true";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530334
335 /**
336 * Static attribute for false syntax.
337 */
b.janani1fef2732016-03-04 12:29:05 +0530338 public static final String FALSE = "false";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530339
340 /**
341 * Static attribute for org.
342 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530343 public static final String ORG = "org";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530344
345 /**
346 * Static attribute for temp.
347 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530348 public static final String TEMP = "temp";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530349
350 /**
351 * Static attribute for YANG file directory.
352 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530353 public static final String YANG_RESOURCES = "yang/resources";
Bharat saraswal708abc02016-02-12 20:48:30 +0530354
355 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530356 * Static attribute for diamond close bracket syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530357 */
358 public static final String DIAMOND_OPEN_BRACKET = "<";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530359
360 /**
361 * Static attribute for diamond close bracket syntax.
362 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530363 public static final String DIAMOND_CLOSE_BRACKET = ">";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530364
365 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530366 * Static attribute for exception syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530367 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530368 public static final String EXCEPTION = "Exception";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530369
370 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530371 * Static attribute for exception variable syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530372 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530373 public static final String EXCEPTION_VAR = "e";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530374
375 /**
376 * Static attribute for open parenthesis syntax.
377 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530378 public static final String OPEN_PARENTHESIS = "(";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530379
380 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530381 * Static attribute for clear syntax.
382 */
383 public static final String CLEAR = "clear";
384
385 /**
386 * Static attribute for temp val syntax.
387 */
388 public static final String TMP_VAL = "tmpVal";
389
390 /**
391 * From string parameter name.
392 */
393 public static final String FROM_STRING_PARAM_NAME = "valInString";
394
395 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530396 * Static attribute for close parenthesis syntax.
397 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530398 public static final String CLOSE_PARENTHESIS = ")";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530399
400 /**
401 * Static attribute for open curly bracket syntax.
402 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530403 public static final String OPEN_CURLY_BRACKET = "{";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530404
405 /**
406 * Static attribute for close curly bracket syntax.
407 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530408 public static final String CLOSE_CURLY_BRACKET = "}";
409
410 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530411 * Static attribute for getter method prefix.
Bharat saraswal708abc02016-02-12 20:48:30 +0530412 */
413 public static final String GET_METHOD_PREFIX = "get";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530414
415 /**
416 * Static attribute for setter method prefix.
417 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530418 public static final String SET_METHOD_PREFIX = "set";
419
420 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530421 * Static attribute for four space indentation.
Bharat saraswal708abc02016-02-12 20:48:30 +0530422 */
423 public static final String FOUR_SPACE_INDENTATION = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530424
425 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530426 * Static attribute for not syntax.
427 */
428 public static final String NOT = "!";
429
430 /**
431 * Static attribute for try syntax.
432 */
433 public static final String TRY = "try";
434
435 /**
436 * Static attribute for catch syntax.
437 */
438 public static final String CATCH = "catch";
439
440 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530441 * Static attribute for eight space indentation.
442 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530443 public static final String EIGHT_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + FOUR_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530444
445 /**
446 * Static attribute for twelve space indentation.
447 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530448 public static final String TWELVE_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530449
450 /**
451 * Static attribute for sixteen space indentation.
452 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530453 public static final String SIXTEEN_SPACE_INDENTATION = EIGHT_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
454
455 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530456 * Static attribute for generated code path.
Bharat saraswal708abc02016-02-12 20:48:30 +0530457 */
Bharat saraswal8f2a6c52016-03-09 18:34:56 +0530458 public static final String YANG_GEN_DIR = "src/main/java/";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530459
460 /**
461 * Static attribute for base package.
462 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530463 public static final String DEFAULT_BASE_PKG = "org.onosproject.yang.gen";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530464
465 /**
466 * Static attribute for YANG date prefix.
467 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530468 public static final String REVISION_PREFIX = "rev";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530469
470 /**
janani bde4ffab2016-04-15 16:18:30 +0530471 * Static attribute for YANG automatic prefix for identifiers with keywords and beginning with digits.
472 */
473 public static final String YANG_AUTO_PREFIX = "yangAutoPrefix";
474
475 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530476 * Static attribute for YANG version perifx.
477 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530478 public static final String VERSION_PREFIX = "v";
479
480 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530481 * Static attribute for private modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530482 */
483 public static final String PRIVATE = "private";
Bharat saraswal708abc02016-02-12 20:48:30 +0530484
485 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530486 * Static attribute for public modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530487 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530488 public static final String PUBLIC = "public";
489
490 /**
491 * Static attribute for protected modifier.
492 */
493 public static final String PROTECTED = "protected";
494
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530495 /**
496 * Void java type.
497 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530498 public static final String VOID = "void";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530499
500 /**
501 * String built in java type.
502 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530503 public static final String STRING_DATA_TYPE = "String";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530504
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530505 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530506 * Java.lang.* packages.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530507 */
508 public static final String JAVA_LANG = "java.lang";
509
510 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530511 * Java.math.* packages.
512 */
513 public static final String JAVA_MATH = "java.math";
514
515 /**
516 * Boolean built in java type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530517 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530518 public static final String BOOLEAN_DATA_TYPE = "boolean";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530519
520 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530521 * BigInteger built in java type.
522 */
523 public static final String BIG_INTEGER = "BigInteger";
524
525 /**
526 * Byte java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530527 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530528 public static final String BYTE = "byte";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530529
530 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530531 * Short java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530532 */
533 public static final String SHORT = "short";
534
535 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530536 * Int java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530537 */
538 public static final String INT = "int";
539
540 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530541 * Long java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530542 */
543 public static final String LONG = "long";
544
545 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530546 * Float java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530547 */
548 public static final String FLOAT = "float";
549
550 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530551 * Double java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530552 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530553 public static final String DOUBLE = "double";
554
555 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530556 * Boolean built in java wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530557 */
558 public static final String BOOLEAN_WRAPPER = "Boolean";
559
560 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530561 * Byte java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530562 */
563 public static final String BYTE_WRAPPER = "Byte";
564
565 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530566 * Short java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530567 */
568 public static final String SHORT_WRAPPER = "Short";
569
570 /**
571 * Integer java built in wrapper type.
572 */
573 public static final String INTEGER_WRAPPER = "Integer";
574
575 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530576 * Long java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530577 */
578 public static final String LONG_WRAPPER = "Long";
579
580 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530581 * YangUint64 java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530582 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530583 public static final String YANG_UINT64 = "YangUint64";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530584
585 /**
Bharat saraswale2d51d62016-03-23 19:40:35 +0530586 * 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 +0530587 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530588 public static final List<String> JAVA_KEY_WORDS = Arrays.asList(
589 "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue",
590 "default", "do", "double", "else", "extends", "false", "final", "finally", "float", "for", "goto", "if",
591 "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "null", "package",
592 "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch",
593 "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while");
b.janani1fef2732016-03-04 12:29:05 +0530594
595 /**
janani bde4ffab2016-04-15 16:18:30 +0530596 * Static attribute for regex for all the special characters.
b.janani1fef2732016-03-04 12:29:05 +0530597 */
janani bde4ffab2016-04-15 16:18:30 +0530598 public static final String REGEX_WITH_ALL_SPECIAL_CHAR = "\\p{Punct}+";
599
600 /**
601 * Static attribute for regex for three special characters used in identifier.
602 */
603 public static final String REGEX_FOR_IDENTIFIER_SPECIAL_CHAR = "[. _ -]+";
604
605 /**
606 * Static attribute for regex for period.
607 */
608 public static final String REGEX_FOR_PERIOD = "[.]";
609
610 /**
611 * Static attribute for regex for underscore.
612 */
613 public static final String REGEX_FOR_UNDERSCORE = "[_]";
614
615 /**
616 * Static attribute for regex for hyphen.
617 */
618 public static final String REGEX_FOR_HYPHEN = "[-]";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530619
620 /**
621 * Static attribute for regex for digits.
622 */
b.janani1fef2732016-03-04 12:29:05 +0530623 public static final String REGEX_FOR_FIRST_DIGIT = "\\d.*";
624
625 /**
janani bde4ffab2016-04-15 16:18:30 +0530626 * Static attribute for regex for single letter.
627 */
628 public static final String REGEX_FOR_SINGLE_LETTER = "[a-zA-Z]";
629
630 /**
631 * Static attribute for regex for digits with single letter.
632 */
633 public static final String REGEX_FOR_DIGITS_WITH_SINGLE_LETTER = "[0-9]+[a-zA-Z]";
634
635 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530636 * Static attribute for class syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530637 */
638 public static final String CLASS = "class";
Bharat saraswal708abc02016-02-12 20:48:30 +0530639
640 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530641 * Static attribute for builder syntax.
642 */
643 public static final String BUILDER = "Builder";
644
645 /**
646 * Static attribute for interface syntax.
647 */
648 public static final String INTERFACE = "interface";
649
650 /**
651 * Static attribute for enum syntax.
652 */
653 public static final String ENUM = "enum";
654
655 /**
656 * Static attribute for static syntax.
657 */
658 public static final String STATIC = "static";
659
660 /**
661 * Static attribute for final syntax.
662 */
663 public static final String FINAL = "final";
664
665 /**
666 * Static attribute for package syntax.
667 */
668 public static final String PACKAGE = "package";
669
670 /**
671 * Static attribute for import syntax.
672 */
673 public static final String IMPORT = "import ";
674
675 /**
676 * Static attribute for null syntax.
677 */
678 public static final String NULL = "null";
679
680 /**
681 * Static attribute for return syntax.
682 */
683 public static final String RETURN = "return";
684
685 /**
686 * Static attribute for java new syntax.
687 */
688 public static final String NEW = "new";
689
690 /**
691 * Static attribute for this syntax.
692 */
693 public static final String THIS = "this";
694
695 /**
696 * Static attribute for implements syntax.
697 */
698 public static final String IMPLEMENTS = "implements";
699
700 /**
701 * Static attribute for extends syntax.
702 */
703 public static final String EXTEND = "extends";
704
705 /**
706 * Static attribute for impl syntax.
707 */
708 public static final String IMPL = "Impl";
709
710 /**
711 * Static attribute for build method syntax.
712 */
713 public static final String BUILD = "build";
714
715 /**
716 * Static attribute for object.
717 */
718 public static final String OBJECT = "Object";
719
720 /**
721 * Static attribute for override annotation.
722 */
723 public static final String OVERRIDE = "@Override";
724
725 /**
726 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530727 */
b.janani1fef2732016-03-04 12:29:05 +0530728 public static final String COLLECTION_IMPORTS = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530729
730 /**
731 * Static attribute for more object import package.
732 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530733 public static final String GOOGLE_MORE_OBJECT_IMPORT_PKG = "com.google.common.base";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530734
735 /**
736 * Static attribute for more object import class.
737 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530738 public static final String GOOGLE_MORE_OBJECT_IMPORT_CLASS = "MoreObjects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530739
740 /**
741 * Static attribute for to string method.
742 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530743 public static final String GOOGLE_MORE_OBJECT_METHOD_STRING = " MoreObjects.toStringHelper(getClass())";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530744
745 /**
746 * Static attribute for java utilities import package.
747 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530748 public static final String JAVA_UTIL_OBJECTS_IMPORT_PKG = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530749
750 /**
751 * Static attribute for java utilities objects import class.
752 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530753 public static final String JAVA_UTIL_OBJECTS_IMPORT_CLASS = "Objects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530754
755 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530756 * Static attribute for HasAugmentation class import package.
757 */
758 public static final String HAS_AUGMENTATION_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
759
760 /**
761 * Static attribute for HasAugmentation class import class.
762 */
763 public static final String HAS_AUGMENTATION_CLASS_IMPORT_CLASS = "HasAugmentation;\n";
764
765 /**
766 * Static attribute for AugmentedInfo class import package.
767 */
768 public static final String AUGMENTED_INFO_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
769
770 /**
771 * Static attribute for AugmentedInfo class import class.
772 */
773 public static final String AUGMENTED_INFO_CLASS_IMPORT_CLASS = "AugmentedInfo;\n";
774
775 /**
776 * Static attribute for augmentation class.
777 */
778 public static final String AUGMENTATION = "Augmentation";
779
780 /**
781 * Static attribute for HasAugmentation class.
782 */
783 public static final String HAS_AUGMENTATION = "HasAugmentation";
784
785 /**
786 * Static attribute for AugmentedInfo class.
787 */
788 public static final String AUGMENTED_INFO = "AugmentedInfo";
789
790 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530791 * Static attribute for list.
792 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530793 public static final String LIST = "List";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530794
795 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530796 * Static attribute for array list.
797 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530798 public static final String ARRAY_LIST = "ArrayList";
Bharat saraswal708abc02016-02-12 20:48:30 +0530799}