Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 0f7908b | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 3 | * |
| 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 | |
| 17 | package org.onosproject.yangutils.translator.tojava.utils; |
| 18 | |
| 19 | import org.onosproject.yangutils.datamodel.YangDataTypes; |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 20 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; |
| 21 | import org.onosproject.yangutils.datamodel.YangNode; |
Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 22 | import org.onosproject.yangutils.datamodel.YangType; |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 23 | import org.onosproject.yangutils.datamodel.YangTypeDef; |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 24 | import org.onosproject.yangutils.datamodel.YangUnion; |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 25 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
| 26 | import org.onosproject.yangutils.translator.tojava.HasJavaFileInfo; |
| 27 | import org.onosproject.yangutils.translator.tojava.JavaFileInfo; |
| 28 | import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeDef; |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 29 | import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaUnion; |
Bharat saraswal | 84366c5 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 30 | |
Bharat saraswal | 84366c5 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 31 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; |
| 32 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase; |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 33 | import static org.onosproject.yangutils.utils.UtilConstants.BIG_INTEGER; |
Bharat saraswal | 84366c5 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 34 | import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_DATA_TYPE; |
| 35 | import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_WRAPPER; |
| 36 | import static org.onosproject.yangutils.utils.UtilConstants.BYTE; |
| 37 | import static org.onosproject.yangutils.utils.UtilConstants.BYTE_WRAPPER; |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 38 | import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING; |
Bharat saraswal | 84366c5 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 39 | import static org.onosproject.yangutils.utils.UtilConstants.INT; |
| 40 | import static org.onosproject.yangutils.utils.UtilConstants.INTEGER_WRAPPER; |
| 41 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_LANG; |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 42 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_MATH; |
Bharat saraswal | 84366c5 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 43 | import static org.onosproject.yangutils.utils.UtilConstants.LONG; |
| 44 | import static org.onosproject.yangutils.utils.UtilConstants.LONG_WRAPPER; |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 45 | import static org.onosproject.yangutils.utils.UtilConstants.NEW; |
| 46 | import static org.onosproject.yangutils.utils.UtilConstants.OF; |
| 47 | import static org.onosproject.yangutils.utils.UtilConstants.PARSE_BYTE; |
| 48 | import static org.onosproject.yangutils.utils.UtilConstants.PARSE_INT; |
| 49 | import static org.onosproject.yangutils.utils.UtilConstants.PARSE_LONG; |
| 50 | import static org.onosproject.yangutils.utils.UtilConstants.PARSE_SHORT; |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 51 | import static org.onosproject.yangutils.utils.UtilConstants.PERIOD; |
Bharat saraswal | 84366c5 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 52 | import static org.onosproject.yangutils.utils.UtilConstants.SHORT; |
| 53 | import static org.onosproject.yangutils.utils.UtilConstants.SHORT_WRAPPER; |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 54 | import static org.onosproject.yangutils.utils.UtilConstants.SPACE; |
Bharat saraswal | 84366c5 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 55 | import static org.onosproject.yangutils.utils.UtilConstants.STRING_DATA_TYPE; |
Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 56 | |
| 57 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 58 | * Represents java data types info corresponding to YANG type. |
Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 59 | */ |
| 60 | public final class AttributesJavaDataType { |
| 61 | |
| 62 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 63 | * Creates an instance of attribute java data type. |
Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 64 | */ |
| 65 | private AttributesJavaDataType() { |
| 66 | } |
| 67 | |
| 68 | /** |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 69 | * Returns java type. |
Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 70 | * |
| 71 | * @param yangType YANG type |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 72 | * @return java type |
Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 73 | */ |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 74 | public static String getJavaDataType(YangType<?> yangType) { |
Bharat saraswal | 84366c5 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 75 | |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 76 | YangDataTypes type = yangType.getDataType(); |
Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 77 | |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 78 | switch (type) { |
| 79 | case INT8: |
| 80 | return BYTE; |
| 81 | case INT16: |
| 82 | return SHORT; |
| 83 | case INT32: |
| 84 | return INT; |
| 85 | case INT64: |
| 86 | return LONG; |
| 87 | case UINT8: |
| 88 | return SHORT; |
| 89 | case UINT16: |
| 90 | return INT; |
| 91 | case UINT32: |
| 92 | return LONG; |
| 93 | case UINT64: |
| 94 | return BIG_INTEGER; |
| 95 | case DECIMAL64: |
| 96 | //TODO: DECIMAL64. |
| 97 | case STRING: |
| 98 | return STRING_DATA_TYPE; |
| 99 | case BOOLEAN: |
| 100 | return BOOLEAN_DATA_TYPE; |
| 101 | default: |
| 102 | throw new TranslatorException("given data type is not supported."); |
Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 103 | } |
Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 104 | } |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 105 | |
| 106 | /** |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 107 | * Returns from string method parsed string. |
| 108 | * |
| 109 | * @param targetDataType target data type |
| 110 | * @param yangType YANG type |
| 111 | * @return parsed string |
| 112 | */ |
| 113 | public static String getParseFromStringMethod(String targetDataType, YangType<?> yangType) { |
| 114 | |
| 115 | YangDataTypes type = yangType.getDataType(); |
| 116 | |
| 117 | switch (type) { |
| 118 | case INT8: |
| 119 | return BYTE_WRAPPER + PERIOD + PARSE_BYTE; |
| 120 | case INT16: |
| 121 | return SHORT_WRAPPER + PERIOD + PARSE_SHORT; |
| 122 | case INT32: |
| 123 | return INTEGER_WRAPPER + PERIOD + PARSE_INT; |
| 124 | case INT64: |
| 125 | return LONG_WRAPPER + PERIOD + PARSE_LONG; |
| 126 | case UINT8: |
| 127 | return SHORT_WRAPPER + PERIOD + PARSE_SHORT; |
| 128 | case UINT16: |
| 129 | return INTEGER_WRAPPER + PERIOD + PARSE_INT; |
| 130 | case UINT32: |
| 131 | return LONG_WRAPPER + PERIOD + PARSE_LONG; |
| 132 | case UINT64: |
| 133 | return NEW + SPACE + BIG_INTEGER; |
| 134 | case DECIMAL64: |
| 135 | //TODO: DECIMAL64. |
| 136 | case STRING: |
| 137 | return EMPTY_STRING; |
| 138 | case BOOLEAN: |
| 139 | return BOOLEAN_DATA_TYPE; |
| 140 | case ENUMERATION: |
| 141 | //TODO:ENUMERATION. |
| 142 | case BITS: |
| 143 | //TODO:BITS |
| 144 | case BINARY: |
| 145 | //TODO:BINARY |
| 146 | case DERIVED: |
| 147 | return targetDataType + PERIOD + OF; |
| 148 | default: |
| 149 | throw new TranslatorException("given data type is not supported."); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | /** |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 154 | * Returns java import class. |
| 155 | * |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 156 | * @param yangType YANG type |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 157 | * @param isListAttr if the attribute need to be a list |
| 158 | * @return java import class |
| 159 | */ |
| 160 | public static String getJavaImportClass(YangType<?> yangType, boolean isListAttr) { |
Bharat saraswal | 84366c5 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 161 | |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 162 | YangDataTypes type = yangType.getDataType(); |
| 163 | |
| 164 | if (isListAttr) { |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 165 | switch (type) { |
| 166 | case INT8: |
| 167 | return BYTE_WRAPPER; |
| 168 | case INT16: |
| 169 | return SHORT_WRAPPER; |
| 170 | case INT32: |
| 171 | return INTEGER_WRAPPER; |
| 172 | case INT64: |
| 173 | return LONG_WRAPPER; |
| 174 | case UINT8: |
| 175 | return SHORT_WRAPPER; |
| 176 | case UINT16: |
| 177 | return INTEGER_WRAPPER; |
| 178 | case UINT32: |
| 179 | return LONG_WRAPPER; |
| 180 | case UINT64: |
| 181 | return BIG_INTEGER; |
| 182 | case DECIMAL64: |
| 183 | //TODO: DECIMAL64. |
| 184 | case STRING: |
| 185 | return STRING_DATA_TYPE; |
| 186 | case BOOLEAN: |
| 187 | return BOOLEAN_WRAPPER; |
| 188 | case ENUMERATION: |
| 189 | //TODO: ENUMERATION. |
| 190 | case BITS: |
| 191 | //TODO:BITS |
| 192 | case BINARY: |
| 193 | //TODO:BINARY |
| 194 | case LEAFREF: |
| 195 | //TODO:LEAFREF |
| 196 | case IDENTITYREF: |
| 197 | //TODO:IDENTITYREF |
| 198 | case EMPTY: |
| 199 | return BOOLEAN_WRAPPER; |
| 200 | case UNION: |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 201 | return getCaptialCase(getCamelCase(((YangJavaUnion) yangType.getDataTypeExtendedInfo()).getName(), |
| 202 | null)); |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 203 | case INSTANCE_IDENTIFIER: |
| 204 | //TODO:INSTANCE_IDENTIFIER |
| 205 | case DERIVED: |
| 206 | return getCaptialCase(getCamelCase(yangType.getDataTypeName(), null)); |
| 207 | default: |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 208 | return null; |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 209 | } |
| 210 | } else { |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 211 | switch (type) { |
| 212 | case UINT64: |
| 213 | return BIG_INTEGER; |
| 214 | case DECIMAL64: |
| 215 | //TODO: DECIMAL64. |
| 216 | case STRING: |
| 217 | return STRING_DATA_TYPE; |
| 218 | case ENUMERATION: |
| 219 | //TODO: ENUMERATION. |
| 220 | case BITS: |
| 221 | //TODO:BITS |
| 222 | case BINARY: |
| 223 | //TODO:BINARY |
| 224 | case LEAFREF: |
| 225 | //TODO:LEAFREF |
| 226 | case IDENTITYREF: |
| 227 | //TODO:IDENTITYREF |
| 228 | case EMPTY: |
| 229 | //TODO:EMPTY |
| 230 | case UNION: |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 231 | return getCaptialCase(getCamelCase(((YangJavaUnion) yangType.getDataTypeExtendedInfo()).getName(), |
| 232 | null)); |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 233 | case INSTANCE_IDENTIFIER: |
| 234 | //TODO:INSTANCE_IDENTIFIER |
| 235 | case DERIVED: |
| 236 | return getCaptialCase(getCamelCase(yangType.getDataTypeName(), null)); |
| 237 | default: |
| 238 | return null; |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 239 | } |
| 240 | } |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | /** |
| 244 | * Returns java import package. |
| 245 | * |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 246 | * @param yangType YANG type |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 247 | * @param isListAttr if the attribute is of list type |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 248 | * @param classInfo java import class info |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 249 | * @return java import package |
| 250 | */ |
Vinod Kumar S | 9f26ae5 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 251 | public static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr, String classInfo) { |
Bharat saraswal | 84366c5 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 252 | |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 253 | YangDataTypes type = yangType.getDataType(); |
| 254 | |
| 255 | if (isListAttr) { |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 256 | switch (type) { |
| 257 | case INT8: |
| 258 | case INT16: |
| 259 | case INT32: |
| 260 | case INT64: |
| 261 | case UINT8: |
| 262 | case UINT16: |
| 263 | case UINT32: |
| 264 | case STRING: |
| 265 | case BOOLEAN: |
| 266 | return JAVA_LANG; |
| 267 | case UINT64: |
| 268 | return JAVA_MATH; |
| 269 | case DECIMAL64: |
| 270 | //TODO: DECIMAL64. |
| 271 | case ENUMERATION: |
| 272 | //TODO: ENUMERATION. |
| 273 | case BITS: |
| 274 | //TODO:BITS |
| 275 | case BINARY: |
| 276 | //TODO:BINARY |
| 277 | case LEAFREF: |
| 278 | //TODO:LEAFREF |
| 279 | case IDENTITYREF: |
| 280 | //TODO:IDENTITYREF |
| 281 | case EMPTY: |
| 282 | //TODO:EMPTY |
| 283 | case UNION: |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 284 | return getUnionPackage(yangType); |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 285 | case INSTANCE_IDENTIFIER: |
| 286 | //TODO:INSTANCE_IDENTIFIER |
| 287 | case DERIVED: |
| 288 | return getTypDefsPackage(yangType); |
| 289 | default: |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 290 | return null; |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 291 | } |
| 292 | } else { |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 293 | switch (type) { |
| 294 | case UINT64: |
| 295 | //TODO: BIGINTEGER. |
| 296 | case DECIMAL64: |
| 297 | //TODO: DECIMAL64 |
| 298 | case STRING: |
| 299 | return JAVA_LANG; |
| 300 | case ENUMERATION: |
| 301 | //TODO: ENUMERATION. |
| 302 | case BITS: |
| 303 | //TODO:BITS |
| 304 | case BINARY: |
| 305 | //TODO:BINARY |
| 306 | case LEAFREF: |
| 307 | //TODO:LEAFREF |
| 308 | case IDENTITYREF: |
| 309 | //TODO:IDENTITYREF |
| 310 | case EMPTY: |
| 311 | //TODO:EMPTY |
| 312 | case UNION: |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 313 | return getUnionPackage(yangType); |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 314 | case INSTANCE_IDENTIFIER: |
| 315 | //TODO:INSTANCE_IDENTIFIER |
| 316 | case DERIVED: |
| 317 | return getTypDefsPackage(yangType); |
| 318 | default: |
| 319 | return null; |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 320 | } |
| 321 | } |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 322 | } |
| 323 | |
| 324 | /** |
| 325 | * Returns java package for typedef node. |
| 326 | * |
| 327 | * @param type YANG type |
| 328 | * @return java package for typedef node |
| 329 | */ |
| 330 | private static String getTypDefsPackage(YangType<?> type) { |
| 331 | Object var = type.getDataTypeExtendedInfo(); |
| 332 | if (!(var instanceof YangDerivedInfo)) { |
| 333 | throw new TranslatorException("type should have been derived."); |
| 334 | } |
| 335 | |
| 336 | if (!(((YangDerivedInfo<?>) var).getReferredTypeDef() instanceof YangTypeDef)) { |
| 337 | throw new TranslatorException("derived info is not an instance of typedef."); |
| 338 | } |
| 339 | |
| 340 | YangJavaTypeDef typedef = (YangJavaTypeDef) ((YangDerivedInfo<?>) var).getReferredTypeDef(); |
| 341 | if (typedef.getJavaFileInfo().getPackage() == null) { |
| 342 | return getPackageFromParent(typedef.getParent()); |
| 343 | } |
| 344 | return typedef.getJavaFileInfo().getPackage(); |
| 345 | } |
| 346 | |
| 347 | /** |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 348 | * Returns java package for union node. |
| 349 | * |
| 350 | * @param type YANG type |
| 351 | * @return java package for union node |
| 352 | */ |
| 353 | private static String getUnionPackage(YangType<?> type) { |
| 354 | |
| 355 | if (!(type.getDataTypeExtendedInfo() instanceof YangUnion)) { |
| 356 | throw new TranslatorException("type should have been union."); |
| 357 | } |
| 358 | |
| 359 | YangJavaUnion union = (YangJavaUnion) type.getDataTypeExtendedInfo(); |
| 360 | if (union.getJavaFileInfo().getPackage() == null) { |
| 361 | return getPackageFromParent(union.getParent()); |
| 362 | } |
| 363 | return union.getJavaFileInfo().getPackage(); |
| 364 | } |
| 365 | |
| 366 | /** |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 367 | * Returns package from parent node. |
| 368 | * |
| 369 | * @param parent parent YANG node |
| 370 | * @return java package from parent node |
| 371 | */ |
| 372 | private static String getPackageFromParent(YangNode parent) { |
| 373 | if (!(parent instanceof HasJavaFileInfo)) { |
Gaurav Agrawal | 97a5e1c | 2016-04-18 18:53:11 +0530 | [diff] [blame] | 374 | throw new TranslatorException("invalid child node is being processed."); |
Bharat saraswal | e2bc60d | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 375 | } |
| 376 | JavaFileInfo parentInfo = ((HasJavaFileInfo) parent).getJavaFileInfo(); |
| 377 | return parentInfo.getPackage() + PERIOD + parentInfo.getJavaName().toLowerCase(); |
Vinod Kumar S | 0871098 | 2016-03-03 19:55:30 +0530 | [diff] [blame] | 378 | } |
Bharat saraswal | c46ee2a | 2016-02-25 02:26:43 +0530 | [diff] [blame] | 379 | } |