blob: b28bc66791abfe42454c96629df382bc1798a2ea [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 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530245 * Static attribute for input string.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530246 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530247 public static final String INPUT = "input";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530248
249 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530250 * Static attribute for output variable of rpc.
251 */
252 public static final String RPC_INPUT_VAR_NAME = "inputVar";
253
254 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530255 * Static attribute for new line.
256 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530257 public static final String EQUAL = "=";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530258
259 /**
260 * Static attribute for slash syntax.
261 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530262 public static final String SLASH = File.separator;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530263
264 /**
265 * Static attribute for add syntax.
266 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530267 public static final String ADD = "+";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530268
269 /**
270 * Static attribute for asterisk.
271 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530272 public static final String ASTERISK = "*";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530273
274 /**
275 * Static attribute for at.
276 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530277 public static final String AT = "@";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530278
279 /**
280 * Static attribute for quotes.
281 */
b.janani1fef2732016-03-04 12:29:05 +0530282 public static final String QUOTES = "\"";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530283
284 /**
285 * Static attribute for ampersand.
286 */
b.janani1fef2732016-03-04 12:29:05 +0530287 public static final String AND = "&";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530288
289 /**
290 * Static attribute for comma.
291 */
b.janani1fef2732016-03-04 12:29:05 +0530292 public static final String COMMA = ",";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530293
294 /**
295 * Static attribute for add syntax.
296 */
b.janani1fef2732016-03-04 12:29:05 +0530297 public static final String ADD_STRING = "add";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530298
299 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530300 * Static attribute for from syntax.
301 */
302 public static final String FROM_STRING_METHOD_NAME = "fromString";
303
304 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530305 * Static attribute for check not null syntax.
306 */
b.janani1fef2732016-03-04 12:29:05 +0530307 public static final String CHECK_NOT_NULL_STRING = "checkNotNull";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530308
309 /**
310 * Static attribute for hash code syntax.
311 */
b.janani1fef2732016-03-04 12:29:05 +0530312 public static final String HASH_CODE_STRING = "hashCode";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530313
314 /**
315 * Static attribute for equals syntax.
316 */
b.janani1fef2732016-03-04 12:29:05 +0530317 public static final String EQUALS_STRING = "equals";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530318
319 /**
320 * Static attribute for object.
321 */
b.janani1fef2732016-03-04 12:29:05 +0530322 public static final String OBJECT_STRING = "Object";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530323
324 /**
325 * Static attribute for instance of syntax.
326 */
b.janani1fef2732016-03-04 12:29:05 +0530327 public static final String INSTANCE_OF = " instanceof ";
328
Bharat saraswal2f11f652016-03-25 18:19:46 +0530329 /**
330 * Static attribute for value syntax.
331 */
b.janani1fef2732016-03-04 12:29:05 +0530332 public static final String VALUE = "value";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530333
334 /**
Bharat saraswald72411a2016-04-19 01:00:16 +0530335 * Static attribute for enumValue syntax.
336 */
337 public static final String ENUM_VALUE = "enumValue";
338
339 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530340 * Static attribute for suffix s.
341 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530342 public static final String SUFFIX_S = "s";
b.janani1fef2732016-03-04 12:29:05 +0530343
Bharat saraswal2f11f652016-03-25 18:19:46 +0530344 /**
345 * Static attribute for if.
346 */
b.janani1fef2732016-03-04 12:29:05 +0530347 public static final String IF = "if";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530348
349 /**
350 * Static attribute for for.
351 */
b.janani1fef2732016-03-04 12:29:05 +0530352 public static final String FOR = "for";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530353
354 /**
355 * Static attribute for while.
356 */
b.janani1fef2732016-03-04 12:29:05 +0530357 public static final String WHILE = "while";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530358
359 /**
360 * Static attribute for of.
361 */
b.janani1fef2732016-03-04 12:29:05 +0530362 public static final String OF = "of";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530363
364 /**
365 * Static attribute for other.
366 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530367 public static final String OTHER = "other";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530368
369 /**
370 * Static attribute for obj syntax.
371 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530372 public static final String OBJ = "obj";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530373
374 /**
375 * Static attribute for hash syntax.
376 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530377 public static final String HASH = "hash";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530378
379 /**
380 * Static attribute for to syntax.
381 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530382 public static final String TO = "to";
b.janani1fef2732016-03-04 12:29:05 +0530383
Bharat saraswal2f11f652016-03-25 18:19:46 +0530384 /**
385 * Static attribute for true syntax.
386 */
b.janani1fef2732016-03-04 12:29:05 +0530387 public static final String TRUE = "true";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530388
389 /**
390 * Static attribute for false syntax.
391 */
b.janani1fef2732016-03-04 12:29:05 +0530392 public static final String FALSE = "false";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530393
394 /**
395 * Static attribute for org.
396 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530397 public static final String ORG = "org";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530398
399 /**
400 * Static attribute for temp.
401 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530402 public static final String TEMP = "temp";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530403
404 /**
405 * Static attribute for YANG file directory.
406 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530407 public static final String YANG_RESOURCES = "yang/resources";
Bharat saraswal708abc02016-02-12 20:48:30 +0530408
409 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530410 * Static attribute for diamond close bracket syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530411 */
412 public static final String DIAMOND_OPEN_BRACKET = "<";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530413
414 /**
415 * Static attribute for diamond close bracket syntax.
416 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530417 public static final String DIAMOND_CLOSE_BRACKET = ">";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530418
419 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530420 * Static attribute for exception syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530421 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530422 public static final String EXCEPTION = "Exception";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530423
424 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530425 * Static attribute for exception variable syntax.
Bharat saraswal2f11f652016-03-25 18:19:46 +0530426 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530427 public static final String EXCEPTION_VAR = "e";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530428
429 /**
430 * Static attribute for open parenthesis syntax.
431 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530432 public static final String OPEN_PARENTHESIS = "(";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530433
434 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530435 * Static attribute for clear syntax.
436 */
437 public static final String CLEAR = "clear";
438
439 /**
Bharat saraswalc0e04842016-05-12 13:16:57 +0530440 * Static attribute for switch syntax.
441 */
442 public static final String SWITCH = "switch";
443
444 /**
445 * Static attribute for case syntax.
446 */
447 public static final String CASE = "case";
448
449 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530450 * Static attribute for temp val syntax.
451 */
452 public static final String TMP_VAL = "tmpVal";
453
454 /**
455 * From string parameter name.
456 */
457 public static final String FROM_STRING_PARAM_NAME = "valInString";
458
459 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530460 * Static attribute for close parenthesis syntax.
461 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530462 public static final String CLOSE_PARENTHESIS = ")";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530463
464 /**
465 * Static attribute for open curly bracket syntax.
466 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530467 public static final String OPEN_CURLY_BRACKET = "{";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530468
469 /**
470 * Static attribute for close curly bracket syntax.
471 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530472 public static final String CLOSE_CURLY_BRACKET = "}";
473
474 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530475 * Static attribute for getter method prefix.
Bharat saraswal708abc02016-02-12 20:48:30 +0530476 */
477 public static final String GET_METHOD_PREFIX = "get";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530478
479 /**
480 * Static attribute for setter method prefix.
481 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530482 public static final String SET_METHOD_PREFIX = "set";
483
484 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530485 * Static attribute for four space indentation.
Bharat saraswal708abc02016-02-12 20:48:30 +0530486 */
487 public static final String FOUR_SPACE_INDENTATION = " ";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530488
489 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530490 * Static attribute for not syntax.
491 */
492 public static final String NOT = "!";
493
494 /**
495 * Static attribute for try syntax.
496 */
497 public static final String TRY = "try";
498
499 /**
500 * Static attribute for catch syntax.
501 */
502 public static final String CATCH = "catch";
503
504 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530505 * Static attribute for eight space indentation.
506 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530507 public static final String EIGHT_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + FOUR_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530508
509 /**
510 * Static attribute for twelve space indentation.
511 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530512 public static final String TWELVE_SPACE_INDENTATION = FOUR_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
Bharat saraswal2f11f652016-03-25 18:19:46 +0530513
514 /**
515 * Static attribute for sixteen space indentation.
516 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530517 public static final String SIXTEEN_SPACE_INDENTATION = EIGHT_SPACE_INDENTATION + EIGHT_SPACE_INDENTATION;
518
519 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530520 * Static attribute for generated code path.
Bharat saraswal708abc02016-02-12 20:48:30 +0530521 */
Bharat saraswal8f2a6c52016-03-09 18:34:56 +0530522 public static final String YANG_GEN_DIR = "src/main/java/";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530523
524 /**
525 * Static attribute for base package.
526 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530527 public static final String DEFAULT_BASE_PKG = "org.onosproject.yang.gen";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530528
529 /**
530 * Static attribute for YANG date prefix.
531 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530532 public static final String REVISION_PREFIX = "rev";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530533
534 /**
janani bde4ffab2016-04-15 16:18:30 +0530535 * Static attribute for YANG automatic prefix for identifiers with keywords and beginning with digits.
536 */
537 public static final String YANG_AUTO_PREFIX = "yangAutoPrefix";
538
539 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530540 * Static attribute for YANG version perifx.
541 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530542 public static final String VERSION_PREFIX = "v";
543
544 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530545 * Static attribute for private modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530546 */
547 public static final String PRIVATE = "private";
Bharat saraswal708abc02016-02-12 20:48:30 +0530548
549 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530550 * Static attribute for public modifier.
Bharat saraswal708abc02016-02-12 20:48:30 +0530551 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530552 public static final String PUBLIC = "public";
553
554 /**
555 * Static attribute for protected modifier.
556 */
557 public static final String PROTECTED = "protected";
558
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530559 /**
560 * Void java type.
561 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530562 public static final String VOID = "void";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530563
564 /**
565 * String built in java type.
566 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530567 public static final String STRING_DATA_TYPE = "String";
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530568
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530569 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530570 * Java.lang.* packages.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530571 */
572 public static final String JAVA_LANG = "java.lang";
573
574 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530575 * Java.math.* packages.
576 */
577 public static final String JAVA_MATH = "java.math";
578
579 /**
580 * Boolean built in java type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530581 */
Bharat saraswale2d51d62016-03-23 19:40:35 +0530582 public static final String BOOLEAN_DATA_TYPE = "boolean";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530583
584 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530585 * BigInteger built in java type.
586 */
587 public static final String BIG_INTEGER = "BigInteger";
588
589 /**
590 * Byte java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530591 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530592 public static final String BYTE = "byte";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530593
594 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530595 * Short java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530596 */
597 public static final String SHORT = "short";
598
599 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530600 * Int java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530601 */
602 public static final String INT = "int";
603
604 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530605 * Long java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530606 */
607 public static final String LONG = "long";
608
609 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530610 * Float java built in type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530611 */
612 public static final String FLOAT = "float";
613
614 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530615 * Double 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 DOUBLE = "double";
618
619 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530620 * Boolean built in java wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530621 */
622 public static final String BOOLEAN_WRAPPER = "Boolean";
623
624 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530625 * Byte java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530626 */
627 public static final String BYTE_WRAPPER = "Byte";
628
629 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530630 * Short java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530631 */
632 public static final String SHORT_WRAPPER = "Short";
633
634 /**
635 * Integer java built in wrapper type.
636 */
637 public static final String INTEGER_WRAPPER = "Integer";
638
639 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530640 * Long java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530641 */
642 public static final String LONG_WRAPPER = "Long";
643
644 /**
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530645 * YangUint64 java built in wrapper type.
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530646 */
Gaurav Agrawal338735b2016-04-18 18:53:11 +0530647 public static final String YANG_UINT64 = "YangUint64";
Vinod Kumar Sc4216002016-03-03 19:55:30 +0530648
649 /**
Bharat saraswale2d51d62016-03-23 19:40:35 +0530650 * 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 +0530651 */
Bharat saraswal2f11f652016-03-25 18:19:46 +0530652 public static final List<String> JAVA_KEY_WORDS = Arrays.asList(
653 "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue",
654 "default", "do", "double", "else", "extends", "false", "final", "finally", "float", "for", "goto", "if",
655 "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "null", "package",
656 "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch",
657 "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while");
b.janani1fef2732016-03-04 12:29:05 +0530658
659 /**
janani bde4ffab2016-04-15 16:18:30 +0530660 * Static attribute for regex for all the special characters.
b.janani1fef2732016-03-04 12:29:05 +0530661 */
janani bde4ffab2016-04-15 16:18:30 +0530662 public static final String REGEX_WITH_ALL_SPECIAL_CHAR = "\\p{Punct}+";
663
664 /**
665 * Static attribute for regex for three special characters used in identifier.
666 */
667 public static final String REGEX_FOR_IDENTIFIER_SPECIAL_CHAR = "[. _ -]+";
668
669 /**
670 * Static attribute for regex for period.
671 */
672 public static final String REGEX_FOR_PERIOD = "[.]";
673
674 /**
675 * Static attribute for regex for underscore.
676 */
677 public static final String REGEX_FOR_UNDERSCORE = "[_]";
678
679 /**
680 * Static attribute for regex for hyphen.
681 */
682 public static final String REGEX_FOR_HYPHEN = "[-]";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530683
684 /**
685 * Static attribute for regex for digits.
686 */
b.janani1fef2732016-03-04 12:29:05 +0530687 public static final String REGEX_FOR_FIRST_DIGIT = "\\d.*";
688
689 /**
janani b4a6711a2016-05-17 13:12:22 +0530690 * Static attribute for regex with digits.
691 */
692 public static final String REGEX_WITH_DIGITS = "(?=\\d+)";
693
694 /**
janani bde4ffab2016-04-15 16:18:30 +0530695 * Static attribute for regex for single letter.
696 */
697 public static final String REGEX_FOR_SINGLE_LETTER = "[a-zA-Z]";
698
699 /**
700 * Static attribute for regex for digits with single letter.
701 */
702 public static final String REGEX_FOR_DIGITS_WITH_SINGLE_LETTER = "[0-9]+[a-zA-Z]";
703
704 /**
janani b4a6711a2016-05-17 13:12:22 +0530705 * Static attribute for regex with uppercase.
706 */
707 public static final String REGEX_WITH_UPPERCASE = "(?=\\p{Upper})";
708
709 /**
710 * Static attribute for regex for single capital case letter.
711 */
712 public static final String REGEX_WITH_SINGLE_CAPITAL_CASE = "[A-Z]";
713
714 /**
715 * Static attribute for regex for capital case letter with any number of digits and small case letters.
716 */
717 public static final String REGEX_WITH_SINGLE_CAPITAL_CASE_AND_DIGITS_SMALL_CASES = "[A-Z][0-9a-z]+";
718
719 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530720 * Static attribute for class syntax.
Bharat saraswal708abc02016-02-12 20:48:30 +0530721 */
722 public static final String CLASS = "class";
Bharat saraswal708abc02016-02-12 20:48:30 +0530723
724 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530725 * Static attribute for builder syntax.
726 */
727 public static final String BUILDER = "Builder";
728
729 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530730 * Static attribute for manager syntax.
731 */
732 public static final String MANAGER = "Manager";
733
734 /**
735 * Static attribute for service syntax.
736 */
737 public static final String SERVICE = "Service";
738
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530739 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530740 * Static attribute for interface syntax.
741 */
742 public static final String INTERFACE = "interface";
743
744 /**
745 * Static attribute for enum syntax.
746 */
747 public static final String ENUM = "enum";
748
749 /**
750 * Static attribute for static syntax.
751 */
752 public static final String STATIC = "static";
753
754 /**
755 * Static attribute for final syntax.
756 */
757 public static final String FINAL = "final";
758
759 /**
760 * Static attribute for package syntax.
761 */
762 public static final String PACKAGE = "package";
763
764 /**
765 * Static attribute for import syntax.
766 */
767 public static final String IMPORT = "import ";
768
769 /**
770 * Static attribute for null syntax.
771 */
772 public static final String NULL = "null";
773
774 /**
775 * Static attribute for return syntax.
776 */
777 public static final String RETURN = "return";
778
779 /**
780 * Static attribute for java new syntax.
781 */
782 public static final String NEW = "new";
783
784 /**
785 * Static attribute for this syntax.
786 */
787 public static final String THIS = "this";
788
789 /**
790 * Static attribute for implements syntax.
791 */
792 public static final String IMPLEMENTS = "implements";
793
794 /**
795 * Static attribute for extends syntax.
796 */
797 public static final String EXTEND = "extends";
798
799 /**
Gaurav Agrawal56527662016-04-20 15:49:17 +0530800 * Static attribute for service interface suffix syntax.
801 */
802 public static final String SERVICE_METHOD_STRING = "Service";
803
804 /**
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530805 * For event file generation.
806 */
807 public static final String EVENT_STRING = "Event";
808
809 /**
810 * For event listener file generation.
811 */
812 public static final String EVENT_LISTENER_STRING = "Listener";
813
814 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530815 * Static attribute for impl syntax.
816 */
817 public static final String IMPL = "Impl";
818
819 /**
820 * Static attribute for build method syntax.
821 */
822 public static final String BUILD = "build";
823
824 /**
825 * Static attribute for object.
826 */
827 public static final String OBJECT = "Object";
828
829 /**
830 * Static attribute for override annotation.
831 */
832 public static final String OVERRIDE = "@Override";
833
834 /**
835 * Static attribute for new line.
Bharat saraswal708abc02016-02-12 20:48:30 +0530836 */
b.janani1fef2732016-03-04 12:29:05 +0530837 public static final String COLLECTION_IMPORTS = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530838
839 /**
840 * Static attribute for more object import package.
841 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530842 public static final String GOOGLE_MORE_OBJECT_IMPORT_PKG = "com.google.common.base";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530843
844 /**
845 * Static attribute for more object import class.
846 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530847 public static final String GOOGLE_MORE_OBJECT_IMPORT_CLASS = "MoreObjects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530848
849 /**
850 * Static attribute for to string method.
851 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530852 public static final String GOOGLE_MORE_OBJECT_METHOD_STRING = " MoreObjects.toStringHelper(getClass())";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530853
854 /**
855 * Static attribute for java utilities import package.
856 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530857 public static final String JAVA_UTIL_OBJECTS_IMPORT_PKG = "java.util";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530858
859 /**
860 * Static attribute for java utilities objects import class.
861 */
Vinod Kumar S38046502016-03-23 15:30:27 +0530862 public static final String JAVA_UTIL_OBJECTS_IMPORT_CLASS = "Objects;\n";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530863
864 /**
Bharat saraswalcc1cdab2016-04-16 02:28:25 +0530865 * Static attribute for HasAugmentation class import package.
866 */
867 public static final String HAS_AUGMENTATION_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
868
869 /**
870 * Static attribute for HasAugmentation class import class.
871 */
872 public static final String HAS_AUGMENTATION_CLASS_IMPORT_CLASS = "HasAugmentation;\n";
873
874 /**
875 * Static attribute for AugmentedInfo class import package.
876 */
877 public static final String AUGMENTED_INFO_CLASS_IMPORT_PKG = "org.onosproject.yangutils.translator.tojava";
878
879 /**
880 * Static attribute for AugmentedInfo class import class.
881 */
882 public static final String AUGMENTED_INFO_CLASS_IMPORT_CLASS = "AugmentedInfo;\n";
883
884 /**
885 * Static attribute for augmentation class.
886 */
887 public static final String AUGMENTATION = "Augmentation";
888
889 /**
890 * Static attribute for HasAugmentation class.
891 */
892 public static final String HAS_AUGMENTATION = "HasAugmentation";
893
894 /**
895 * Static attribute for AugmentedInfo class.
896 */
897 public static final String AUGMENTED_INFO = "AugmentedInfo";
898
899 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530900 * Static attribute for list.
901 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530902 public static final String LIST = "List";
Bharat saraswal2f11f652016-03-25 18:19:46 +0530903
904 /**
Bharat saraswal2f11f652016-03-25 18:19:46 +0530905 * Static attribute for array list.
906 */
Bharat saraswal708abc02016-02-12 20:48:30 +0530907 public static final String ARRAY_LIST = "ArrayList";
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530908
909 /**
Bharat saraswalc0e04842016-05-12 13:16:57 +0530910 * Comment to be added for autogenerated impl methods.
VinodKumarS-Huaweicb3a1f52016-05-10 17:58:57 +0530911 */
912 public static final String YANG_UTILS_TODO = "//TODO: YANG utils generated code";
913
914 /**
Vidyashree Rama7142d9c2016-04-26 15:06:06 +0530915 * Creates an instance of util constants.
916 */
917 private UtilConstants() {
918 }
Bharat saraswal708abc02016-02-12 20:48:30 +0530919}