blob: 24744fa726722d087454a42831b27a879b8707d9 [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 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530275 * Static attribute for output variable of rpc.
276 */
277 public static final String RPC_INPUT_VAR_NAME = "inputVar";
278
279 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530280 * Static attribute for new line.
281 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530282 public static final String EQUAL = "=";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530283
284 /**
285 * Static attribute for slash syntax.
286 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530287 public static final String SLASH = File.separator;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530288
289 /**
290 * Static attribute for add syntax.
291 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530292 public static final String ADD = "+";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530293
294 /**
295 * Static attribute for asterisk.
296 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530297 public static final String ASTERISK = "*";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530298
299 /**
300 * Static attribute for at.
301 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530302 public static final String AT = "@";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530303
304 /**
305 * Static attribute for quotes.
306 */
b.janani1fef2732016-03-04 12:29:05 +0530307 public static final String QUOTES = "\"";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530308
309 /**
310 * Static attribute for ampersand.
311 */
b.janani1fef2732016-03-04 12:29:05 +0530312 public static final String AND = "&";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530313
314 /**
315 * Static attribute for comma.
316 */
b.janani1fef2732016-03-04 12:29:05 +0530317 public static final String COMMA = ",";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530318
319 /**
320 * Static attribute for add syntax.
321 */
b.janani1fef2732016-03-04 12:29:05 +0530322 public static final String ADD_STRING = "add";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530323
324 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530325 * Static attribute for from syntax.
326 */
327 public static final String FROM_STRING_METHOD_NAME = "fromString";
328
329 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530330 * Static attribute for check not null syntax.
331 */
b.janani1fef2732016-03-04 12:29:05 +0530332 public static final String CHECK_NOT_NULL_STRING = "checkNotNull";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530333
334 /**
335 * Static attribute for hash code syntax.
336 */
b.janani1fef2732016-03-04 12:29:05 +0530337 public static final String HASH_CODE_STRING = "hashCode";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530338
339 /**
340 * Static attribute for equals syntax.
341 */
b.janani1fef2732016-03-04 12:29:05 +0530342 public static final String EQUALS_STRING = "equals";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530343
344 /**
345 * Static attribute for object.
346 */
b.janani1fef2732016-03-04 12:29:05 +0530347 public static final String OBJECT_STRING = "Object";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530348
349 /**
350 * Static attribute for instance of syntax.
351 */
b.janani1fef2732016-03-04 12:29:05 +0530352 public static final String INSTANCE_OF = " instanceof ";
353
Bharat saraswal2f11f652016-03-25 18:19:46 +0530354 /**
355 * Static attribute for value syntax.
356 */
b.janani1fef2732016-03-04 12:29:05 +0530357 public static final String VALUE = "value";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530358
359 /**
Bharat saraswald72411a2016-04-19 01:00:16 +0530360 * Static attribute for enumValue syntax.
361 */
362 public static final String ENUM_VALUE = "enumValue";
363
364 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530365 * Static attribute for suffix s.
366 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530367 public static final String SUFFIX_S = "s";
b.janani1fef2732016-03-04 12:29:05 +0530368
Bharat saraswal2f11f652016-03-25 18:19:46 +0530369 /**
370 * Static attribute for if.
371 */
b.janani1fef2732016-03-04 12:29:05 +0530372 public static final String IF = "if";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530373
374 /**
375 * Static attribute for for.
376 */
b.janani1fef2732016-03-04 12:29:05 +0530377 public static final String FOR = "for";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530378
379 /**
380 * Static attribute for while.
381 */
b.janani1fef2732016-03-04 12:29:05 +0530382 public static final String WHILE = "while";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530383
384 /**
385 * Static attribute for of.
386 */
b.janani1fef2732016-03-04 12:29:05 +0530387 public static final String OF = "of";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530388
389 /**
390 * Static attribute for other.
391 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530392 public static final String OTHER = "other";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530393
394 /**
395 * Static attribute for obj syntax.
396 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530397 public static final String OBJ = "obj";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530398
399 /**
400 * Static attribute for hash syntax.
401 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530402 public static final String HASH = "hash";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530403
404 /**
405 * Static attribute for to syntax.
406 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530407 public static final String TO = "to";
b.janani1fef2732016-03-04 12:29:05 +0530408
Bharat saraswal2f11f652016-03-25 18:19:46 +0530409 /**
410 * Static attribute for true syntax.
411 */
b.janani1fef2732016-03-04 12:29:05 +0530412 public static final String TRUE = "true";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530413
414 /**
415 * Static attribute for false syntax.
416 */
b.janani1fef2732016-03-04 12:29:05 +0530417 public static final String FALSE = "false";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530418
419 /**
420 * Static attribute for org.
421 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530422 public static final String ORG = "org";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530423
424 /**
425 * Static attribute for temp.
426 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530427 public static final String TEMP = "temp";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530428
429 /**
430 * Static attribute for YANG file directory.
431 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530432 public static final String YANG_RESOURCES = "yang/resources";
Bharat saraswal708abc02016-02-12 20:48:30 +0530433
434 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530435 * Static attribute for diamond close bracket syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530436 */
437 public static final String DIAMOND_OPEN_BRACKET = "<";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530438
439 /**
440 * Static attribute for diamond close bracket syntax.
441 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530442 public static final String DIAMOND_CLOSE_BRACKET = ">";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530443
444 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530445 * Static attribute for exception syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530446 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530447 public static final String EXCEPTION = "Exception";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530448
449 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530450 * Static attribute for exception variable syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530451 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530452 public static final String EXCEPTION_VAR = "e";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530453
454 /**
455 * Static attribute for open parenthesis syntax.
456 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530457 public static final String OPEN_PARENTHESIS = "(";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530458
459 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530460 * Static attribute for clear syntax.
461 */
462 public static final String CLEAR = "clear";
463
464 /**
Bharat saraswalc0e04842016-05-12 13:16:57 +0530465 * Static attribute for switch syntax.
466 */
467 public static final String SWITCH = "switch";
468
469 /**
470 * Static attribute for case syntax.
471 */
472 public static final String CASE = "case";
473
474 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530475 * Static attribute for temp val syntax.
476 */
477 public static final String TMP_VAL = "tmpVal";
478
479 /**
480 * From string parameter name.
481 */
482 public static final String FROM_STRING_PARAM_NAME = "valInString";
483
484 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530485 * Static attribute for close parenthesis syntax.
486 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530487 public static final String CLOSE_PARENTHESIS = ")";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530488
489 /**
490 * Static attribute for open curly bracket syntax.
491 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530492 public static final String OPEN_CURLY_BRACKET = "{";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530493
494 /**
495 * Static attribute for close curly bracket syntax.
496 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530497 public static final String CLOSE_CURLY_BRACKET = "}";
498
499 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530500 * Static attribute for getter method prefix.
Bharat saraswal708abc02016-02-12 20:48:30 +0530501 */
502 public static final String GET_METHOD_PREFIX = "get";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530503
504 /**
505 * Static attribute for setter method prefix.
506 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530507 public static final String SET_METHOD_PREFIX = "set";
508
509 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530510 * Static attribute for four space indentation.
Bharat saraswal708abc02016-02-12 20:48:30 +0530511 */
512 public static final String FOUR_SPACE_INDENTATION = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530513
514 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530515 * Static attribute for not syntax.
516 */
517 public static final String NOT = "!";
518
519 /**
520 * Static attribute for try syntax.
521 */
522 public static final String TRY = "try";
523
524 /**
525 * Static attribute for catch syntax.
526 */
527 public static final String CATCH = "catch";
528
529 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530530 * Static attribute for eight space indentation.
531 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530532 public static final String EIGHT_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + FOUR_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530533
534 /**
535 * Static attribute for twelve space indentation.
536 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530537 public static final String TWELVE_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530538
539 /**
540 * Static attribute for sixteen space indentation.
541 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530542 public static final String SIXTEEN_SPACE_INDENTATION = EIGHT_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
543
544 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530545 * Static attribute for generated code path.
Bharat saraswal708abc02016-02-12 20:48:30 +0530546 */
Bharat saraswal8f2a6c52016-03-09 18:34:56 +0530547 public static final String YANG_GEN_DIR = "src/main/java/";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530548
549 /**
550 * Static attribute for base package.
551 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530552 public static final String DEFAULT_BASE_PKG = "org.onosproject.yang.gen";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530553
554 /**
555 * Static attribute for YANG date prefix.
556 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530557 public static final String REVISION_PREFIX = "rev";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530558
559 /**
janani bde4ffab2016-04-15 16:18:30 +0530560 * Static attribute for YANG automatic prefix for identifiers with keywords and beginning with digits.
561 */
562 public static final String YANG_AUTO_PREFIX = "yangAutoPrefix";
563
564 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530565 * Static attribute for YANG version perifx.
566 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530567 public static final String VERSION_PREFIX = "v";
568
569 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530570 * Static attribute for private modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530571 */
572 public static final String PRIVATE = "private";
Bharat saraswal708abc02016-02-12 20:48:30 +0530573
574 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530575 * Static attribute for public modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530576 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530577 public static final String PUBLIC = "public";
578
579 /**
580 * Static attribute for protected modifier.
581 */
582 public static final String PROTECTED = "protected";
583
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530584 /**
585 * Void java type.
586 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530587 public static final String VOID = "void";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530588
589 /**
590 * String built in java type.
591 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530592 public static final String STRING_DATA_TYPE = "String";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530593
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530594 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530595 * Java.lang.* packages.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530596 */
597 public static final String JAVA_LANG = "java.lang";
598
599 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530600 * Java.math.* packages.
601 */
602 public static final String JAVA_MATH = "java.math";
603
604 /**
605 * Boolean built in java type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530606 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530607 public static final String BOOLEAN_DATA_TYPE = "boolean";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530608
609 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530610 * BigInteger built in java type.
611 */
612 public static final String BIG_INTEGER = "BigInteger";
613
614 /**
615 * Byte java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530616 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530617 public static final String BYTE = "byte";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530618
619 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530620 * Short java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530621 */
622 public static final String SHORT = "short";
623
624 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530625 * Int java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530626 */
627 public static final String INT = "int";
628
629 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530630 * Long java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530631 */
632 public static final String LONG = "long";
633
634 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530635 * Float java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530636 */
637 public static final String FLOAT = "float";
638
639 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530640 * Double java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530641 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530642 public static final String DOUBLE = "double";
643
644 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530645 * Boolean built in java wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530646 */
647 public static final String BOOLEAN_WRAPPER = "Boolean";
648
649 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530650 * Byte java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530651 */
652 public static final String BYTE_WRAPPER = "Byte";
653
654 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530655 * Short java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530656 */
657 public static final String SHORT_WRAPPER = "Short";
658
659 /**
660 * Integer java built in wrapper type.
661 */
662 public static final String INTEGER_WRAPPER = "Integer";
663
664 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530665 * Long java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530666 */
667 public static final String LONG_WRAPPER = "Long";
668
669 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530670 * YangUint64 java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530671 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530672 public static final String YANG_UINT64 = "YangUint64";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530673
674 /**
Bharat saraswale2d51d62016-03-23 19:40:35 +0530675 * 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 +0530676 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530677 public static final List<String> JAVA_KEY_WORDS = Arrays.asList(
678 "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue",
679 "default", "do", "double", "else", "extends", "false", "final", "finally", "float", "for", "goto", "if",
680 "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "null", "package",
681 "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch",
682 "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while");
b.janani1fef2732016-03-04 12:29:05 +0530683
684 /**
janani bde4ffab2016-04-15 16:18:30 +0530685 * Static attribute for regex for all the special characters.
b.janani1fef2732016-03-04 12:29:05 +0530686 */
janani bde4ffab2016-04-15 16:18:30 +0530687 public static final String REGEX_WITH_ALL_SPECIAL_CHAR = "\\p{Punct}+";
688
689 /**
690 * Static attribute for regex for three special characters used in identifier.
691 */
692 public static final String REGEX_FOR_IDENTIFIER_SPECIAL_CHAR = "[. _ -]+";
693
694 /**
695 * Static attribute for regex for period.
696 */
697 public static final String REGEX_FOR_PERIOD = "[.]";
698
699 /**
700 * Static attribute for regex for underscore.
701 */
702 public static final String REGEX_FOR_UNDERSCORE = "[_]";
703
704 /**
705 * Static attribute for regex for hyphen.
706 */
707 public static final String REGEX_FOR_HYPHEN = "[-]";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530708
709 /**
710 * Static attribute for regex for digits.
711 */
b.janani1fef2732016-03-04 12:29:05 +0530712 public static final String REGEX_FOR_FIRST_DIGIT = "\\d.*";
713
714 /**
janani b4a6711a2016-05-17 13:12:22 +0530715 * Static attribute for regex with digits.
716 */
717 public static final String REGEX_WITH_DIGITS = "(?=\\d+)";
718
719 /**
janani bde4ffab2016-04-15 16:18:30 +0530720 * Static attribute for regex for single letter.
721 */
722 public static final String REGEX_FOR_SINGLE_LETTER = "[a-zA-Z]";
723
724 /**
725 * Static attribute for regex for digits with single letter.
726 */
727 public static final String REGEX_FOR_DIGITS_WITH_SINGLE_LETTER = "[0-9]+[a-zA-Z]";
728
729 /**
janani b4a6711a2016-05-17 13:12:22 +0530730 * Static attribute for regex with uppercase.
731 */
732 public static final String REGEX_WITH_UPPERCASE = "(?=\\p{Upper})";
733
734 /**
735 * Static attribute for regex for single capital case letter.
736 */
737 public static final String REGEX_WITH_SINGLE_CAPITAL_CASE = "[A-Z]";
738
739 /**
740 * Static attribute for regex for capital case letter with any number of digits and small case letters.
741 */
742 public static final String REGEX_WITH_SINGLE_CAPITAL_CASE_AND_DIGITS_SMALL_CASES = "[A-Z][0-9a-z]+";
743
744 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530745 * Static attribute for class syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530746 */
747 public static final String CLASS = "class";
Bharat saraswal708abc02016-02-12 20:48:30 +0530748
749 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530750 * Static attribute for builder syntax.
751 */
752 public static final String BUILDER = "Builder";
753
754 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530755 * Static attribute for manager syntax.
756 */
757 public static final String MANAGER = "Manager";
758
759 /**
760 * Static attribute for service syntax.
761 */
762 public static final String SERVICE = "Service";
763
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530764 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530765 * Static attribute for interface syntax.
766 */
767 public static final String INTERFACE = "interface";
768
769 /**
770 * Static attribute for enum syntax.
771 */
772 public static final String ENUM = "enum";
773
774 /**
775 * Static attribute for static syntax.
776 */
777 public static final String STATIC = "static";
778
779 /**
780 * Static attribute for final syntax.
781 */
782 public static final String FINAL = "final";
783
784 /**
785 * Static attribute for package syntax.
786 */
787 public static final String PACKAGE = "package";
788
789 /**
790 * Static attribute for import syntax.
791 */
792 public static final String IMPORT = "import ";
793
794 /**
795 * Static attribute for null syntax.
796 */
797 public static final String NULL = "null";
798
799 /**
800 * Static attribute for return syntax.
801 */
802 public static final String RETURN = "return";
803
804 /**
805 * Static attribute for java new syntax.
806 */
807 public static final String NEW = "new";
808
809 /**
810 * Static attribute for this syntax.
811 */
812 public static final String THIS = "this";
813
814 /**
815 * Static attribute for implements syntax.
816 */
817 public static final String IMPLEMENTS = "implements";
818
819 /**
820 * Static attribute for extends syntax.
821 */
822 public static final String EXTEND = "extends";
823
824 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530825 * Static attribute for service interface suffix syntax.
826 */
827 public static final String SERVICE_METHOD_STRING = "Service";
828
829 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530830 * For event file generation.
831 */
832 public static final String EVENT_STRING = "Event";
833
834 /**
835 * For event listener file generation.
836 */
837 public static final String EVENT_LISTENER_STRING = "Listener";
838
839 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530840 * Static attribute for impl syntax.
841 */
842 public static final String IMPL = "Impl";
843
844 /**
845 * Static attribute for build method syntax.
846 */
847 public static final String BUILD = "build";
848
849 /**
850 * Static attribute for object.
851 */
852 public static final String OBJECT = "Object";
853
854 /**
855 * Static attribute for override annotation.
856 */
857 public static final String OVERRIDE = "@Override";
858
859 /**
860 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530861 */
b.janani1fef2732016-03-04 12:29:05 +0530862 public static final String COLLECTION_IMPORTS = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530863
864 /**
865 * Static attribute for more object import package.
866 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530867 public static final String GOOGLE_MORE_OBJECT_IMPORT_PKG = "com.google.common.base";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530868
869 /**
870 * Static attribute for more object import class.
871 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530872 public static final String GOOGLE_MORE_OBJECT_IMPORT_CLASS = "MoreObjects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530873
874 /**
875 * Static attribute for to string method.
876 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530877 public static final String GOOGLE_MORE_OBJECT_METHOD_STRING = " MoreObjects.toStringHelper(getClass())";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530878
879 /**
880 * Static attribute for java utilities import package.
881 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530882 public static final String JAVA_UTIL_OBJECTS_IMPORT_PKG = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530883
884 /**
885 * Static attribute for java utilities objects import class.
886 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530887 public static final String JAVA_UTIL_OBJECTS_IMPORT_CLASS = "Objects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530888
889 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530890 * Static attribute for AugmentationHolder class import package.
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530891 */
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530892 public static final String PROVIDED_AUGMENTATION_CLASS_IMPORT_PKG =
893 "org.onosproject.yangutils.translator.tojava";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530894
895 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530896 * Static attribute for AugmentationHolder class import class.
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530897 */
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530898 public static final String AUGMENTATION_HOLDER_CLASS_IMPORT_CLASS = "AugmentationHolder;\n";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530899
900 /**
901 * Static attribute for AugmentedInfo class import package.
902 */
903 public static final String AUGMENTED_INFO_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
904
905 /**
906 * Static attribute for AugmentedInfo class import class.
907 */
908 public static final String AUGMENTED_INFO_CLASS_IMPORT_CLASS = "AugmentedInfo;\n";
909
910 /**
911 * Static attribute for augmentation class.
912 */
913 public static final String AUGMENTATION = "Augmentation";
914
915 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530916 * Static attribute for AugmentationHolder class.
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530917 */
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530918 public static final String AUGMENTATION_HOLDER = "AugmentationHolder";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530919
920 /**
921 * Static attribute for AugmentedInfo class.
922 */
923 public static final String AUGMENTED_INFO = "AugmentedInfo";
924
925 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530926 * Static attribute for augmentable.
927 */
928 public static final String AUGMENTABLE = "Augmentable";
929 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530930 * Static attribute for list.
931 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530932 public static final String LIST = "List";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530933
934 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530935 * Static attribute for array list.
936 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530937 public static final String ARRAY_LIST = "ArrayList";
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530938
939 /**
Bharat saraswalc0e04842016-05-12 13:16:57 +0530940 * Comment to be added for autogenerated impl methods.
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530941 */
942 public static final String YANG_UTILS_TODO = "//TODO: YANG utils generated code";
943
944 /**
Vidyashree Rama1db15562016-05-17 16:16:15 +0530945 * Static attribute for YANG file error.
946 */
947 public static final String YANG_FILE_ERROR = "YANG file error : ";
948
949 /**
950 * Static attribute for unsupported error information.
951 */
952 public static final String UNSUPPORTED_YANG_CONSTRUCT = " is not supported.";
953
954 /**
955 * Static attribute for currently unsupported error information.
956 */
957 public static final String CURRENTLY_UNSUPPORTED = " is not supported in current version, please check wiki" +
958 " for YANG utils road map.";
959
960 /**
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530961 * Creates an instance of util constants.
962 */
963 private UtilConstants() {
964 }
Bharat saraswal708abc02016-02-12 20:48:30 +0530965}