blob: 278c3329c262019077c620a1f970b654dbc17ff0 [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 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530260 * Static attribute for input string.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530261 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530262 public static final String INPUT = "input";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530263
264 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530265 * Static attribute for output variable of rpc.
266 */
267 public static final String RPC_INPUT_VAR_NAME = "inputVar";
268
269 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530270 * Static attribute for new line.
271 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530272 public static final String EQUAL = "=";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530273
274 /**
275 * Static attribute for slash syntax.
276 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530277 public static final String SLASH = File.separator;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530278
279 /**
280 * Static attribute for add syntax.
281 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530282 public static final String ADD = "+";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530283
284 /**
285 * Static attribute for asterisk.
286 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530287 public static final String ASTERISK = "*";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530288
289 /**
290 * Static attribute for at.
291 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530292 public static final String AT = "@";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530293
294 /**
295 * Static attribute for quotes.
296 */
b.janani1fef2732016-03-04 12:29:05 +0530297 public static final String QUOTES = "\"";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530298
299 /**
300 * Static attribute for ampersand.
301 */
b.janani1fef2732016-03-04 12:29:05 +0530302 public static final String AND = "&";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530303
304 /**
305 * Static attribute for comma.
306 */
b.janani1fef2732016-03-04 12:29:05 +0530307 public static final String COMMA = ",";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530308
309 /**
310 * Static attribute for add syntax.
311 */
b.janani1fef2732016-03-04 12:29:05 +0530312 public static final String ADD_STRING = "add";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530313
314 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530315 * Static attribute for from syntax.
316 */
317 public static final String FROM_STRING_METHOD_NAME = "fromString";
318
319 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530320 * Static attribute for check not null syntax.
321 */
b.janani1fef2732016-03-04 12:29:05 +0530322 public static final String CHECK_NOT_NULL_STRING = "checkNotNull";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530323
324 /**
325 * Static attribute for hash code syntax.
326 */
b.janani1fef2732016-03-04 12:29:05 +0530327 public static final String HASH_CODE_STRING = "hashCode";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530328
329 /**
330 * Static attribute for equals syntax.
331 */
b.janani1fef2732016-03-04 12:29:05 +0530332 public static final String EQUALS_STRING = "equals";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530333
334 /**
335 * Static attribute for object.
336 */
b.janani1fef2732016-03-04 12:29:05 +0530337 public static final String OBJECT_STRING = "Object";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530338
339 /**
340 * Static attribute for instance of syntax.
341 */
b.janani1fef2732016-03-04 12:29:05 +0530342 public static final String INSTANCE_OF = " instanceof ";
343
Bharat saraswal2f11f652016-03-25 18:19:46 +0530344 /**
345 * Static attribute for value syntax.
346 */
b.janani1fef2732016-03-04 12:29:05 +0530347 public static final String VALUE = "value";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530348
349 /**
Bharat saraswald72411a2016-04-19 01:00:16 +0530350 * Static attribute for enumValue syntax.
351 */
352 public static final String ENUM_VALUE = "enumValue";
353
354 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530355 * Static attribute for suffix s.
356 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530357 public static final String SUFFIX_S = "s";
b.janani1fef2732016-03-04 12:29:05 +0530358
Bharat saraswal2f11f652016-03-25 18:19:46 +0530359 /**
360 * Static attribute for if.
361 */
b.janani1fef2732016-03-04 12:29:05 +0530362 public static final String IF = "if";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530363
364 /**
365 * Static attribute for for.
366 */
b.janani1fef2732016-03-04 12:29:05 +0530367 public static final String FOR = "for";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530368
369 /**
370 * Static attribute for while.
371 */
b.janani1fef2732016-03-04 12:29:05 +0530372 public static final String WHILE = "while";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530373
374 /**
375 * Static attribute for of.
376 */
b.janani1fef2732016-03-04 12:29:05 +0530377 public static final String OF = "of";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530378
379 /**
380 * Static attribute for other.
381 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530382 public static final String OTHER = "other";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530383
384 /**
385 * Static attribute for obj syntax.
386 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530387 public static final String OBJ = "obj";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530388
389 /**
390 * Static attribute for hash syntax.
391 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530392 public static final String HASH = "hash";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530393
394 /**
395 * Static attribute for to syntax.
396 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530397 public static final String TO = "to";
b.janani1fef2732016-03-04 12:29:05 +0530398
Bharat saraswal2f11f652016-03-25 18:19:46 +0530399 /**
400 * Static attribute for true syntax.
401 */
b.janani1fef2732016-03-04 12:29:05 +0530402 public static final String TRUE = "true";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530403
404 /**
405 * Static attribute for false syntax.
406 */
b.janani1fef2732016-03-04 12:29:05 +0530407 public static final String FALSE = "false";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530408
409 /**
410 * Static attribute for org.
411 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530412 public static final String ORG = "org";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530413
414 /**
415 * Static attribute for temp.
416 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530417 public static final String TEMP = "temp";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530418
419 /**
420 * Static attribute for YANG file directory.
421 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530422 public static final String YANG_RESOURCES = "yang/resources";
Bharat saraswal708abc02016-02-12 20:48:30 +0530423
424 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530425 * Static attribute for diamond close bracket syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530426 */
427 public static final String DIAMOND_OPEN_BRACKET = "<";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530428
429 /**
430 * Static attribute for diamond close bracket syntax.
431 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530432 public static final String DIAMOND_CLOSE_BRACKET = ">";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530433
434 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530435 * Static attribute for exception syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530436 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530437 public static final String EXCEPTION = "Exception";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530438
439 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530440 * Static attribute for exception variable syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530441 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530442 public static final String EXCEPTION_VAR = "e";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530443
444 /**
445 * Static attribute for open parenthesis syntax.
446 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530447 public static final String OPEN_PARENTHESIS = "(";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530448
449 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530450 * Static attribute for clear syntax.
451 */
452 public static final String CLEAR = "clear";
453
454 /**
Bharat saraswalc0e04842016-05-12 13:16:57 +0530455 * Static attribute for switch syntax.
456 */
457 public static final String SWITCH = "switch";
458
459 /**
460 * Static attribute for case syntax.
461 */
462 public static final String CASE = "case";
463
464 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530465 * Static attribute for temp val syntax.
466 */
467 public static final String TMP_VAL = "tmpVal";
468
469 /**
470 * From string parameter name.
471 */
472 public static final String FROM_STRING_PARAM_NAME = "valInString";
473
474 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530475 * Static attribute for close parenthesis syntax.
476 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530477 public static final String CLOSE_PARENTHESIS = ")";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530478
479 /**
480 * Static attribute for open curly bracket syntax.
481 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530482 public static final String OPEN_CURLY_BRACKET = "{";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530483
484 /**
485 * Static attribute for close curly bracket syntax.
486 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530487 public static final String CLOSE_CURLY_BRACKET = "}";
488
489 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530490 * Static attribute for getter method prefix.
Bharat saraswal708abc02016-02-12 20:48:30 +0530491 */
492 public static final String GET_METHOD_PREFIX = "get";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530493
494 /**
495 * Static attribute for setter method prefix.
496 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530497 public static final String SET_METHOD_PREFIX = "set";
498
499 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530500 * Static attribute for four space indentation.
Bharat saraswal708abc02016-02-12 20:48:30 +0530501 */
502 public static final String FOUR_SPACE_INDENTATION = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530503
504 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530505 * Static attribute for not syntax.
506 */
507 public static final String NOT = "!";
508
509 /**
510 * Static attribute for try syntax.
511 */
512 public static final String TRY = "try";
513
514 /**
515 * Static attribute for catch syntax.
516 */
517 public static final String CATCH = "catch";
518
519 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530520 * Static attribute for eight space indentation.
521 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530522 public static final String EIGHT_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + FOUR_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530523
524 /**
525 * Static attribute for twelve space indentation.
526 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530527 public static final String TWELVE_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530528
529 /**
530 * Static attribute for sixteen space indentation.
531 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530532 public static final String SIXTEEN_SPACE_INDENTATION = EIGHT_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
533
534 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530535 * Static attribute for generated code path.
Bharat saraswal708abc02016-02-12 20:48:30 +0530536 */
Bharat saraswal8f2a6c52016-03-09 18:34:56 +0530537 public static final String YANG_GEN_DIR = "src/main/java/";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530538
539 /**
540 * Static attribute for base package.
541 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530542 public static final String DEFAULT_BASE_PKG = "org.onosproject.yang.gen";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530543
544 /**
545 * Static attribute for YANG date prefix.
546 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530547 public static final String REVISION_PREFIX = "rev";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530548
549 /**
janani bde4ffab2016-04-15 16:18:30 +0530550 * Static attribute for YANG automatic prefix for identifiers with keywords and beginning with digits.
551 */
552 public static final String YANG_AUTO_PREFIX = "yangAutoPrefix";
553
554 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530555 * Static attribute for YANG version perifx.
556 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530557 public static final String VERSION_PREFIX = "v";
558
559 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530560 * Static attribute for private modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530561 */
562 public static final String PRIVATE = "private";
Bharat saraswal708abc02016-02-12 20:48:30 +0530563
564 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530565 * Static attribute for public modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530566 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530567 public static final String PUBLIC = "public";
568
569 /**
570 * Static attribute for protected modifier.
571 */
572 public static final String PROTECTED = "protected";
573
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530574 /**
575 * Void java type.
576 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530577 public static final String VOID = "void";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530578
579 /**
580 * String built in java type.
581 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530582 public static final String STRING_DATA_TYPE = "String";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530583
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530584 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530585 * Java.lang.* packages.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530586 */
587 public static final String JAVA_LANG = "java.lang";
588
589 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530590 * Java.math.* packages.
591 */
592 public static final String JAVA_MATH = "java.math";
593
594 /**
595 * Boolean built in java type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530596 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530597 public static final String BOOLEAN_DATA_TYPE = "boolean";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530598
599 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530600 * BigInteger built in java type.
601 */
602 public static final String BIG_INTEGER = "BigInteger";
603
604 /**
605 * Byte java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530606 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530607 public static final String BYTE = "byte";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530608
609 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530610 * Short java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530611 */
612 public static final String SHORT = "short";
613
614 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530615 * Int java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530616 */
617 public static final String INT = "int";
618
619 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530620 * Long java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530621 */
622 public static final String LONG = "long";
623
624 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530625 * Float java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530626 */
627 public static final String FLOAT = "float";
628
629 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530630 * Double 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 DOUBLE = "double";
633
634 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530635 * Boolean built in java wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530636 */
637 public static final String BOOLEAN_WRAPPER = "Boolean";
638
639 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530640 * Byte java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530641 */
642 public static final String BYTE_WRAPPER = "Byte";
643
644 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530645 * Short java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530646 */
647 public static final String SHORT_WRAPPER = "Short";
648
649 /**
650 * Integer java built in wrapper type.
651 */
652 public static final String INTEGER_WRAPPER = "Integer";
653
654 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530655 * Long java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530656 */
657 public static final String LONG_WRAPPER = "Long";
658
659 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530660 * YangUint64 java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530661 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530662 public static final String YANG_UINT64 = "YangUint64";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530663
664 /**
Bharat saraswale2d51d62016-03-23 19:40:35 +0530665 * 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 +0530666 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530667 public static final List<String> JAVA_KEY_WORDS = Arrays.asList(
668 "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue",
669 "default", "do", "double", "else", "extends", "false", "final", "finally", "float", "for", "goto", "if",
670 "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "null", "package",
671 "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch",
672 "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while");
b.janani1fef2732016-03-04 12:29:05 +0530673
674 /**
janani bde4ffab2016-04-15 16:18:30 +0530675 * Static attribute for regex for all the special characters.
b.janani1fef2732016-03-04 12:29:05 +0530676 */
janani bde4ffab2016-04-15 16:18:30 +0530677 public static final String REGEX_WITH_ALL_SPECIAL_CHAR = "\\p{Punct}+";
678
679 /**
680 * Static attribute for regex for three special characters used in identifier.
681 */
682 public static final String REGEX_FOR_IDENTIFIER_SPECIAL_CHAR = "[. _ -]+";
683
684 /**
685 * Static attribute for regex for period.
686 */
687 public static final String REGEX_FOR_PERIOD = "[.]";
688
689 /**
690 * Static attribute for regex for underscore.
691 */
692 public static final String REGEX_FOR_UNDERSCORE = "[_]";
693
694 /**
695 * Static attribute for regex for hyphen.
696 */
697 public static final String REGEX_FOR_HYPHEN = "[-]";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530698
699 /**
700 * Static attribute for regex for digits.
701 */
b.janani1fef2732016-03-04 12:29:05 +0530702 public static final String REGEX_FOR_FIRST_DIGIT = "\\d.*";
703
704 /**
janani b4a6711a2016-05-17 13:12:22 +0530705 * Static attribute for regex with digits.
706 */
707 public static final String REGEX_WITH_DIGITS = "(?=\\d+)";
708
709 /**
janani bde4ffab2016-04-15 16:18:30 +0530710 * Static attribute for regex for single letter.
711 */
712 public static final String REGEX_FOR_SINGLE_LETTER = "[a-zA-Z]";
713
714 /**
715 * Static attribute for regex for digits with single letter.
716 */
717 public static final String REGEX_FOR_DIGITS_WITH_SINGLE_LETTER = "[0-9]+[a-zA-Z]";
718
719 /**
janani b4a6711a2016-05-17 13:12:22 +0530720 * Static attribute for regex with uppercase.
721 */
722 public static final String REGEX_WITH_UPPERCASE = "(?=\\p{Upper})";
723
724 /**
725 * Static attribute for regex for single capital case letter.
726 */
727 public static final String REGEX_WITH_SINGLE_CAPITAL_CASE = "[A-Z]";
728
729 /**
730 * Static attribute for regex for capital case letter with any number of digits and small case letters.
731 */
732 public static final String REGEX_WITH_SINGLE_CAPITAL_CASE_AND_DIGITS_SMALL_CASES = "[A-Z][0-9a-z]+";
733
734 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530735 * Static attribute for class syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530736 */
737 public static final String CLASS = "class";
Bharat saraswal708abc02016-02-12 20:48:30 +0530738
739 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530740 * Static attribute for builder syntax.
741 */
742 public static final String BUILDER = "Builder";
743
744 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530745 * Static attribute for manager syntax.
746 */
747 public static final String MANAGER = "Manager";
748
749 /**
750 * Static attribute for service syntax.
751 */
752 public static final String SERVICE = "Service";
753
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530754 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530755 * Static attribute for interface syntax.
756 */
757 public static final String INTERFACE = "interface";
758
759 /**
760 * Static attribute for enum syntax.
761 */
762 public static final String ENUM = "enum";
763
764 /**
765 * Static attribute for static syntax.
766 */
767 public static final String STATIC = "static";
768
769 /**
770 * Static attribute for final syntax.
771 */
772 public static final String FINAL = "final";
773
774 /**
775 * Static attribute for package syntax.
776 */
777 public static final String PACKAGE = "package";
778
779 /**
780 * Static attribute for import syntax.
781 */
782 public static final String IMPORT = "import ";
783
784 /**
785 * Static attribute for null syntax.
786 */
787 public static final String NULL = "null";
788
789 /**
790 * Static attribute for return syntax.
791 */
792 public static final String RETURN = "return";
793
794 /**
795 * Static attribute for java new syntax.
796 */
797 public static final String NEW = "new";
798
799 /**
800 * Static attribute for this syntax.
801 */
802 public static final String THIS = "this";
803
804 /**
805 * Static attribute for implements syntax.
806 */
807 public static final String IMPLEMENTS = "implements";
808
809 /**
810 * Static attribute for extends syntax.
811 */
812 public static final String EXTEND = "extends";
813
814 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530815 * Static attribute for service interface suffix syntax.
816 */
817 public static final String SERVICE_METHOD_STRING = "Service";
818
819 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530820 * For event file generation.
821 */
822 public static final String EVENT_STRING = "Event";
823
824 /**
825 * For event listener file generation.
826 */
827 public static final String EVENT_LISTENER_STRING = "Listener";
828
829 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530830 * Static attribute for impl syntax.
831 */
832 public static final String IMPL = "Impl";
833
834 /**
835 * Static attribute for build method syntax.
836 */
837 public static final String BUILD = "build";
838
839 /**
840 * Static attribute for object.
841 */
842 public static final String OBJECT = "Object";
843
844 /**
845 * Static attribute for override annotation.
846 */
847 public static final String OVERRIDE = "@Override";
848
849 /**
850 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530851 */
b.janani1fef2732016-03-04 12:29:05 +0530852 public static final String COLLECTION_IMPORTS = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530853
854 /**
855 * Static attribute for more object import package.
856 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530857 public static final String GOOGLE_MORE_OBJECT_IMPORT_PKG = "com.google.common.base";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530858
859 /**
860 * Static attribute for more object import class.
861 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530862 public static final String GOOGLE_MORE_OBJECT_IMPORT_CLASS = "MoreObjects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530863
864 /**
865 * Static attribute for to string method.
866 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530867 public static final String GOOGLE_MORE_OBJECT_METHOD_STRING = " MoreObjects.toStringHelper(getClass())";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530868
869 /**
870 * Static attribute for java utilities import package.
871 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530872 public static final String JAVA_UTIL_OBJECTS_IMPORT_PKG = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530873
874 /**
875 * Static attribute for java utilities objects import class.
876 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530877 public static final String JAVA_UTIL_OBJECTS_IMPORT_CLASS = "Objects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530878
879 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530880 * Static attribute for AugmentationHolder class import package.
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530881 */
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530882 public static final String PROVIDED_AUGMENTATION_CLASS_IMPORT_PKG =
883 "org.onosproject.yangutils.translator.tojava";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530884
885 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530886 * Static attribute for AugmentationHolder class import class.
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530887 */
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530888 public static final String AUGMENTATION_HOLDER_CLASS_IMPORT_CLASS = "AugmentationHolder;\n";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530889
890 /**
891 * Static attribute for AugmentedInfo class import package.
892 */
893 public static final String AUGMENTED_INFO_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
894
895 /**
896 * Static attribute for AugmentedInfo class import class.
897 */
898 public static final String AUGMENTED_INFO_CLASS_IMPORT_CLASS = "AugmentedInfo;\n";
899
900 /**
901 * Static attribute for augmentation class.
902 */
903 public static final String AUGMENTATION = "Augmentation";
904
905 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530906 * Static attribute for AugmentationHolder class.
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530907 */
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530908 public static final String AUGMENTATION_HOLDER = "AugmentationHolder";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530909
910 /**
911 * Static attribute for AugmentedInfo class.
912 */
913 public static final String AUGMENTED_INFO = "AugmentedInfo";
914
915 /**
Bharat saraswalab4c6ba2016-05-17 14:19:38 +0530916 * Static attribute for augmentable.
917 */
918 public static final String AUGMENTABLE = "Augmentable";
919 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530920 * Static attribute for list.
921 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530922 public static final String LIST = "List";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530923
924 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530925 * Static attribute for array list.
926 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530927 public static final String ARRAY_LIST = "ArrayList";
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530928
929 /**
Bharat saraswalc0e04842016-05-12 13:16:57 +0530930 * Comment to be added for autogenerated impl methods.
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530931 */
932 public static final String YANG_UTILS_TODO = "//TODO: YANG utils generated code";
933
934 /**
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530935 * Creates an instance of util constants.
936 */
937 private UtilConstants() {
938 }
Bharat saraswal708abc02016-02-12 20:48:30 +0530939}