blob: 39e5148609dcd0fab037cc94e08e3ef0eb53c5f8 [file] [log] [blame]
Bharat saraswal708abc02016-02-12 20:48:30 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Bharat saraswal708abc02016-02-12 20:48:30 +05303 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yangutils.utils;
18
Vinod Kumar S38046502016-03-23 15:30:27 +053019import java.io.File;
b.janani1fef2732016-03-04 12:29:05 +053020import java.util.Arrays;
21import java.util.List;
22
Bharat saraswal708abc02016-02-12 20:48:30 +053023/**
Bharat saraswald9822e92016-04-05 15:13:44 +053024 * Represents utilities constants which are used while generating java files.
Bharat saraswal708abc02016-02-12 20:48:30 +053025 */
26public final class UtilConstants {
27
28 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +053029 * JavaDocs for impl class.
Bharat saraswal708abc02016-02-12 20:48:30 +053030 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +053031 public static final String IMPL_CLASS_JAVA_DOC = " * Represents the implementation of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053032
33 /**
34 * JavaDocs for builder class.
35 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +053036 public static final String BUILDER_CLASS_JAVA_DOC = " * Represents the builder implementation of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053037
38 /**
39 * JavaDocs for interface class.
40 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +053041 public static final String INTERFACE_JAVA_DOC = " * Abstraction of an entity which represents the"
42 + " functionality of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053043
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +053044 /**
45 * JavaDocs for event.
46 */
47 public static final String EVENT_JAVA_DOC = " * Represents event implementation of ";
48
49 /**
50 * JavaDocs for event listener.
51 */
52 public static final String EVENT_LISTENER_JAVA_DOC = " * Abstraction for event listener of ";
53
Bharat saraswal2f11f652016-03-25 18:19:46 +053054 /**
55 * JavaDocs for builder interface class.
56 */
Bharat saraswal708abc02016-02-12 20:48:30 +053057 public static final String BUILDER_INTERFACE_JAVA_DOC = " * Builder for ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053058
59 /**
Bharat saraswald72411a2016-04-19 01:00:16 +053060 * JavaDocs for enum class.
61 */
62 public static final String ENUM_CLASS_JAVADOC = " * Represents ENUM data of ";
63
64 /**
65 * JavaDocs for enum attribute.
66 */
67 public static final String ENUM_ATTRIBUTE_JAVADOC = " * Represents ";
68
69 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +053070 * JavaDocs for package info class.
71 */
Bharat saraswald72411a2016-04-19 01:00:16 +053072 public static final String PACKAGE_INFO_JAVADOC = " * Implementation of YANG node ";
73
74 /**
75 * JavaDocs for package info class.
76 */
77 public static final String PACKAGE_INFO_JAVADOC_OF_CHILD = "'s children nodes";
Bharat saraswal2f11f652016-03-25 18:19:46 +053078
79 /**
80 * JavaDocs's first line.
81 */
Bharat saraswal708abc02016-02-12 20:48:30 +053082 public static final String JAVA_DOC_FIRST_LINE = "/**\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +053083
84 /**
85 * JavaDocs's last line.
86 */
Bharat saraswal708abc02016-02-12 20:48:30 +053087 public static final String JAVA_DOC_END_LINE = " */\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +053088
89 /**
90 * JavaDocs's param annotation.
91 */
Bharat saraswal708abc02016-02-12 20:48:30 +053092 public static final String JAVA_DOC_PARAM = " * @param ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053093
94 /**
95 * JavaDocs's return annotation.
96 */
Bharat saraswal708abc02016-02-12 20:48:30 +053097 public static final String JAVA_DOC_RETURN = " * @return ";
Bharat saraswal2f11f652016-03-25 18:19:46 +053098
99 /**
100 * JavaDocs's throw annotation.
101 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530102 public static final String JAVA_DOC_THROWS = " * @throws ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530103
104 /**
105 * JavaDocs's description for setter method.
106 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530107 public static final String JAVA_DOC_SETTERS = " * Returns the builder object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530108
109 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530110 * JavaDocs's description for setter method.
111 */
112 public static final String JAVA_DOC_MANAGER_SETTERS = " * Sets the value to attribute ";
113
114 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530115 * JavaDocs's description for OF method.
116 */
b.janani1fef2732016-03-04 12:29:05 +0530117 public static final String JAVA_DOC_OF = " * Returns the object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530118
119 /**
120 * JavaDocs's description for typedef' setter method.
121 */
b.janani1fef2732016-03-04 12:29:05 +0530122 public static final String JAVA_DOC_SETTERS_COMMON = " * Sets the value of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530123
124 /**
125 * JavaDocs's description for getter method.
126 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530127 public static final String JAVA_DOC_GETTERS = " * Returns the attribute ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530128
129 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530130 * JavaDocs's description for constructor.
131 */
Bharat saraswal6ef0b762016-04-05 12:45:45 +0530132 public static final String JAVA_DOC_CONSTRUCTOR = " * Creates an instance of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530133
134 /**
135 * JavaDocs's description for build method.
136 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530137 public static final String JAVA_DOC_BUILD = " * Builds object of ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530138
139 /**
140 * JavaDocs's return statement for build method.
141 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530142 public static final String JAVA_DOC_BUILD_RETURN = "object of ";
143
144 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530145 * JavaDocs's statement for builder object.
146 */
147 public static final String BUILDER_OBJECT = "builder object of ";
148
149 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530150 * JavaDocs's statement for rpc method.
151 */
152 public static final String JAVA_DOC_RPC = " * Service interface of ";
153
154 /**
155 * JavaDocs's statement for rpc's input string.
156 */
157 public static final String RPC_INPUT_STRING = "input of service interface ";
158
159 /**
160 * JavaDocs's statement for rpc's output string.
161 */
162 public static final String RPC_OUTPUT_STRING = "output of service interface ";
163
164 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530165 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530166 */
167 public static final String NEW_LINE = "\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530168
169 /**
Bharat saraswalc0e04842016-05-12 13:16:57 +0530170 * Static attribute for default.
171 */
172 public static final String DEFAULT = "default";
173
174 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530175 * Static attribute for multiple new line.
176 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530177 public static final String MULTIPLE_NEW_LINE = "\n\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530178
179 /**
180 * Static attribute for empty line.
181 */
b.janani1fef2732016-03-04 12:29:05 +0530182 public static final String EMPTY_STRING = "";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530183
184 /**
185 * Static attribute for new line with asterisk.
186 */
187 public static final String NEW_LINE_ASTERISK = " *\n";
188
189 /**
190 * Static attribute for period.
191 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530192 public static final String PERIOD = ".";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530193
194 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530195 * Static attribute for parse byte.
196 */
197 public static final String PARSE_BYTE = "parseByte";
198
199 /**
200 * Static attribute for parse short.
201 */
202 public static final String PARSE_SHORT = "parseShort";
203
204 /**
205 * Static attribute for parse int.
206 */
207 public static final String PARSE_INT = "parseInt";
208
209 /**
210 * Static attribute for parse long.
211 */
212 public static final String PARSE_LONG = "parseLong";
213
214 /**
215 * Static attribute for omit null value.
216 */
217 public static final String OMIT_NULL_VALUE_STRING = "omitNullValues()";
218
219 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530220 * Static attribute for colan.
221 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530222 public static final String COLAN = ":";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530223
224 /**
225 * Static attribute for underscore.
226 */
b.janani1fef2732016-03-04 12:29:05 +0530227 public static final String UNDER_SCORE = "_";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530228
229 /**
230 * Static attribute for semi-colan.
231 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530232 public static final String SEMI_COLAN = ";";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530233
234 /**
235 * Static attribute for hyphen.
236 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530237 public static final String HYPHEN = "-";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530238
239 /**
240 * Static attribute for space.
241 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530242 public static final String SPACE = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530243
244 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530245 * Static attribute for ListenerRegistry.
246 */
247 public static final String LISTENER_REG = "ListenerRegistry";
248
249 /**
250 * Static attribute for ListenerService.
251 */
252 public static final String LISTENER_SERVICE = "ListenerService";
253
254 /**
255 * Static attribute for listener package.
256 */
257 public static final String LISTENER_PKG = "org.onosproject.event";
258
259 /**
Vidyashree Rama1db15562016-05-17 16:16:15 +0530260 * Static attribute for colon.
261 */
262 public static final String COLON = ":";
263
264 /**
265 * Static attribute for caret.
266 */
267 public static final String CARET = "^";
268
269 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530270 * Static attribute for input string.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530271 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530272 public static final String INPUT = "input";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530273
274 /**
janani b6240d292016-05-17 18:20:33 +0530275 * Static attribute for leafref string.
276 */
277 public static final String LEAFREF = "leafref";
278
279 /**
280 * Static attribute for identityref string.
281 */
282 public static final String IDENTITYREF = "identityref";
283
284 /**
285 * Static attribute for instance identifier string.
286 */
287 public static final String INSTANCE_IDENTIFIER = "instance-identifier";
288
289 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530290 * Static attribute for output variable of rpc.
291 */
292 public static final String RPC_INPUT_VAR_NAME = "inputVar";
293
294 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530295 * Static attribute for new line.
296 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530297 public static final String EQUAL = "=";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530298
299 /**
300 * Static attribute for slash syntax.
301 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530302 public static final String SLASH = File.separator;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530303
304 /**
305 * Static attribute for add syntax.
306 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530307 public static final String ADD = "+";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530308
309 /**
310 * Static attribute for asterisk.
311 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530312 public static final String ASTERISK = "*";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530313
314 /**
315 * Static attribute for at.
316 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530317 public static final String AT = "@";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530318
319 /**
320 * Static attribute for quotes.
321 */
b.janani1fef2732016-03-04 12:29:05 +0530322 public static final String QUOTES = "\"";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530323
324 /**
325 * Static attribute for ampersand.
326 */
b.janani1fef2732016-03-04 12:29:05 +0530327 public static final String AND = "&";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530328
329 /**
330 * Static attribute for comma.
331 */
b.janani1fef2732016-03-04 12:29:05 +0530332 public static final String COMMA = ",";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530333
334 /**
335 * Static attribute for add syntax.
336 */
b.janani1fef2732016-03-04 12:29:05 +0530337 public static final String ADD_STRING = "add";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530338
339 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530340 * Static attribute for from syntax.
341 */
342 public static final String FROM_STRING_METHOD_NAME = "fromString";
343
344 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530345 * Static attribute for check not null syntax.
346 */
b.janani1fef2732016-03-04 12:29:05 +0530347 public static final String CHECK_NOT_NULL_STRING = "checkNotNull";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530348
349 /**
350 * Static attribute for hash code syntax.
351 */
b.janani1fef2732016-03-04 12:29:05 +0530352 public static final String HASH_CODE_STRING = "hashCode";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530353
354 /**
355 * Static attribute for equals syntax.
356 */
b.janani1fef2732016-03-04 12:29:05 +0530357 public static final String EQUALS_STRING = "equals";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530358
359 /**
360 * Static attribute for object.
361 */
b.janani1fef2732016-03-04 12:29:05 +0530362 public static final String OBJECT_STRING = "Object";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530363
364 /**
365 * Static attribute for instance of syntax.
366 */
b.janani1fef2732016-03-04 12:29:05 +0530367 public static final String INSTANCE_OF = " instanceof ";
368
Bharat saraswal2f11f652016-03-25 18:19:46 +0530369 /**
370 * Static attribute for value syntax.
371 */
b.janani1fef2732016-03-04 12:29:05 +0530372 public static final String VALUE = "value";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530373
374 /**
Bharat saraswald72411a2016-04-19 01:00:16 +0530375 * Static attribute for enumValue syntax.
376 */
377 public static final String ENUM_VALUE = "enumValue";
378
379 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530380 * Static attribute for suffix s.
381 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530382 public static final String SUFFIX_S = "s";
b.janani1fef2732016-03-04 12:29:05 +0530383
Bharat saraswal2f11f652016-03-25 18:19:46 +0530384 /**
385 * Static attribute for if.
386 */
b.janani1fef2732016-03-04 12:29:05 +0530387 public static final String IF = "if";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530388
389 /**
390 * Static attribute for for.
391 */
b.janani1fef2732016-03-04 12:29:05 +0530392 public static final String FOR = "for";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530393
394 /**
395 * Static attribute for while.
396 */
b.janani1fef2732016-03-04 12:29:05 +0530397 public static final String WHILE = "while";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530398
399 /**
400 * Static attribute for of.
401 */
b.janani1fef2732016-03-04 12:29:05 +0530402 public static final String OF = "of";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530403
404 /**
405 * Static attribute for other.
406 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530407 public static final String OTHER = "other";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530408
409 /**
410 * Static attribute for obj syntax.
411 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530412 public static final String OBJ = "obj";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530413
414 /**
415 * Static attribute for hash syntax.
416 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530417 public static final String HASH = "hash";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530418
419 /**
420 * Static attribute for to syntax.
421 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530422 public static final String TO = "to";
b.janani1fef2732016-03-04 12:29:05 +0530423
Bharat saraswal2f11f652016-03-25 18:19:46 +0530424 /**
425 * Static attribute for true syntax.
426 */
b.janani1fef2732016-03-04 12:29:05 +0530427 public static final String TRUE = "true";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530428
429 /**
430 * Static attribute for false syntax.
431 */
b.janani1fef2732016-03-04 12:29:05 +0530432 public static final String FALSE = "false";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530433
434 /**
435 * Static attribute for org.
436 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530437 public static final String ORG = "org";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530438
439 /**
440 * Static attribute for temp.
441 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530442 public static final String TEMP = "temp";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530443
444 /**
445 * Static attribute for YANG file directory.
446 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530447 public static final String YANG_RESOURCES = "yang/resources";
Bharat saraswal708abc02016-02-12 20:48:30 +0530448
449 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530450 * Static attribute for diamond close bracket syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530451 */
452 public static final String DIAMOND_OPEN_BRACKET = "<";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530453
454 /**
455 * Static attribute for diamond close bracket syntax.
456 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530457 public static final String DIAMOND_CLOSE_BRACKET = ">";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530458
459 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530460 * Static attribute for exception syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530461 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530462 public static final String EXCEPTION = "Exception";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530463
464 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530465 * Static attribute for exception variable syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530466 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530467 public static final String EXCEPTION_VAR = "e";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530468
469 /**
470 * Static attribute for open parenthesis syntax.
471 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530472 public static final String OPEN_PARENTHESIS = "(";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530473
474 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530475 * Static attribute for clear syntax.
476 */
477 public static final String CLEAR = "clear";
478
479 /**
Bharat saraswalc0e04842016-05-12 13:16:57 +0530480 * Static attribute for switch syntax.
481 */
482 public static final String SWITCH = "switch";
483
484 /**
485 * Static attribute for case syntax.
486 */
487 public static final String CASE = "case";
488
489 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530490 * Static attribute for temp val syntax.
491 */
492 public static final String TMP_VAL = "tmpVal";
493
494 /**
495 * From string parameter name.
496 */
497 public static final String FROM_STRING_PARAM_NAME = "valInString";
498
499 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530500 * Static attribute for close parenthesis syntax.
501 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530502 public static final String CLOSE_PARENTHESIS = ")";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530503
504 /**
505 * Static attribute for open curly bracket syntax.
506 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530507 public static final String OPEN_CURLY_BRACKET = "{";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530508
509 /**
510 * Static attribute for close curly bracket syntax.
511 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530512 public static final String CLOSE_CURLY_BRACKET = "}";
513
514 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530515 * Static attribute for getter method prefix.
Bharat saraswal708abc02016-02-12 20:48:30 +0530516 */
517 public static final String GET_METHOD_PREFIX = "get";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530518
519 /**
520 * Static attribute for setter method prefix.
521 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530522 public static final String SET_METHOD_PREFIX = "set";
523
524 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530525 * Static attribute for four space indentation.
Bharat saraswal708abc02016-02-12 20:48:30 +0530526 */
527 public static final String FOUR_SPACE_INDENTATION = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530528
529 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530530 * Static attribute for not syntax.
531 */
532 public static final String NOT = "!";
533
534 /**
535 * Static attribute for try syntax.
536 */
537 public static final String TRY = "try";
538
539 /**
540 * Static attribute for catch syntax.
541 */
542 public static final String CATCH = "catch";
543
544 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530545 * Static attribute for eight space indentation.
546 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530547 public static final String EIGHT_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + FOUR_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530548
549 /**
550 * Static attribute for twelve space indentation.
551 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530552 public static final String TWELVE_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530553
554 /**
555 * Static attribute for sixteen space indentation.
556 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530557 public static final String SIXTEEN_SPACE_INDENTATION = EIGHT_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
558
559 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530560 * Static attribute for generated code path.
Bharat saraswal708abc02016-02-12 20:48:30 +0530561 */
Bharat saraswal8f2a6c52016-03-09 18:34:56 +0530562 public static final String YANG_GEN_DIR = "src/main/java/";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530563
564 /**
565 * Static attribute for base package.
566 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530567 public static final String DEFAULT_BASE_PKG = "org.onosproject.yang.gen";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530568
569 /**
570 * Static attribute for YANG date prefix.
571 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530572 public static final String REVISION_PREFIX = "rev";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530573
574 /**
janani bde4ffab2016-04-15 16:18:30 +0530575 * Static attribute for YANG automatic prefix for identifiers with keywords and beginning with digits.
576 */
577 public static final String YANG_AUTO_PREFIX = "yangAutoPrefix";
578
579 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530580 * Static attribute for YANG version perifx.
581 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530582 public static final String VERSION_PREFIX = "v";
583
584 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530585 * Static attribute for private modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530586 */
587 public static final String PRIVATE = "private";
Bharat saraswal708abc02016-02-12 20:48:30 +0530588
589 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530590 * Static attribute for public modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530591 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530592 public static final String PUBLIC = "public";
593
594 /**
595 * Static attribute for protected modifier.
596 */
597 public static final String PROTECTED = "protected";
598
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530599 /**
600 * Void java type.
601 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530602 public static final String VOID = "void";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530603
604 /**
605 * String built in java type.
606 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530607 public static final String STRING_DATA_TYPE = "String";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530608
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530609 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530610 * Java.lang.* packages.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530611 */
612 public static final String JAVA_LANG = "java.lang";
613
614 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530615 * Java.math.* packages.
616 */
617 public static final String JAVA_MATH = "java.math";
618
619 /**
620 * Boolean built in java type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530621 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530622 public static final String BOOLEAN_DATA_TYPE = "boolean";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530623
624 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530625 * BigInteger built in java type.
626 */
627 public static final String BIG_INTEGER = "BigInteger";
628
629 /**
630 * Byte java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530631 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530632 public static final String BYTE = "byte";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530633
634 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530635 * Short java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530636 */
637 public static final String SHORT = "short";
638
639 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530640 * Int java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530641 */
642 public static final String INT = "int";
643
644 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530645 * Long java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530646 */
647 public static final String LONG = "long";
648
649 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530650 * Float java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530651 */
652 public static final String FLOAT = "float";
653
654 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530655 * Double java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530656 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530657 public static final String DOUBLE = "double";
658
659 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530660 * Boolean built in java wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530661 */
662 public static final String BOOLEAN_WRAPPER = "Boolean";
663
664 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530665 * Byte java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530666 */
667 public static final String BYTE_WRAPPER = "Byte";
668
669 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530670 * Short java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530671 */
672 public static final String SHORT_WRAPPER = "Short";
673
674 /**
675 * Integer java built in wrapper type.
676 */
677 public static final String INTEGER_WRAPPER = "Integer";
678
679 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530680 * Long java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530681 */
682 public static final String LONG_WRAPPER = "Long";
683
684 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530685 * YangUint64 java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530686 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530687 public static final String YANG_UINT64 = "YangUint64";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530688
689 /**
Bharat saraswale2d51d62016-03-23 19:40:35 +0530690 * 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 +0530691 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530692 public static final List<String> JAVA_KEY_WORDS = Arrays.asList(
693 "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue",
694 "default", "do", "double", "else", "extends", "false", "final", "finally", "float", "for", "goto", "if",
695 "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "null", "package",
696 "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch",
697 "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while");
b.janani1fef2732016-03-04 12:29:05 +0530698
699 /**
janani bde4ffab2016-04-15 16:18:30 +0530700 * Static attribute for regex for all the special characters.
b.janani1fef2732016-03-04 12:29:05 +0530701 */
janani bde4ffab2016-04-15 16:18:30 +0530702 public static final String REGEX_WITH_ALL_SPECIAL_CHAR = "\\p{Punct}+";
703
704 /**
705 * Static attribute for regex for three special characters used in identifier.
706 */
707 public static final String REGEX_FOR_IDENTIFIER_SPECIAL_CHAR = "[. _ -]+";
708
709 /**
710 * Static attribute for regex for period.
711 */
712 public static final String REGEX_FOR_PERIOD = "[.]";
713
714 /**
715 * Static attribute for regex for underscore.
716 */
717 public static final String REGEX_FOR_UNDERSCORE = "[_]";
718
719 /**
720 * Static attribute for regex for hyphen.
721 */
722 public static final String REGEX_FOR_HYPHEN = "[-]";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530723
724 /**
725 * Static attribute for regex for digits.
726 */
b.janani1fef2732016-03-04 12:29:05 +0530727 public static final String REGEX_FOR_FIRST_DIGIT = "\\d.*";
728
729 /**
janani b4a6711a2016-05-17 13:12:22 +0530730 * Static attribute for regex with digits.
731 */
732 public static final String REGEX_WITH_DIGITS = "(?=\\d+)";
733
734 /**
janani bde4ffab2016-04-15 16:18:30 +0530735 * Static attribute for regex for single letter.
736 */
737 public static final String REGEX_FOR_SINGLE_LETTER = "[a-zA-Z]";
738
739 /**
740 * Static attribute for regex for digits with single letter.
741 */
742 public static final String REGEX_FOR_DIGITS_WITH_SINGLE_LETTER = "[0-9]+[a-zA-Z]";
743
744 /**
janani b4a6711a2016-05-17 13:12:22 +0530745 * Static attribute for regex with uppercase.
746 */
747 public static final String REGEX_WITH_UPPERCASE = "(?=\\p{Upper})";
748
749 /**
750 * Static attribute for regex for single capital case letter.
751 */
752 public static final String REGEX_WITH_SINGLE_CAPITAL_CASE = "[A-Z]";
753
754 /**
755 * Static attribute for regex for capital case letter with any number of digits and small case letters.
756 */
757 public static final String REGEX_WITH_SINGLE_CAPITAL_CASE_AND_DIGITS_SMALL_CASES = "[A-Z][0-9a-z]+";
758
759 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530760 * Static attribute for class syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530761 */
762 public static final String CLASS = "class";
Bharat saraswal708abc02016-02-12 20:48:30 +0530763
764 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530765 * Static attribute for builder syntax.
766 */
767 public static final String BUILDER = "Builder";
768
769 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530770 * Static attribute for manager syntax.
771 */
772 public static final String MANAGER = "Manager";
773
774 /**
775 * Static attribute for service syntax.
776 */
777 public static final String SERVICE = "Service";
778
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530779 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530780 * Static attribute for interface syntax.
781 */
782 public static final String INTERFACE = "interface";
783
784 /**
785 * Static attribute for enum syntax.
786 */
787 public static final String ENUM = "enum";
788
789 /**
790 * Static attribute for static syntax.
791 */
792 public static final String STATIC = "static";
793
794 /**
795 * Static attribute for final syntax.
796 */
797 public static final String FINAL = "final";
798
799 /**
800 * Static attribute for package syntax.
801 */
802 public static final String PACKAGE = "package";
803
804 /**
805 * Static attribute for import syntax.
806 */
807 public static final String IMPORT = "import ";
808
809 /**
810 * Static attribute for null syntax.
811 */
812 public static final String NULL = "null";
813
814 /**
815 * Static attribute for return syntax.
816 */
817 public static final String RETURN = "return";
818
819 /**
820 * Static attribute for java new syntax.
821 */
822 public static final String NEW = "new";
823
824 /**
825 * Static attribute for this syntax.
826 */
827 public static final String THIS = "this";
828
829 /**
830 * Static attribute for implements syntax.
831 */
832 public static final String IMPLEMENTS = "implements";
833
834 /**
835 * Static attribute for extends syntax.
836 */
837 public static final String EXTEND = "extends";
838
839 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530840 * Static attribute for service interface suffix syntax.
841 */
842 public static final String SERVICE_METHOD_STRING = "Service";
843
844 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530845 * For event file generation.
846 */
847 public static final String EVENT_STRING = "Event";
848
849 /**
850 * For event listener file generation.
851 */
852 public static final String EVENT_LISTENER_STRING = "Listener";
853
854 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530855 * Static attribute for impl syntax.
856 */
857 public static final String IMPL = "Impl";
858
859 /**
860 * Static attribute for build method syntax.
861 */
862 public static final String BUILD = "build";
863
864 /**
865 * Static attribute for object.
866 */
867 public static final String OBJECT = "Object";
868
869 /**
870 * Static attribute for override annotation.
871 */
872 public static final String OVERRIDE = "@Override";
873
874 /**
875 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530876 */
b.janani1fef2732016-03-04 12:29:05 +0530877 public static final String COLLECTION_IMPORTS = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530878
879 /**
880 * Static attribute for more object import package.
881 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530882 public static final String GOOGLE_MORE_OBJECT_IMPORT_PKG = "com.google.common.base";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530883
884 /**
885 * Static attribute for more object import class.
886 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530887 public static final String GOOGLE_MORE_OBJECT_IMPORT_CLASS = "MoreObjects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530888
889 /**
890 * Static attribute for to string method.
891 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530892 public static final String GOOGLE_MORE_OBJECT_METHOD_STRING = " MoreObjects.toStringHelper(getClass())";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530893
894 /**
895 * Static attribute for java utilities import package.
896 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530897 public static final String JAVA_UTIL_OBJECTS_IMPORT_PKG = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530898
899 /**
900 * Static attribute for java utilities objects import class.
901 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530902 public static final String JAVA_UTIL_OBJECTS_IMPORT_CLASS = "Objects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530903
904 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530905 * Static attribute for AugmentationHolder class import package.
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530906 */
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530907 public static final String PROVIDED_AUGMENTATION_CLASS_IMPORT_PKG =
908 "org.onosproject.yangutils.translator.tojava";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530909
910 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530911 * Static attribute for AugmentationHolder class import class.
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530912 */
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530913 public static final String AUGMENTATION_HOLDER_CLASS_IMPORT_CLASS = "AugmentationHolder;\n";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530914
915 /**
916 * Static attribute for AugmentedInfo class import package.
917 */
918 public static final String AUGMENTED_INFO_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
919
920 /**
921 * Static attribute for AugmentedInfo class import class.
922 */
923 public static final String AUGMENTED_INFO_CLASS_IMPORT_CLASS = "AugmentedInfo;\n";
924
925 /**
926 * Static attribute for augmentation class.
927 */
928 public static final String AUGMENTATION = "Augmentation";
929
930 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530931 * Static attribute for AugmentationHolder class.
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530932 */
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530933 public static final String AUGMENTATION_HOLDER = "AugmentationHolder";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530934
935 /**
936 * Static attribute for AugmentedInfo class.
937 */
938 public static final String AUGMENTED_INFO = "AugmentedInfo";
939
940 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530941 * Static attribute for augmentable.
942 */
943 public static final String AUGMENTABLE = "Augmentable";
944 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530945 * Static attribute for list.
946 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530947 public static final String LIST = "List";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530948
949 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530950 * Static attribute for array list.
951 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530952 public static final String ARRAY_LIST = "ArrayList";
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530953
954 /**
Bharat saraswalc0e04842016-05-12 13:16:57 +0530955 * Comment to be added for autogenerated impl methods.
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530956 */
957 public static final String YANG_UTILS_TODO = "//TODO: YANG utils generated code";
958
959 /**
Vidyashree Rama1db15562016-05-17 16:16:15 +0530960 * Static attribute for YANG file error.
961 */
962 public static final String YANG_FILE_ERROR = "YANG file error : ";
963
964 /**
965 * Static attribute for unsupported error information.
966 */
967 public static final String UNSUPPORTED_YANG_CONSTRUCT = " is not supported.";
968
969 /**
970 * Static attribute for currently unsupported error information.
971 */
972 public static final String CURRENTLY_UNSUPPORTED = " is not supported in current version, please check wiki" +
973 " for YANG utils road map.";
974
975 /**
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530976 * Creates an instance of util constants.
977 */
978 private UtilConstants() {
979 }
Bharat saraswal708abc02016-02-12 20:48:30 +0530980}