Vinod Kumar S | 79a374b | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present Open Networking Laboratory |
| 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; |
| 18 | |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 19 | import java.io.File; |
Vinod Kumar S | 79a374b | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 20 | import java.io.IOException; |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 21 | import java.util.ArrayList; |
| 22 | import java.util.List; |
| 23 | |
| 24 | import org.onosproject.yangutils.datamodel.YangNode; |
| 25 | import org.onosproject.yangutils.datamodel.YangType; |
| 26 | import org.onosproject.yangutils.datamodel.YangTypeHolder; |
Shankara-Huawei | b756477 | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 27 | import org.onosproject.yangutils.datamodel.javadatamodel.JavaFileInfo; |
| 28 | import org.onosproject.yangutils.datamodel.javadatamodel.YangPluginConfig; |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 29 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 30 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
Shankara-Huawei | b756477 | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 31 | import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeTranslator; |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 32 | |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 33 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32; |
| 34 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT64; |
| 35 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT16; |
| 36 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT32; |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 37 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_TYPEDEF_CLASS; |
| 38 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS; |
| 39 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.CONSTRUCTOR_FOR_TYPE_MASK; |
| 40 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.FROM_STRING_IMPL_MASK; |
| 41 | import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType.OF_STRING_IMPL_MASK; |
| 42 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; |
Shankara-Huawei | b756477 | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 43 | import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator.getQualifiedInfoOfFromString; |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 44 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateTypeDefClassFile; |
| 45 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateUnionClassFile; |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 46 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.createPackage; |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 47 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getOfMethodStringAndJavaDoc; |
| 48 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getTypeConstructorStringAndJavaDoc; |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 49 | import static org.onosproject.yangutils.translator.tojava.utils.ValidatorTypeForUnionTypes.INT_TYPE_CONFLICT; |
| 50 | import static org.onosproject.yangutils.translator.tojava.utils.ValidatorTypeForUnionTypes.LONG_TYPE_CONFLICT; |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 51 | import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING; |
| 52 | import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE; |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 53 | import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.closeFile; |
| 54 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase; |
Vinod Kumar S | 79a374b | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 55 | |
| 56 | /** |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 57 | * Represents implementation of java data type code fragments temporary implementations. Maintains the temp files |
| 58 | * required specific for user defined data type java snippet generation. |
Vinod Kumar S | 79a374b | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 59 | */ |
| 60 | public class TempJavaTypeFragmentFiles |
| 61 | extends TempJavaFragmentFiles { |
| 62 | |
| 63 | /** |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 64 | * File name for of string method. |
| 65 | */ |
| 66 | private static final String OF_STRING_METHOD_FILE_NAME = "OfString"; |
| 67 | |
| 68 | /** |
| 69 | * File name for construction for special type like union, typedef. |
| 70 | */ |
| 71 | private static final String CONSTRUCTOR_FOR_TYPE_FILE_NAME = "ConstructorForType"; |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 72 | |
| 73 | /** |
| 74 | * File name for typedef class file name suffix. |
| 75 | */ |
| 76 | private static final String TYPEDEF_CLASS_FILE_NAME_SUFFIX = EMPTY_STRING; |
| 77 | |
| 78 | /** |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 79 | * File name for generated class file for special type like union, typedef suffix. |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 80 | */ |
| 81 | private static final String UNION_TYPE_CLASS_FILE_NAME_SUFFIX = EMPTY_STRING; |
| 82 | |
| 83 | /** |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 84 | * Integer index in type list. |
| 85 | */ |
| 86 | private int intIndex = 0; |
| 87 | |
| 88 | /** |
| 89 | * UInt index in type list. |
| 90 | */ |
| 91 | private int uIntIndex = 0; |
| 92 | |
| 93 | /** |
| 94 | * long index in type list. |
| 95 | */ |
| 96 | private int longIndex = 0; |
| 97 | |
| 98 | /** |
| 99 | * ULong index in type list. |
| 100 | */ |
| 101 | private int uLongIndex = 0; |
| 102 | |
| 103 | /** |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 104 | * Temporary file handle for of string method of class. |
| 105 | */ |
| 106 | private File ofStringImplTempFileHandle; |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 107 | |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 108 | /** |
| 109 | * Temporary file handle for constructor for type class. |
| 110 | */ |
| 111 | private File constructorForTypeTempFileHandle; |
| 112 | |
| 113 | /** |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 114 | * Java file handle for typedef class file. |
| 115 | */ |
| 116 | private File typedefClassJavaFileHandle; |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 117 | |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 118 | /** |
| 119 | * Java file handle for type class like union, typedef file. |
| 120 | */ |
| 121 | private File typeClassJavaFileHandle; |
| 122 | |
| 123 | /** |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 124 | * Java attribute for int. |
| 125 | */ |
| 126 | private JavaAttributeInfo intAttribute; |
| 127 | |
| 128 | /** |
| 129 | * Java attribute for long. |
| 130 | */ |
| 131 | private JavaAttributeInfo longAttribute; |
| 132 | |
| 133 | /** |
| 134 | * Java attribute for uInt. |
| 135 | */ |
| 136 | private JavaAttributeInfo uIntAttribute; |
| 137 | |
| 138 | /** |
| 139 | * Java attribute for uLong. |
| 140 | */ |
| 141 | private JavaAttributeInfo uLongAttribute; |
| 142 | |
| 143 | /** |
Vinod Kumar S | 79a374b | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 144 | * Creates an instance of temporary java code fragment. |
| 145 | * |
| 146 | * @param javaFileInfo generated java file info |
| 147 | * @throws IOException when fails to create new file handle |
| 148 | */ |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 149 | TempJavaTypeFragmentFiles(JavaFileInfo javaFileInfo) |
Vinod Kumar S | 79a374b | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 150 | throws IOException { |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 151 | |
Vinod Kumar S | 79a374b | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 152 | super(javaFileInfo); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 153 | |
| 154 | /* |
| 155 | * Initialize getterImpl, attributes, hash code, equals and to strings |
| 156 | * when generation file type matches to typeDef class mask. |
| 157 | */ |
| 158 | addGeneratedTempFile(OF_STRING_IMPL_MASK); |
| 159 | addGeneratedTempFile(CONSTRUCTOR_FOR_TYPE_MASK); |
| 160 | addGeneratedTempFile(FROM_STRING_IMPL_MASK); |
| 161 | |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 162 | setOfStringImplTempFileHandle(getTemporaryFileHandle(OF_STRING_METHOD_FILE_NAME)); |
| 163 | setConstructorForTypeTempFileHandle(getTemporaryFileHandle(CONSTRUCTOR_FOR_TYPE_FILE_NAME)); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 164 | |
Vinod Kumar S | 79a374b | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 165 | } |
| 166 | |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 167 | /** |
| 168 | * Returns type class constructor method's temporary file handle. |
| 169 | * |
| 170 | * @return type class constructor method's temporary file handle |
| 171 | */ |
| 172 | |
| 173 | public File getConstructorForTypeTempFileHandle() { |
| 174 | return constructorForTypeTempFileHandle; |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Sets type class constructor method's temporary file handle. |
| 179 | * |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 180 | * @param constructorForTypeTempFileHandle type class constructor method's temporary file handle |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 181 | */ |
| 182 | private void setConstructorForTypeTempFileHandle(File constructorForTypeTempFileHandle) { |
| 183 | this.constructorForTypeTempFileHandle = constructorForTypeTempFileHandle; |
| 184 | } |
| 185 | |
| 186 | /** |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 187 | * Returns java file handle for typedef class file. |
| 188 | * |
| 189 | * @return java file handle for typedef class file |
| 190 | */ |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 191 | private File getTypedefClassJavaFileHandle() { |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 192 | return typedefClassJavaFileHandle; |
| 193 | } |
| 194 | |
| 195 | /** |
| 196 | * Sets the java file handle for typedef class file. |
| 197 | * |
| 198 | * @param typedefClassJavaFileHandle java file handle |
| 199 | */ |
| 200 | private void setTypedefClassJavaFileHandle(File typedefClassJavaFileHandle) { |
| 201 | this.typedefClassJavaFileHandle = typedefClassJavaFileHandle; |
| 202 | } |
| 203 | |
| 204 | /** |
| 205 | * Returns java file handle for type class file. |
| 206 | * |
| 207 | * @return java file handle for type class file |
| 208 | */ |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 209 | private File getTypeClassJavaFileHandle() { |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 210 | return typeClassJavaFileHandle; |
| 211 | } |
| 212 | |
| 213 | /** |
| 214 | * Sets the java file handle for type class file. |
| 215 | * |
| 216 | * @param typeClassJavaFileHandle type file handle |
| 217 | */ |
| 218 | private void setTypeClassJavaFileHandle(File typeClassJavaFileHandle) { |
| 219 | this.typeClassJavaFileHandle = typeClassJavaFileHandle; |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * Returns of string method's temporary file handle. |
| 224 | * |
| 225 | * @return of string method's temporary file handle |
| 226 | */ |
| 227 | |
| 228 | public File getOfStringImplTempFileHandle() { |
| 229 | return ofStringImplTempFileHandle; |
| 230 | } |
| 231 | |
| 232 | /** |
| 233 | * Set of string method's temporary file handle. |
| 234 | * |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 235 | * @param ofStringImplTempFileHandle of string method's temporary file handle |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 236 | */ |
| 237 | private void setOfStringImplTempFileHandle(File ofStringImplTempFileHandle) { |
| 238 | this.ofStringImplTempFileHandle = ofStringImplTempFileHandle; |
| 239 | } |
| 240 | |
| 241 | /** |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 242 | * Adds all the type in the current data model node as part of the generated temporary file. |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 243 | * |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 244 | * @param yangTypeHolder YANG java data model node which has type info, eg union / typedef |
| 245 | * @param pluginConfig plugin configurations for naming conventions |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 246 | * @throws IOException IO operation fail |
| 247 | */ |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 248 | void addTypeInfoToTempFiles(YangTypeHolder yangTypeHolder, YangPluginConfig pluginConfig) |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 249 | throws IOException { |
| 250 | |
| 251 | List<YangType<?>> typeList = yangTypeHolder.getTypeList(); |
| 252 | if (typeList != null) { |
| 253 | for (YangType<?> yangType : typeList) { |
Shankara-Huawei | b756477 | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 254 | if (!(yangType instanceof YangJavaTypeTranslator)) { |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 255 | throw new TranslatorException("Type does not have Java info"); |
| 256 | } |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 257 | JavaAttributeInfo javaAttributeInfo = getAttributeForType(yangType, pluginConfig); |
| 258 | addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo, |
| 259 | pluginConfig, typeList); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 260 | } |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 261 | addTypeConstructor(pluginConfig); |
| 262 | addMethodsInConflictCase(pluginConfig); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 263 | } |
| 264 | } |
| 265 | |
| 266 | /** |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 267 | * Returns java attribute. |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 268 | * |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 269 | * @param yangType YANG type |
Bharat saraswal | 715d3fc | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 270 | * @param pluginConfig plugin configurations |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 271 | * @return java attribute |
| 272 | */ |
| 273 | private JavaAttributeInfo getAttributeForType(YangType yangType, YangPluginConfig pluginConfig) { |
Shankara-Huawei | b756477 | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 274 | YangJavaTypeTranslator<?> javaType = (YangJavaTypeTranslator<?>) yangType; |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 275 | javaType.updateJavaQualifiedInfo(pluginConfig.getConflictResolver()); |
| 276 | String typeName = javaType.getDataTypeName(); |
| 277 | typeName = getCamelCase(typeName, pluginConfig.getConflictResolver()); |
| 278 | return getAttributeInfoForTheData( |
| 279 | javaType.getJavaQualifiedInfo(), |
| 280 | typeName, javaType, |
| 281 | getIsQualifiedAccessOrAddToImportList(javaType.getJavaQualifiedInfo()), |
| 282 | false); |
| 283 | } |
| 284 | |
| 285 | /** |
| 286 | * Adds the new attribute info to the target generated temporary files for union class. |
| 287 | * |
| 288 | * @param javaAttributeInfo the attribute info that needs to be added to temporary files |
| 289 | * @param pluginConfig plugin configurations |
| 290 | * @param typeList type list |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 291 | * @throws IOException IO operation fail |
| 292 | */ |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 293 | private void addJavaSnippetInfoToApplicableTempFiles(JavaAttributeInfo javaAttributeInfo, |
| 294 | YangPluginConfig pluginConfig, List<YangType<?>> typeList) |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 295 | throws IOException { |
| 296 | |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 297 | YangDataTypes attrType = javaAttributeInfo.getAttributeType().getDataType(); |
| 298 | |
| 299 | if (attrType == INT32 || attrType == UINT16) { |
| 300 | boolean isIntConflict = validateForConflictingIntTypes(typeList); |
| 301 | javaAttributeInfo.setIntConflict(isIntConflict); |
| 302 | updateAttributeCondition(javaAttributeInfo); |
| 303 | if (!isIntConflict) { |
| 304 | addMethodsWhenNoConflictingTypes(javaAttributeInfo, pluginConfig); |
| 305 | } |
| 306 | } else if (attrType == INT64 || attrType == UINT32) { |
| 307 | boolean isLongConflict = validateForConflictingLongTypes(typeList); |
| 308 | javaAttributeInfo.setLongConflict(isLongConflict); |
| 309 | updateAttributeCondition(javaAttributeInfo); |
| 310 | if (!isLongConflict) { |
| 311 | addMethodsWhenNoConflictingTypes(javaAttributeInfo, pluginConfig); |
| 312 | } |
| 313 | } else { |
| 314 | addMethodsWhenNoConflictingTypes(javaAttributeInfo, pluginConfig); |
| 315 | } |
Bharat saraswal | 715d3fc | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 316 | super.addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo, pluginConfig); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 317 | |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 318 | } |
| 319 | |
| 320 | /** |
Shankara-Huawei | b756477 | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 321 | * Adds of method and constructor when there is no conflicting types. |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 322 | * |
| 323 | * @param javaAttributeInfo java attribute info |
| 324 | * @param pluginConfig plugin configurations |
Shankara-Huawei | b756477 | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 325 | * @throws IOException when fails to do IO operations |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 326 | */ |
| 327 | private void addMethodsWhenNoConflictingTypes(JavaAttributeInfo javaAttributeInfo, |
| 328 | YangPluginConfig pluginConfig) throws IOException { |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 329 | if ((getGeneratedTempFiles() & OF_STRING_IMPL_MASK) != 0) { |
Bharat saraswal | 715d3fc | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 330 | addOfStringMethod(javaAttributeInfo, pluginConfig); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 331 | } |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 332 | |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 333 | if ((getGeneratedTempFiles() & CONSTRUCTOR_FOR_TYPE_MASK) != 0) { |
Bharat saraswal | 715d3fc | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 334 | addTypeConstructor(javaAttributeInfo, pluginConfig); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 335 | } |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | /** |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 339 | * Adds of, getter and from string method in conflict cases. |
| 340 | * |
| 341 | * @param pluginConfig plugin configurations |
| 342 | * @throws IOException when fails to do IO operations |
| 343 | */ |
| 344 | private void addMethodsInConflictCase(YangPluginConfig pluginConfig) throws IOException { |
| 345 | JavaAttributeInfo attr = getIntAttribute(); |
| 346 | if (attr != null) { |
| 347 | attr = getUIntAttribute(); |
| 348 | } |
| 349 | if (attr != null) { |
| 350 | if (attr.isIntConflict()) { |
| 351 | if (getIntIndex() < getUIntIndex()) { |
| 352 | appendToFile(getOfStringImplTempFileHandle(), getOfMethodStringAndJavaDoc(getIntAttribute(), |
| 353 | getGeneratedJavaClassName(), pluginConfig) |
| 354 | + NEW_LINE); |
| 355 | addGetterImpl(getIntAttribute(), pluginConfig); |
| 356 | addFromStringMethod(getIntAttribute(), pluginConfig); |
| 357 | } else { |
| 358 | appendToFile(getOfStringImplTempFileHandle(), getOfMethodStringAndJavaDoc(getUIntAttribute(), |
| 359 | getGeneratedJavaClassName(), pluginConfig) |
| 360 | + NEW_LINE); |
| 361 | addGetterImpl(getUIntAttribute(), pluginConfig); |
| 362 | addFromStringMethod(getUIntAttribute(), pluginConfig); |
| 363 | } |
| 364 | } |
| 365 | } |
| 366 | attr = getLongAttribute(); |
| 367 | if (attr != null) { |
| 368 | attr = getULongAttribute(); |
| 369 | } |
| 370 | if (attr != null) { |
| 371 | if (attr.isLongConflict()) { |
| 372 | if (getLongIndex() < getULongIndex()) { |
| 373 | appendToFile(getOfStringImplTempFileHandle(), getOfMethodStringAndJavaDoc(getLongAttribute(), |
| 374 | getGeneratedJavaClassName(), pluginConfig) |
| 375 | + NEW_LINE); |
| 376 | addGetterImpl(getLongAttribute(), pluginConfig); |
| 377 | addFromStringMethod(getLongAttribute(), pluginConfig); |
| 378 | } else { |
| 379 | appendToFile(getOfStringImplTempFileHandle(), getOfMethodStringAndJavaDoc(getULongAttribute(), |
| 380 | getGeneratedJavaClassName(), pluginConfig) |
| 381 | + NEW_LINE); |
| 382 | addGetterImpl(getULongAttribute(), pluginConfig); |
| 383 | addFromStringMethod(getULongAttribute(), pluginConfig); |
| 384 | } |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | /** |
| 390 | * Adds from string method for conflict case. |
| 391 | * |
| 392 | * @param newAttrInfo new attribute |
| 393 | * @param pluginConfig plugin configurations |
| 394 | * @throws IOException when fails to do IO operations |
| 395 | */ |
| 396 | private void addFromStringMethod(JavaAttributeInfo newAttrInfo, YangPluginConfig pluginConfig) throws IOException { |
| 397 | |
Shankara-Huawei | b756477 | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 398 | JavaQualifiedTypeInfoTranslator qualifiedInfoOfFromString = getQualifiedInfoOfFromString(newAttrInfo, |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 399 | pluginConfig.getConflictResolver()); |
| 400 | /* |
| 401 | * Create a new java attribute info with qualified information of |
| 402 | * wrapper classes. |
| 403 | */ |
| 404 | JavaAttributeInfo fromStringAttributeInfo = getAttributeInfoForTheData(qualifiedInfoOfFromString, |
| 405 | newAttrInfo.getAttributeName(), |
| 406 | newAttrInfo.getAttributeType(), |
| 407 | getIsQualifiedAccessOrAddToImportList(qualifiedInfoOfFromString), false); |
| 408 | |
| 409 | addFromStringMethod(newAttrInfo, fromStringAttributeInfo); |
| 410 | } |
| 411 | |
| 412 | /** |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 413 | * Adds type constructor. |
| 414 | * |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 415 | * @param attr attribute info |
Bharat saraswal | 715d3fc | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 416 | * @param pluginConfig plugin configurations |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 417 | * @throws IOException when fails to append to temporary file |
| 418 | */ |
Bharat saraswal | 715d3fc | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 419 | private void addTypeConstructor(JavaAttributeInfo attr, YangPluginConfig pluginConfig) |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 420 | throws IOException { |
| 421 | appendToFile(getConstructorForTypeTempFileHandle(), getTypeConstructorStringAndJavaDoc(attr, |
Bharat saraswal | 715d3fc | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 422 | getGeneratedJavaClassName(), pluginConfig) + NEW_LINE); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 423 | } |
| 424 | |
| 425 | /** |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 426 | * Adds type constructor. |
| 427 | * |
| 428 | * @param pluginConfig plugin configurations |
| 429 | * @throws IOException when fails to append to temporary file |
| 430 | */ |
| 431 | private void addTypeConstructor(YangPluginConfig pluginConfig) |
| 432 | throws IOException { |
| 433 | JavaAttributeInfo attr = getIntAttribute(); |
| 434 | if (attr != null) { |
| 435 | attr = getUIntAttribute(); |
| 436 | } |
| 437 | if (attr != null) { |
| 438 | if (attr.isIntConflict()) { |
| 439 | appendToFile(getConstructorForTypeTempFileHandle(), getTypeConstructorStringAndJavaDoc( |
| 440 | getIntAttribute(), |
| 441 | getUIntAttribute(), getGeneratedJavaClassName(), pluginConfig, INT_TYPE_CONFLICT, |
| 442 | getIntIndex() |
| 443 | < getUIntIndex()) + NEW_LINE); |
| 444 | } |
| 445 | } |
| 446 | attr = getLongAttribute(); |
| 447 | if (attr != null) { |
| 448 | attr = getULongAttribute(); |
| 449 | } |
| 450 | if (attr != null) { |
| 451 | if (attr.isLongConflict()) { |
| 452 | appendToFile(getConstructorForTypeTempFileHandle(), getTypeConstructorStringAndJavaDoc( |
| 453 | getLongAttribute(), |
| 454 | getULongAttribute(), getGeneratedJavaClassName(), pluginConfig, LONG_TYPE_CONFLICT, |
| 455 | getLongIndex() |
| 456 | < getULongIndex()) + NEW_LINE); |
| 457 | } |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | /** |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 462 | * Adds of string for type. |
| 463 | * |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 464 | * @param attr attribute info |
Bharat saraswal | 715d3fc | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 465 | * @param pluginConfig plugin configurations |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 466 | * @throws IOException when fails to append to temporary file |
| 467 | */ |
Bharat saraswal | 715d3fc | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 468 | private void addOfStringMethod(JavaAttributeInfo attr, YangPluginConfig pluginConfig) |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 469 | throws IOException { |
| 470 | appendToFile(getOfStringImplTempFileHandle(), getOfMethodStringAndJavaDoc(attr, |
Bharat saraswal | 715d3fc | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 471 | getGeneratedJavaClassName(), pluginConfig) |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 472 | + NEW_LINE); |
| 473 | } |
| 474 | |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 475 | /** |
| 476 | * Removes all temporary file handles. |
| 477 | * |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 478 | * @param isErrorOccurred flag to tell translator that error has occurred while file generation |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 479 | * @throws IOException when failed to delete the temporary files |
| 480 | */ |
Bharat saraswal | 250a747 | 2016-05-12 13:16:57 +0530 | [diff] [blame] | 481 | @Override |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 482 | public void freeTemporaryResources(boolean isErrorOccurred) |
| 483 | throws IOException { |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 484 | |
| 485 | if ((getGeneratedJavaFiles() & GENERATE_TYPEDEF_CLASS) != 0) { |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 486 | closeFile(getTypedefClassJavaFileHandle(), isErrorOccurred); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 487 | } |
| 488 | |
| 489 | if ((getGeneratedJavaFiles() & GENERATE_UNION_CLASS) != 0) { |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 490 | closeFile(getTypeClassJavaFileHandle(), isErrorOccurred); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 491 | } |
| 492 | |
| 493 | if ((getGeneratedTempFiles() & CONSTRUCTOR_FOR_TYPE_MASK) != 0) { |
| 494 | closeFile(getConstructorForTypeTempFileHandle(), true); |
| 495 | } |
| 496 | if ((getGeneratedTempFiles() & OF_STRING_IMPL_MASK) != 0) { |
| 497 | closeFile(getOfStringImplTempFileHandle(), true); |
| 498 | } |
| 499 | if ((getGeneratedTempFiles() & FROM_STRING_IMPL_MASK) != 0) { |
| 500 | closeFile(getFromStringImplTempFileHandle(), true); |
| 501 | } |
| 502 | |
| 503 | super.freeTemporaryResources(isErrorOccurred); |
Bharat saraswal | 250a747 | 2016-05-12 13:16:57 +0530 | [diff] [blame] | 504 | |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 505 | } |
| 506 | |
| 507 | /** |
| 508 | * Constructs java code exit. |
| 509 | * |
| 510 | * @param fileType generated file type |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 511 | * @param curNode current YANG node |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 512 | * @throws IOException when fails to generate java files |
| 513 | */ |
Bharat saraswal | 250a747 | 2016-05-12 13:16:57 +0530 | [diff] [blame] | 514 | @Override |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 515 | public void generateJavaFile(int fileType, YangNode curNode) |
| 516 | throws IOException { |
| 517 | List<String> imports = new ArrayList<>(); |
| 518 | if (isAttributePresent()) { |
| 519 | imports = getJavaImportData().getImports(); |
| 520 | } |
| 521 | |
| 522 | createPackage(curNode); |
| 523 | |
| 524 | /* |
| 525 | * Creates type def class file. |
| 526 | */ |
| 527 | if ((fileType & GENERATE_TYPEDEF_CLASS) != 0) { |
Shankara-Huawei | a1039e5 | 2016-07-14 16:53:09 +0530 | [diff] [blame] | 528 | addImportsToStringAndHasCodeMethods(imports, true); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 529 | setTypedefClassJavaFileHandle(getJavaFileHandle(getJavaClassName(TYPEDEF_CLASS_FILE_NAME_SUFFIX))); |
| 530 | generateTypeDefClassFile(getTypedefClassJavaFileHandle(), curNode, imports); |
| 531 | } |
| 532 | /* |
| 533 | * Creates type class file. |
| 534 | */ |
| 535 | if ((fileType & GENERATE_UNION_CLASS) != 0) { |
Shankara-Huawei | a1039e5 | 2016-07-14 16:53:09 +0530 | [diff] [blame] | 536 | addImportsToStringAndHasCodeMethods(imports, true); |
VinodKumarS-Huawei | 6266db3 | 2016-05-10 17:58:57 +0530 | [diff] [blame] | 537 | setTypeClassJavaFileHandle(getJavaFileHandle(getJavaClassName(UNION_TYPE_CLASS_FILE_NAME_SUFFIX))); |
| 538 | generateUnionClassFile(getTypeClassJavaFileHandle(), curNode, imports); |
| 539 | } |
| 540 | |
| 541 | /* |
| 542 | * Close all the file handles. |
| 543 | */ |
| 544 | freeTemporaryResources(false); |
| 545 | } |
Bharat saraswal | 64e7e23 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 546 | |
| 547 | /** |
| 548 | * Returns int type index from type list. |
| 549 | * |
| 550 | * @return int type index from type list |
| 551 | */ |
| 552 | public int getIntIndex() { |
| 553 | return intIndex; |
| 554 | } |
| 555 | |
| 556 | /** |
| 557 | * Sets int type index from type list. |
| 558 | * |
| 559 | * @param intIndex int type index from type list. |
| 560 | */ |
| 561 | private void setIntIndex(int intIndex) { |
| 562 | this.intIndex = intIndex; |
| 563 | } |
| 564 | |
| 565 | /** |
| 566 | * Returns uInt type index from type list. |
| 567 | * |
| 568 | * @return uInt type index from type list |
| 569 | */ |
| 570 | public int getUIntIndex() { |
| 571 | return uIntIndex; |
| 572 | } |
| 573 | |
| 574 | /** |
| 575 | * Sets uInt type index from type list. |
| 576 | * |
| 577 | * @param uIntIndex uInt type index from type list. |
| 578 | */ |
| 579 | private void setUIntIndex(int uIntIndex) { |
| 580 | this.uIntIndex = uIntIndex; |
| 581 | } |
| 582 | |
| 583 | /** |
| 584 | * Returns long type index from type list. |
| 585 | * |
| 586 | * @return long type index from type list |
| 587 | */ |
| 588 | public int getLongIndex() { |
| 589 | return longIndex; |
| 590 | } |
| 591 | |
| 592 | /** |
| 593 | * Sets long type index from type list. |
| 594 | * |
| 595 | * @param longIndex long type index from type list. |
| 596 | */ |
| 597 | private void setLongIndex(int longIndex) { |
| 598 | this.longIndex = longIndex; |
| 599 | } |
| 600 | |
| 601 | /** |
| 602 | * Returns uLong type index from type list. |
| 603 | * |
| 604 | * @return uLong type index from type list |
| 605 | */ |
| 606 | public int getULongIndex() { |
| 607 | return uLongIndex; |
| 608 | } |
| 609 | |
| 610 | /** |
| 611 | * Sets uLong type index from type list. |
| 612 | * |
| 613 | * @param uLongIndex uLong type index from type list. |
| 614 | */ |
| 615 | private void setULongIndex(int uLongIndex) { |
| 616 | this.uLongIndex = uLongIndex; |
| 617 | } |
| 618 | |
| 619 | /** |
| 620 | * Validates conflict for int and uInt. |
| 621 | * |
| 622 | * @param typeList type list |
| 623 | * @return true if conflict is there |
| 624 | */ |
| 625 | private boolean validateForConflictingIntTypes(List<YangType<?>> typeList) { |
| 626 | boolean isIntPresent = false; |
| 627 | boolean isUIntPresent = false; |
| 628 | for (YangType type : typeList) { |
| 629 | if (type.getDataType().equals(INT32)) { |
| 630 | setIntIndex(typeList.indexOf(type)); |
| 631 | isIntPresent = true; |
| 632 | } |
| 633 | if (type.getDataType().equals(UINT16)) { |
| 634 | setUIntIndex(typeList.indexOf(type)); |
| 635 | isUIntPresent = true; |
| 636 | } |
| 637 | } |
| 638 | |
| 639 | return isIntPresent && isUIntPresent; |
| 640 | } |
| 641 | |
| 642 | /** |
| 643 | * Validates conflict for long and uLong. |
| 644 | * |
| 645 | * @param typeList type list |
| 646 | * @return true if conflict is there |
| 647 | */ |
| 648 | private boolean validateForConflictingLongTypes(List<YangType<?>> typeList) { |
| 649 | boolean isLongPresent = false; |
| 650 | boolean isULongPresent = false; |
| 651 | for (YangType type : typeList) { |
| 652 | if (type.getDataType().equals(INT64)) { |
| 653 | setLongIndex(typeList.indexOf(type)); |
| 654 | isLongPresent = true; |
| 655 | } |
| 656 | if (type.getDataType().equals(UINT32)) { |
| 657 | setULongIndex(typeList.indexOf(type)); |
| 658 | isULongPresent = true; |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | return isLongPresent && isULongPresent; |
| 663 | } |
| 664 | |
| 665 | /** |
| 666 | * Updates attribute info in case of conflicts. |
| 667 | * |
| 668 | * @param javaAttributeInfo java attribute info |
| 669 | */ |
| 670 | private void updateAttributeCondition(JavaAttributeInfo javaAttributeInfo) { |
| 671 | |
| 672 | if (javaAttributeInfo.isIntConflict()) { |
| 673 | if (javaAttributeInfo.getAttributeType().getDataType() == UINT16) { |
| 674 | setUIntAttribute(javaAttributeInfo); |
| 675 | } else if (javaAttributeInfo.getAttributeType().getDataType() == INT32) { |
| 676 | setIntAttribute(javaAttributeInfo); |
| 677 | } |
| 678 | |
| 679 | } |
| 680 | if (javaAttributeInfo.isLongConflict()) { |
| 681 | if (javaAttributeInfo.getAttributeType().getDataType() == UINT32) { |
| 682 | setULongAttribute(javaAttributeInfo); |
| 683 | } else if (javaAttributeInfo.getAttributeType().getDataType() == INT64) { |
| 684 | setLongAttribute(javaAttributeInfo); |
| 685 | } |
| 686 | |
| 687 | } |
| 688 | } |
| 689 | |
| 690 | /** |
| 691 | * Returns attribute for int. |
| 692 | * |
| 693 | * @return attribute for int |
| 694 | */ |
| 695 | public JavaAttributeInfo getIntAttribute() { |
| 696 | return intAttribute; |
| 697 | } |
| 698 | |
| 699 | /** |
| 700 | * Sets attribute for int. |
| 701 | * |
| 702 | * @param intAttribute attribute for int |
| 703 | */ |
| 704 | private void setIntAttribute(JavaAttributeInfo intAttribute) { |
| 705 | this.intAttribute = intAttribute; |
| 706 | } |
| 707 | |
| 708 | /** |
| 709 | * Returns attribute for long. |
| 710 | * |
| 711 | * @return attribute for long |
| 712 | */ |
| 713 | public JavaAttributeInfo getLongAttribute() { |
| 714 | return longAttribute; |
| 715 | } |
| 716 | |
| 717 | /** |
| 718 | * Sets attribute for long. |
| 719 | * |
| 720 | * @param longAttribute attribute for long |
| 721 | */ |
| 722 | private void setLongAttribute(JavaAttributeInfo longAttribute) { |
| 723 | this.longAttribute = longAttribute; |
| 724 | } |
| 725 | |
| 726 | /** |
| 727 | * Returns attribute for uInt. |
| 728 | * |
| 729 | * @return attribute for uInt |
| 730 | */ |
| 731 | public JavaAttributeInfo getUIntAttribute() { |
| 732 | return uIntAttribute; |
| 733 | } |
| 734 | |
| 735 | /** |
| 736 | * Sets attribute for uInt. |
| 737 | * |
| 738 | * @param uIntAttribute attribute for uInt |
| 739 | */ |
| 740 | private void setUIntAttribute(JavaAttributeInfo uIntAttribute) { |
| 741 | this.uIntAttribute = uIntAttribute; |
| 742 | } |
| 743 | |
| 744 | /** |
| 745 | * Returns attribute for uLong. |
| 746 | * |
| 747 | * @return attribute for uLong |
| 748 | */ |
| 749 | public JavaAttributeInfo getULongAttribute() { |
| 750 | return uLongAttribute; |
| 751 | } |
| 752 | |
| 753 | /** |
| 754 | * Sets attribute for uLong. |
| 755 | * |
| 756 | * @param uLongAttribute attribute for uLong |
| 757 | */ |
| 758 | private void setULongAttribute(JavaAttributeInfo uLongAttribute) { |
| 759 | this.uLongAttribute = uLongAttribute; |
| 760 | } |
Vinod Kumar S | 79a374b | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 761 | } |