Committed by
Gerrit Code Review
[ONOS-4412]Defect fix for uppercase presence in identifier
Change-Id: Iee7f6a47230652833799e0303606d786d55f5dd8
Showing
12 changed files
with
182 additions
and
73 deletions
| ... | @@ -21,7 +21,7 @@ import java.util.List; | ... | @@ -21,7 +21,7 @@ import java.util.List; |
| 21 | 21 | ||
| 22 | import org.onosproject.yangutils.datamodel.YangNodeIdentifier; | 22 | import org.onosproject.yangutils.datamodel.YangNodeIdentifier; |
| 23 | 23 | ||
| 24 | -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase; | 24 | +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | * Represents a utility which provides valid name for generated java file for augment node. | 27 | * Represents a utility which provides valid name for generated java file for augment node. |
| ... | @@ -110,9 +110,9 @@ public final class AugmentJavaFileNameGenUtil { | ... | @@ -110,9 +110,9 @@ public final class AugmentJavaFileNameGenUtil { |
| 110 | */ | 110 | */ |
| 111 | private static String createName(YangNodeIdentifier nodeId, boolean isPrefix) { | 111 | private static String createName(YangNodeIdentifier nodeId, boolean isPrefix) { |
| 112 | if (isPrefix) { | 112 | if (isPrefix) { |
| 113 | - return AUGMENTED + getCaptialCase(nodeId.getPrefix()) + getCaptialCase(nodeId.getName()); | 113 | + return AUGMENTED + getCapitalCase(nodeId.getPrefix()) + getCapitalCase(nodeId.getName()); |
| 114 | } else { | 114 | } else { |
| 115 | - return AUGMENTED + getCaptialCase(nodeId.getName()); | 115 | + return AUGMENTED + getCapitalCase(nodeId.getName()); |
| 116 | } | 116 | } |
| 117 | } | 117 | } |
| 118 | 118 | ... | ... |
utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
| ... | @@ -57,10 +57,9 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerato | ... | @@ -57,10 +57,9 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerato |
| 57 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateInterfaceFile; | 57 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateInterfaceFile; |
| 58 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getFileObject; | 58 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getFileObject; |
| 59 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; | 59 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; |
| 60 | -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase; | 60 | +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; |
| 61 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage; | 61 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage; |
| 62 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getParentNodeInGenCode; | 62 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getParentNodeInGenCode; |
| 63 | -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase; | ||
| 64 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuildString; | 63 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuildString; |
| 65 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getDefaultConstructorString; | 64 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getDefaultConstructorString; |
| 66 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getEqualsMethod; | 65 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getEqualsMethod; |
| ... | @@ -382,7 +381,7 @@ public class TempJavaFragmentFiles { | ... | @@ -382,7 +381,7 @@ public class TempJavaFragmentFiles { |
| 382 | * @return mapped Java class name | 381 | * @return mapped Java class name |
| 383 | */ | 382 | */ |
| 384 | String getGeneratedJavaClassName() { | 383 | String getGeneratedJavaClassName() { |
| 385 | - return getJavaFileInfo().getJavaName(); | 384 | + return getCapitalCase(getJavaFileInfo().getJavaName()); |
| 386 | } | 385 | } |
| 387 | 386 | ||
| 388 | /** | 387 | /** |
| ... | @@ -865,8 +864,9 @@ public class TempJavaFragmentFiles { | ... | @@ -865,8 +864,9 @@ public class TempJavaFragmentFiles { |
| 865 | appendToFile(getGetterImplTempFileHandle(), getOverRideString() + getGetterForClass(attr, | 864 | appendToFile(getGetterImplTempFileHandle(), getOverRideString() + getGetterForClass(attr, |
| 866 | getGeneratedJavaFiles()) + NEW_LINE); | 865 | getGeneratedJavaFiles()) + NEW_LINE); |
| 867 | } else { | 866 | } else { |
| 868 | - appendToFile(getGetterImplTempFileHandle(), getJavaDoc(GETTER_METHOD, attr.getAttributeName(), false) | 867 | + appendToFile(getGetterImplTempFileHandle(), |
| 869 | - + getGetterForClass(attr, getGeneratedJavaFiles()) + NEW_LINE); | 868 | + getJavaDoc(GETTER_METHOD, getCapitalCase(attr.getAttributeName()), false) |
| 869 | + + getGetterForClass(attr, getGeneratedJavaFiles()) + NEW_LINE); | ||
| 870 | } | 870 | } |
| 871 | } | 871 | } |
| 872 | 872 | ||
| ... | @@ -1034,7 +1034,7 @@ public class TempJavaFragmentFiles { | ... | @@ -1034,7 +1034,7 @@ public class TempJavaFragmentFiles { |
| 1034 | /* | 1034 | /* |
| 1035 | * TODO: check if this utility needs to be called or move to the caller | 1035 | * TODO: check if this utility needs to be called or move to the caller |
| 1036 | */ | 1036 | */ |
| 1037 | - String attributeName = getCamelCase(getSmallCase(attr.getAttributeName()), null); | 1037 | + String attributeName = getCamelCase(attr.getAttributeName(), null); |
| 1038 | if (attr.isQualifiedName()) { | 1038 | if (attr.isQualifiedName()) { |
| 1039 | return getJavaAttributeDefination(attr.getImportInfo().getPkgInfo(), | 1039 | return getJavaAttributeDefination(attr.getImportInfo().getPkgInfo(), |
| 1040 | attr.getImportInfo().getClassInfo(), | 1040 | attr.getImportInfo().getClassInfo(), |
| ... | @@ -1104,7 +1104,7 @@ public class TempJavaFragmentFiles { | ... | @@ -1104,7 +1104,7 @@ public class TempJavaFragmentFiles { |
| 1104 | * generated java files or qualified access | 1104 | * generated java files or qualified access |
| 1105 | */ | 1105 | */ |
| 1106 | JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(parentNode, | 1106 | JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(parentNode, |
| 1107 | - curNodeName); | 1107 | + getCapitalCase(curNodeName)); |
| 1108 | if (!(parentNode instanceof TempJavaCodeFragmentFilesContainer)) { | 1108 | if (!(parentNode instanceof TempJavaCodeFragmentFilesContainer)) { |
| 1109 | throw new TranslatorException("Parent node does not have file info"); | 1109 | throw new TranslatorException("Parent node does not have file info"); |
| 1110 | } | 1110 | } |
| ... | @@ -1156,7 +1156,7 @@ public class TempJavaFragmentFiles { | ... | @@ -1156,7 +1156,7 @@ public class TempJavaFragmentFiles { |
| 1156 | throw new TranslatorException("missing java file information to get the package details " | 1156 | throw new TranslatorException("missing java file information to get the package details " |
| 1157 | + "of attribute corresponding to child node"); | 1157 | + "of attribute corresponding to child node"); |
| 1158 | } | 1158 | } |
| 1159 | - caseImportInfo.setClassInfo(getCaptialCase(getCamelCase(parent.getName(), null))); | 1159 | + caseImportInfo.setClassInfo(getCapitalCase(getCamelCase(parent.getName(), null))); |
| 1160 | caseImportInfo.setPkgInfo(((JavaFileInfoContainer) parent).getJavaFileInfo().getPackage()); | 1160 | caseImportInfo.setPkgInfo(((JavaFileInfoContainer) parent).getJavaFileInfo().getPackage()); |
| 1161 | ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles() | 1161 | ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles() |
| 1162 | .getBeanTempFiles().getJavaImportData().addImportInfo(caseImportInfo); | 1162 | .getBeanTempFiles().getJavaImportData().addImportInfo(caseImportInfo); |
| ... | @@ -1298,7 +1298,7 @@ public class TempJavaFragmentFiles { | ... | @@ -1298,7 +1298,7 @@ public class TempJavaFragmentFiles { |
| 1298 | * @return java class name | 1298 | * @return java class name |
| 1299 | */ | 1299 | */ |
| 1300 | String getJavaClassName(String suffix) { | 1300 | String getJavaClassName(String suffix) { |
| 1301 | - return getCaptialCase(getJavaFileInfo().getJavaName()) + suffix; | 1301 | + return getCapitalCase(getJavaFileInfo().getJavaName()) + suffix; |
| 1302 | } | 1302 | } |
| 1303 | 1303 | ||
| 1304 | /** | 1304 | /** | ... | ... |
| ... | @@ -28,6 +28,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. | ... | @@ -28,6 +28,7 @@ import static org.onosproject.yangutils.translator.tojava.GeneratedTempFileType. |
| 28 | import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaClassDefClose; | 28 | import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaClassDefClose; |
| 29 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateManagerClassFile; | 29 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateManagerClassFile; |
| 30 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateServiceInterfaceFile; | 30 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateServiceInterfaceFile; |
| 31 | +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; | ||
| 31 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getRpcManagerMethod; | 32 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getRpcManagerMethod; |
| 32 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getRpcServiceMethod; | 33 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getRpcServiceMethod; |
| 33 | import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addArrayListImport; | 34 | import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addArrayListImport; |
| ... | @@ -235,10 +236,10 @@ public class TempJavaServiceFragmentFiles | ... | @@ -235,10 +236,10 @@ public class TempJavaServiceFragmentFiles |
| 235 | String rpcInput = EMPTY_STRING; | 236 | String rpcInput = EMPTY_STRING; |
| 236 | String rpcOutput = VOID; | 237 | String rpcOutput = VOID; |
| 237 | if (javaAttributeInfoOfInput != null) { | 238 | if (javaAttributeInfoOfInput != null) { |
| 238 | - rpcInput = javaAttributeInfoOfInput.getAttributeName(); | 239 | + rpcInput = getCapitalCase(javaAttributeInfoOfInput.getAttributeName()); |
| 239 | } | 240 | } |
| 240 | if (javaAttributeInfoOfOutput != null) { | 241 | if (javaAttributeInfoOfOutput != null) { |
| 241 | - rpcOutput = javaAttributeInfoOfOutput.getAttributeName(); | 242 | + rpcOutput = getCapitalCase(javaAttributeInfoOfOutput.getAttributeName()); |
| 242 | } | 243 | } |
| 243 | appendToFile(getRpcInterfaceTempFileHandle(), generateJavaDocForRpc(rpcName, RPC_INPUT_VAR_NAME, rpcOutput) | 244 | appendToFile(getRpcInterfaceTempFileHandle(), generateJavaDocForRpc(rpcName, RPC_INPUT_VAR_NAME, rpcOutput) |
| 244 | + getRpcServiceMethod(rpcName, rpcInput, rpcOutput) + NEW_LINE); | 245 | + getRpcServiceMethod(rpcName, rpcInput, rpcOutput) + NEW_LINE); | ... | ... |
utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java
| ... | @@ -37,6 +37,7 @@ import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; | ... | @@ -37,6 +37,7 @@ import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; |
| 37 | 37 | ||
| 38 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; | 38 | import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData; |
| 39 | import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode; | 39 | import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode; |
| 40 | +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; | ||
| 40 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getParentNodeInGenCode; | 41 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getParentNodeInGenCode; |
| 41 | import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.updatePackageInfo; | 42 | import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.updatePackageInfo; |
| 42 | 43 | ||
| ... | @@ -157,7 +158,7 @@ public class YangJavaRpc | ... | @@ -157,7 +158,7 @@ public class YangJavaRpc |
| 157 | * generated java files or qualified access | 158 | * generated java files or qualified access |
| 158 | */ | 159 | */ |
| 159 | JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(currentNode, | 160 | JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(currentNode, |
| 160 | - childNodeName); | 161 | + getCapitalCase(childNodeName)); |
| 161 | if (!(parentNode instanceof TempJavaCodeFragmentFilesContainer)) { | 162 | if (!(parentNode instanceof TempJavaCodeFragmentFilesContainer)) { |
| 162 | throw new TranslatorException("Parent node does not have file info"); | 163 | throw new TranslatorException("Parent node does not have file info"); |
| 163 | } | 164 | } | ... | ... |
| ... | @@ -24,6 +24,7 @@ import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; | ... | @@ -24,6 +24,7 @@ import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles; |
| 24 | import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; | 24 | import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig; |
| 25 | 25 | ||
| 26 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS; | 26 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_UNION_CLASS; |
| 27 | +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; | ||
| 27 | import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode; | 28 | import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode; |
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| ... | @@ -85,7 +86,7 @@ public class YangJavaUnion | ... | @@ -85,7 +86,7 @@ public class YangJavaUnion |
| 85 | public TempJavaCodeFragmentFiles getTempJavaCodeFragmentFiles() { | 86 | public TempJavaCodeFragmentFiles getTempJavaCodeFragmentFiles() { |
| 86 | if (tempFileHandle == null) { | 87 | if (tempFileHandle == null) { |
| 87 | throw new RuntimeException("Missing temp file hand for current node " | 88 | throw new RuntimeException("Missing temp file hand for current node " |
| 88 | - + getJavaFileInfo().getJavaName()); | 89 | + + getCapitalCase(getJavaFileInfo().getJavaName())); |
| 89 | } | 90 | } |
| 90 | return tempFileHandle; | 91 | return tempFileHandle; |
| 91 | } | 92 | } | ... | ... |
| ... | @@ -31,7 +31,7 @@ import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeDef; | ... | @@ -31,7 +31,7 @@ import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaTypeDef; |
| 31 | import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaUnion; | 31 | import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaUnion; |
| 32 | 32 | ||
| 33 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; | 33 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; |
| 34 | -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase; | 34 | +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; |
| 35 | import static org.onosproject.yangutils.utils.UtilConstants.BIG_INTEGER; | 35 | import static org.onosproject.yangutils.utils.UtilConstants.BIG_INTEGER; |
| 36 | import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_DATA_TYPE; | 36 | import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_DATA_TYPE; |
| 37 | import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_WRAPPER; | 37 | import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_WRAPPER; |
| ... | @@ -189,7 +189,7 @@ public final class AttributesJavaDataType { | ... | @@ -189,7 +189,7 @@ public final class AttributesJavaDataType { |
| 189 | case BOOLEAN: | 189 | case BOOLEAN: |
| 190 | return BOOLEAN_WRAPPER; | 190 | return BOOLEAN_WRAPPER; |
| 191 | case ENUMERATION: | 191 | case ENUMERATION: |
| 192 | - return getCaptialCase( | 192 | + return getCapitalCase( |
| 193 | getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(), null)); | 193 | getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(), null)); |
| 194 | case BITS: | 194 | case BITS: |
| 195 | //TODO:BITS | 195 | //TODO:BITS |
| ... | @@ -206,12 +206,12 @@ public final class AttributesJavaDataType { | ... | @@ -206,12 +206,12 @@ public final class AttributesJavaDataType { |
| 206 | case EMPTY: | 206 | case EMPTY: |
| 207 | return BOOLEAN_WRAPPER; | 207 | return BOOLEAN_WRAPPER; |
| 208 | case UNION: | 208 | case UNION: |
| 209 | - return getCaptialCase(getCamelCase(((YangJavaUnion) yangType.getDataTypeExtendedInfo()).getName(), | 209 | + return getCapitalCase(getCamelCase(((YangJavaUnion) yangType.getDataTypeExtendedInfo()).getName(), |
| 210 | null)); | 210 | null)); |
| 211 | case INSTANCE_IDENTIFIER: | 211 | case INSTANCE_IDENTIFIER: |
| 212 | //TODO:INSTANCE_IDENTIFIER | 212 | //TODO:INSTANCE_IDENTIFIER |
| 213 | case DERIVED: | 213 | case DERIVED: |
| 214 | - return getCaptialCase(getCamelCase(yangType.getDataTypeName(), null)); | 214 | + return getCapitalCase(getCamelCase(yangType.getDataTypeName(), null)); |
| 215 | default: | 215 | default: |
| 216 | throw new TranslatorException("given data type is not supported."); | 216 | throw new TranslatorException("given data type is not supported."); |
| 217 | } | 217 | } |
| ... | @@ -225,7 +225,7 @@ public final class AttributesJavaDataType { | ... | @@ -225,7 +225,7 @@ public final class AttributesJavaDataType { |
| 225 | case STRING: | 225 | case STRING: |
| 226 | return STRING_DATA_TYPE; | 226 | return STRING_DATA_TYPE; |
| 227 | case ENUMERATION: | 227 | case ENUMERATION: |
| 228 | - return getCaptialCase( | 228 | + return getCapitalCase( |
| 229 | getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(), null)); | 229 | getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(), null)); |
| 230 | case BITS: | 230 | case BITS: |
| 231 | //TODO:BITS | 231 | //TODO:BITS |
| ... | @@ -243,13 +243,13 @@ public final class AttributesJavaDataType { | ... | @@ -243,13 +243,13 @@ public final class AttributesJavaDataType { |
| 243 | //TODO:EMPTY | 243 | //TODO:EMPTY |
| 244 | break; | 244 | break; |
| 245 | case UNION: | 245 | case UNION: |
| 246 | - return getCaptialCase(getCamelCase(((YangJavaUnion) yangType.getDataTypeExtendedInfo()).getName(), | 246 | + return getCapitalCase(getCamelCase(((YangJavaUnion) yangType.getDataTypeExtendedInfo()).getName(), |
| 247 | null)); | 247 | null)); |
| 248 | case INSTANCE_IDENTIFIER: | 248 | case INSTANCE_IDENTIFIER: |
| 249 | //TODO:INSTANCE_IDENTIFIER | 249 | //TODO:INSTANCE_IDENTIFIER |
| 250 | break; | 250 | break; |
| 251 | case DERIVED: | 251 | case DERIVED: |
| 252 | - return getCaptialCase(getCamelCase(yangType.getDataTypeName(), null)); | 252 | + return getCapitalCase(getCamelCase(yangType.getDataTypeName(), null)); |
| 253 | default: | 253 | default: |
| 254 | return null; | 254 | return null; |
| 255 | } | 255 | } | ... | ... |
| ... | @@ -57,8 +57,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetG | ... | @@ -57,8 +57,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetG |
| 57 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getDataFromTempFileHandle; | 57 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getDataFromTempFileHandle; |
| 58 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getEnumsValueAttribute; | 58 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.getEnumsValueAttribute; |
| 59 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.initiateJavaFileGeneration; | 59 | import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGeneratorUtils.initiateJavaFileGeneration; |
| 60 | -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase; | 60 | +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; |
| 61 | -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase; | ||
| 62 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getAddAugmentInfoMethodImpl; | 61 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getAddAugmentInfoMethodImpl; |
| 63 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getAugmentInfoListImpl; | 62 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getAugmentInfoListImpl; |
| 64 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getConstructorStart; | 63 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getConstructorStart; |
| ... | @@ -171,7 +170,7 @@ public final class JavaFileGenerator { | ... | @@ -171,7 +170,7 @@ public final class JavaFileGenerator { |
| 171 | 170 | ||
| 172 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 171 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 173 | 172 | ||
| 174 | - String className = getCaptialCase(javaFileInfo.getJavaName()); | 173 | + String className = getCapitalCase(javaFileInfo.getJavaName()); |
| 175 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); | 174 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); |
| 176 | 175 | ||
| 177 | initiateJavaFileGeneration(file, className, INTERFACE_MASK, imports, path); | 176 | initiateJavaFileGeneration(file, className, INTERFACE_MASK, imports, path); |
| ... | @@ -209,7 +208,7 @@ public final class JavaFileGenerator { | ... | @@ -209,7 +208,7 @@ public final class JavaFileGenerator { |
| 209 | 208 | ||
| 210 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 209 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 211 | 210 | ||
| 212 | - String className = getCaptialCase(javaFileInfo.getJavaName()); | 211 | + String className = getCapitalCase(javaFileInfo.getJavaName()); |
| 213 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); | 212 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); |
| 214 | 213 | ||
| 215 | initiateJavaFileGeneration(file, className, BUILDER_INTERFACE_MASK, null, path); | 214 | initiateJavaFileGeneration(file, className, BUILDER_INTERFACE_MASK, null, path); |
| ... | @@ -268,7 +267,7 @@ public final class JavaFileGenerator { | ... | @@ -268,7 +267,7 @@ public final class JavaFileGenerator { |
| 268 | 267 | ||
| 269 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 268 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 270 | 269 | ||
| 271 | - String className = getCaptialCase(javaFileInfo.getJavaName()); | 270 | + String className = getCapitalCase(javaFileInfo.getJavaName()); |
| 272 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); | 271 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); |
| 273 | 272 | ||
| 274 | initiateJavaFileGeneration(file, className, BUILDER_CLASS_MASK, imports, path); | 273 | initiateJavaFileGeneration(file, className, BUILDER_CLASS_MASK, imports, path); |
| ... | @@ -343,7 +342,7 @@ public final class JavaFileGenerator { | ... | @@ -343,7 +342,7 @@ public final class JavaFileGenerator { |
| 343 | 342 | ||
| 344 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 343 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 345 | 344 | ||
| 346 | - String className = getCaptialCase(javaFileInfo.getJavaName()); | 345 | + String className = getCapitalCase(javaFileInfo.getJavaName()); |
| 347 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); | 346 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); |
| 348 | 347 | ||
| 349 | initiateJavaFileGeneration(file, className, GENERATE_SERVICE_AND_MANAGER, imports, path); | 348 | initiateJavaFileGeneration(file, className, GENERATE_SERVICE_AND_MANAGER, imports, path); |
| ... | @@ -407,7 +406,7 @@ public final class JavaFileGenerator { | ... | @@ -407,7 +406,7 @@ public final class JavaFileGenerator { |
| 407 | 406 | ||
| 408 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 407 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 409 | 408 | ||
| 410 | - String className = getCaptialCase(javaFileInfo.getJavaName()); | 409 | + String className = getCapitalCase(javaFileInfo.getJavaName()); |
| 411 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); | 410 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); |
| 412 | 411 | ||
| 413 | initiateJavaFileGeneration(file, className, IMPL_CLASS_MASK, null, path); | 412 | initiateJavaFileGeneration(file, className, IMPL_CLASS_MASK, null, path); |
| ... | @@ -517,7 +516,7 @@ public final class JavaFileGenerator { | ... | @@ -517,7 +516,7 @@ public final class JavaFileGenerator { |
| 517 | 516 | ||
| 518 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 517 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 519 | 518 | ||
| 520 | - String className = getCaptialCase(javaFileInfo.getJavaName()); | 519 | + String className = getCapitalCase(javaFileInfo.getJavaName()); |
| 521 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); | 520 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); |
| 522 | 521 | ||
| 523 | initiateJavaFileGeneration(file, className, GENERATE_TYPEDEF_CLASS, imports, path); | 522 | initiateJavaFileGeneration(file, className, GENERATE_TYPEDEF_CLASS, imports, path); |
| ... | @@ -621,7 +620,7 @@ public final class JavaFileGenerator { | ... | @@ -621,7 +620,7 @@ public final class JavaFileGenerator { |
| 621 | 620 | ||
| 622 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 621 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 623 | 622 | ||
| 624 | - String className = getCaptialCase(javaFileInfo.getJavaName()); | 623 | + String className = getCapitalCase(javaFileInfo.getJavaName()); |
| 625 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); | 624 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); |
| 626 | 625 | ||
| 627 | initiateJavaFileGeneration(file, className, GENERATE_UNION_CLASS, imports, path); | 626 | initiateJavaFileGeneration(file, className, GENERATE_UNION_CLASS, imports, path); |
| ... | @@ -725,10 +724,10 @@ public final class JavaFileGenerator { | ... | @@ -725,10 +724,10 @@ public final class JavaFileGenerator { |
| 725 | 724 | ||
| 726 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 725 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 727 | 726 | ||
| 728 | - String className = getCaptialCase(javaFileInfo.getJavaName()); | 727 | + String className = javaFileInfo.getJavaName(); |
| 729 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); | 728 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); |
| 730 | 729 | ||
| 731 | - initiateJavaFileGeneration(file, className, GENERATE_ENUM_CLASS, null, path); | 730 | + initiateJavaFileGeneration(file, getCapitalCase(className), GENERATE_ENUM_CLASS, null, path); |
| 732 | /** | 731 | /** |
| 733 | * Add attribute strings. | 732 | * Add attribute strings. |
| 734 | */ | 733 | */ |
| ... | @@ -739,7 +738,7 @@ public final class JavaFileGenerator { | ... | @@ -739,7 +738,7 @@ public final class JavaFileGenerator { |
| 739 | .getTempJavaCodeFragmentFiles().getEnumerationTempFiles()), COMMA), NEW_LINE) | 738 | .getTempJavaCodeFragmentFiles().getEnumerationTempFiles()), COMMA), NEW_LINE) |
| 740 | + SEMI_COLAN + NEW_LINE); | 739 | + SEMI_COLAN + NEW_LINE); |
| 741 | } catch (IOException e) { | 740 | } catch (IOException e) { |
| 742 | - throw new IOException("No data found in temporary java code fragment files for " + className | 741 | + throw new IOException("No data found in temporary java code fragment files for " + getCapitalCase(className) |
| 743 | + " while enum class file generation"); | 742 | + " while enum class file generation"); |
| 744 | } | 743 | } |
| 745 | 744 | ||
| ... | @@ -747,13 +746,13 @@ public final class JavaFileGenerator { | ... | @@ -747,13 +746,13 @@ public final class JavaFileGenerator { |
| 747 | * Add an | 746 | * Add an |
| 748 | * attribute to get the enum's values. | 747 | * attribute to get the enum's values. |
| 749 | */ | 748 | */ |
| 750 | - insertDataIntoJavaFile(file, getEnumsValueAttribute(className)); | 749 | + insertDataIntoJavaFile(file, getEnumsValueAttribute(getCapitalCase(className))); |
| 751 | 750 | ||
| 752 | /** | 751 | /** |
| 753 | * Add a constructor for enum. | 752 | * Add a constructor for enum. |
| 754 | */ | 753 | */ |
| 755 | - insertDataIntoJavaFile(file, getJavaDoc(TYPE_CONSTRUCTOR, getSmallCase(className), false) | 754 | + insertDataIntoJavaFile(file, getJavaDoc(TYPE_CONSTRUCTOR, className, false) |
| 756 | - + getEnumsConstrcutor(className) + NEW_LINE); | 755 | + + getEnumsConstrcutor(getCapitalCase(className)) + NEW_LINE); |
| 757 | 756 | ||
| 758 | TempJavaEnumerationFragmentFiles enumFragFiles = | 757 | TempJavaEnumerationFragmentFiles enumFragFiles = |
| 759 | ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles() | 758 | ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles() |
| ... | @@ -767,18 +766,18 @@ public final class JavaFileGenerator { | ... | @@ -767,18 +766,18 @@ public final class JavaFileGenerator { |
| 767 | /** | 766 | /** |
| 768 | * Add a getter method for enum. | 767 | * Add a getter method for enum. |
| 769 | */ | 768 | */ |
| 770 | - insertDataIntoJavaFile(file, getJavaDoc(GETTER_METHOD, getSmallCase(className), false) | 769 | + insertDataIntoJavaFile(file, getJavaDoc(GETTER_METHOD, className, false) |
| 771 | - + getGetter(INT, getSmallCase(className), GENERATE_ENUM_CLASS) + NEW_LINE); | 770 | + + getGetter(INT, className, GENERATE_ENUM_CLASS) + NEW_LINE); |
| 772 | 771 | ||
| 773 | try { | 772 | try { |
| 774 | - insertDataIntoJavaFile(file, getFromStringMethodSignature(className) | 773 | + insertDataIntoJavaFile(file, getFromStringMethodSignature(getCapitalCase(className)) |
| 775 | + getDataFromTempFileHandle(FROM_STRING_IMPL_MASK, | 774 | + getDataFromTempFileHandle(FROM_STRING_IMPL_MASK, |
| 776 | ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles() | 775 | ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles() |
| 777 | .getEnumerationTempFiles()) | 776 | .getEnumerationTempFiles()) |
| 778 | + getFromStringMethodClose()); | 777 | + getFromStringMethodClose()); |
| 779 | } catch (IOException e) { | 778 | } catch (IOException e) { |
| 780 | - throw new IOException("No data found in temporary java code fragment files for " + className | 779 | + throw new IOException("No data found in temporary java code fragment files for " + |
| 781 | - + " while enum class file generation"); | 780 | + getCapitalCase(className) + " while enum class file generation"); |
| 782 | } | 781 | } |
| 783 | 782 | ||
| 784 | insertDataIntoJavaFile(file, CLOSE_CURLY_BRACKET + NEW_LINE); | 783 | insertDataIntoJavaFile(file, CLOSE_CURLY_BRACKET + NEW_LINE); |
| ... | @@ -802,7 +801,7 @@ public final class JavaFileGenerator { | ... | @@ -802,7 +801,7 @@ public final class JavaFileGenerator { |
| 802 | 801 | ||
| 803 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 802 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 804 | 803 | ||
| 805 | - String className = getCaptialCase(javaFileInfo.getJavaName()) + SERVICE_METHOD_STRING; | 804 | + String className = getCapitalCase(javaFileInfo.getJavaName()) + SERVICE_METHOD_STRING; |
| 806 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); | 805 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); |
| 807 | 806 | ||
| 808 | initiateJavaFileGeneration(file, className, GENERATE_SERVICE_AND_MANAGER, imports, path); | 807 | initiateJavaFileGeneration(file, className, GENERATE_SERVICE_AND_MANAGER, imports, path); |
| ... | @@ -859,7 +858,7 @@ public final class JavaFileGenerator { | ... | @@ -859,7 +858,7 @@ public final class JavaFileGenerator { |
| 859 | 858 | ||
| 860 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 859 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 861 | 860 | ||
| 862 | - String className = getCaptialCase(javaFileInfo.getJavaName()) + EVENT_STRING; | 861 | + String className = getCapitalCase(javaFileInfo.getJavaName()) + EVENT_STRING; |
| 863 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); | 862 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); |
| 864 | 863 | ||
| 865 | initiateJavaFileGeneration(file, className, GENERATE_EVENT_CLASS, imports, path); | 864 | initiateJavaFileGeneration(file, className, GENERATE_EVENT_CLASS, imports, path); |
| ... | @@ -913,7 +912,7 @@ public final class JavaFileGenerator { | ... | @@ -913,7 +912,7 @@ public final class JavaFileGenerator { |
| 913 | 912 | ||
| 914 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 913 | JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 915 | 914 | ||
| 916 | - String className = getCaptialCase(javaFileInfo.getJavaName()) + EVENT_LISTENER_STRING; | 915 | + String className = getCapitalCase(javaFileInfo.getJavaName()) + EVENT_LISTENER_STRING; |
| 917 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); | 916 | String path = javaFileInfo.getBaseCodeGenPath() + javaFileInfo.getPackageFilePath(); |
| 918 | 917 | ||
| 919 | initiateJavaFileGeneration(file, className, GENERATE_EVENT_LISTENER_INTERFACE, imports, path); | 918 | initiateJavaFileGeneration(file, className, GENERATE_EVENT_LISTENER_INTERFACE, imports, path); | ... | ... |
| ... | @@ -17,6 +17,7 @@ | ... | @@ -17,6 +17,7 @@ |
| 17 | package org.onosproject.yangutils.translator.tojava.utils; | 17 | package org.onosproject.yangutils.translator.tojava.utils; |
| 18 | 18 | ||
| 19 | import java.util.ArrayList; | 19 | import java.util.ArrayList; |
| 20 | +import java.util.Arrays; | ||
| 20 | import java.util.List; | 21 | import java.util.List; |
| 21 | 22 | ||
| 22 | import org.onosproject.yangutils.datamodel.YangNode; | 23 | import org.onosproject.yangutils.datamodel.YangNode; |
| ... | @@ -39,6 +40,10 @@ import static org.onosproject.yangutils.utils.UtilConstants.REGEX_FOR_PERIOD; | ... | @@ -39,6 +40,10 @@ import static org.onosproject.yangutils.utils.UtilConstants.REGEX_FOR_PERIOD; |
| 39 | import static org.onosproject.yangutils.utils.UtilConstants.REGEX_FOR_SINGLE_LETTER; | 40 | import static org.onosproject.yangutils.utils.UtilConstants.REGEX_FOR_SINGLE_LETTER; |
| 40 | import static org.onosproject.yangutils.utils.UtilConstants.REGEX_FOR_UNDERSCORE; | 41 | import static org.onosproject.yangutils.utils.UtilConstants.REGEX_FOR_UNDERSCORE; |
| 41 | import static org.onosproject.yangutils.utils.UtilConstants.REGEX_WITH_ALL_SPECIAL_CHAR; | 42 | import static org.onosproject.yangutils.utils.UtilConstants.REGEX_WITH_ALL_SPECIAL_CHAR; |
| 43 | +import static org.onosproject.yangutils.utils.UtilConstants.REGEX_WITH_DIGITS; | ||
| 44 | +import static org.onosproject.yangutils.utils.UtilConstants.REGEX_WITH_SINGLE_CAPITAL_CASE; | ||
| 45 | +import static org.onosproject.yangutils.utils.UtilConstants.REGEX_WITH_SINGLE_CAPITAL_CASE_AND_DIGITS_SMALL_CASES; | ||
| 46 | +import static org.onosproject.yangutils.utils.UtilConstants.REGEX_WITH_UPPERCASE; | ||
| 42 | import static org.onosproject.yangutils.utils.UtilConstants.REVISION_PREFIX; | 47 | import static org.onosproject.yangutils.utils.UtilConstants.REVISION_PREFIX; |
| 43 | import static org.onosproject.yangutils.utils.UtilConstants.SLASH; | 48 | import static org.onosproject.yangutils.utils.UtilConstants.SLASH; |
| 44 | import static org.onosproject.yangutils.utils.UtilConstants.UNDER_SCORE; | 49 | import static org.onosproject.yangutils.utils.UtilConstants.UNDER_SCORE; |
| ... | @@ -231,7 +236,7 @@ public final class JavaIdentifierSyntax { | ... | @@ -231,7 +236,7 @@ public final class JavaIdentifierSyntax { |
| 231 | * Returns the YANG identifier name as java identifier. | 236 | * Returns the YANG identifier name as java identifier. |
| 232 | * | 237 | * |
| 233 | * @param yangIdentifier identifier in YANG file | 238 | * @param yangIdentifier identifier in YANG file |
| 234 | - * @param conflictResolver object of YANG to java naming confilct util | 239 | + * @param conflictResolver object of YANG to java naming conflict util |
| 235 | * @return corresponding java identifier | 240 | * @return corresponding java identifier |
| 236 | */ | 241 | */ |
| 237 | public static String getCamelCase(String yangIdentifier, YangToJavaNamingConflictUtil conflictResolver) { | 242 | public static String getCamelCase(String yangIdentifier, YangToJavaNamingConflictUtil conflictResolver) { |
| ... | @@ -262,7 +267,57 @@ public final class JavaIdentifierSyntax { | ... | @@ -262,7 +267,57 @@ public final class JavaIdentifierSyntax { |
| 262 | } | 267 | } |
| 263 | strArray = stringArrangement.toArray(new String[stringArrangement.size()]); | 268 | strArray = stringArrangement.toArray(new String[stringArrangement.size()]); |
| 264 | } | 269 | } |
| 265 | - return applyCamelCaseRule(strArray); | 270 | + return upperCaseConflictResolver(strArray); |
| 271 | + } | ||
| 272 | + | ||
| 273 | + /** | ||
| 274 | + * Resolves the conflict when input has uppercase. | ||
| 275 | + * | ||
| 276 | + * @param stringArray containing strings for uppercase conflict resolver | ||
| 277 | + * @return camel cased string | ||
| 278 | + */ | ||
| 279 | + private static String upperCaseConflictResolver(String[] stringArray) { | ||
| 280 | + | ||
| 281 | + for (int l = 0; l < stringArray.length; l++) { | ||
| 282 | + String[] upperCaseSplitArray = stringArray[l].split(REGEX_WITH_UPPERCASE); | ||
| 283 | + for (int m = 0; m < upperCaseSplitArray.length; m++) { | ||
| 284 | + if (upperCaseSplitArray[m].matches(REGEX_WITH_SINGLE_CAPITAL_CASE)) { | ||
| 285 | + int check = m; | ||
| 286 | + while (check + 1 < upperCaseSplitArray.length) { | ||
| 287 | + if (upperCaseSplitArray[check + 1].matches(REGEX_WITH_SINGLE_CAPITAL_CASE)) { | ||
| 288 | + upperCaseSplitArray[check + 1] = upperCaseSplitArray[check + 1].toLowerCase(); | ||
| 289 | + check = check + 1; | ||
| 290 | + } else if (upperCaseSplitArray[check + 1] | ||
| 291 | + .matches(REGEX_WITH_SINGLE_CAPITAL_CASE_AND_DIGITS_SMALL_CASES)) { | ||
| 292 | + upperCaseSplitArray[check + 1] = upperCaseSplitArray[check + 1].toLowerCase(); | ||
| 293 | + break; | ||
| 294 | + } else { | ||
| 295 | + break; | ||
| 296 | + } | ||
| 297 | + } | ||
| 298 | + } | ||
| 299 | + } | ||
| 300 | + StringBuilder strBuilder = new StringBuilder(); | ||
| 301 | + for (String element : upperCaseSplitArray) { | ||
| 302 | + strBuilder.append(element); | ||
| 303 | + } | ||
| 304 | + stringArray[l] = strBuilder.toString(); | ||
| 305 | + } | ||
| 306 | + List<String> result = new ArrayList<String>(); | ||
| 307 | + for (String element : stringArray) { | ||
| 308 | + String[] capitalCaseSplitArray = element.split(REGEX_WITH_UPPERCASE); | ||
| 309 | + for (String letter : capitalCaseSplitArray) { | ||
| 310 | + String[] arrayForAddition = letter.split(REGEX_WITH_DIGITS); | ||
| 311 | + List<String> list = Arrays.asList(arrayForAddition); | ||
| 312 | + for (String str : list) { | ||
| 313 | + if (str != null && !str.isEmpty()) { | ||
| 314 | + result.add(str); | ||
| 315 | + } | ||
| 316 | + } | ||
| 317 | + } | ||
| 318 | + } | ||
| 319 | + stringArray = result.toArray(new String[result.size()]); | ||
| 320 | + return applyCamelCaseRule(stringArray); | ||
| 266 | } | 321 | } |
| 267 | 322 | ||
| 268 | /** | 323 | /** |
| ... | @@ -270,11 +325,11 @@ public final class JavaIdentifierSyntax { | ... | @@ -270,11 +325,11 @@ public final class JavaIdentifierSyntax { |
| 270 | * the letter next to a number in an array. | 325 | * the letter next to a number in an array. |
| 271 | * | 326 | * |
| 272 | * @param stringArray containing strings for camel case separation | 327 | * @param stringArray containing strings for camel case separation |
| 273 | - * @return camel cased string | 328 | + * @return camel case rule checked string |
| 274 | */ | 329 | */ |
| 275 | - public static String applyCamelCaseRule(String[] stringArray) { | 330 | + private static String applyCamelCaseRule(String[] stringArray) { |
| 276 | 331 | ||
| 277 | - String ruleChecker = stringArray[0]; | 332 | + String ruleChecker = stringArray[0].toLowerCase(); |
| 278 | int i; | 333 | int i; |
| 279 | if (ruleChecker.matches(REGEX_FOR_FIRST_DIGIT)) { | 334 | if (ruleChecker.matches(REGEX_FOR_FIRST_DIGIT)) { |
| 280 | i = 0; | 335 | i = 0; |
| ... | @@ -286,7 +341,7 @@ public final class JavaIdentifierSyntax { | ... | @@ -286,7 +341,7 @@ public final class JavaIdentifierSyntax { |
| 286 | if ((i + 1) == stringArray.length) { | 341 | if ((i + 1) == stringArray.length) { |
| 287 | if (stringArray[i].matches(REGEX_FOR_SINGLE_LETTER) | 342 | if (stringArray[i].matches(REGEX_FOR_SINGLE_LETTER) |
| 288 | || stringArray[i].matches(REGEX_FOR_DIGITS_WITH_SINGLE_LETTER)) { | 343 | || stringArray[i].matches(REGEX_FOR_DIGITS_WITH_SINGLE_LETTER)) { |
| 289 | - ruleChecker = ruleChecker + stringArray[i]; | 344 | + ruleChecker = ruleChecker + stringArray[i].toLowerCase(); |
| 290 | break; | 345 | break; |
| 291 | } | 346 | } |
| 292 | } | 347 | } |
| ... | @@ -311,19 +366,19 @@ public final class JavaIdentifierSyntax { | ... | @@ -311,19 +366,19 @@ public final class JavaIdentifierSyntax { |
| 311 | /** | 366 | /** |
| 312 | * Adds prefix YANG auto prefix if the string begins with digit or is a java key word. | 367 | * Adds prefix YANG auto prefix if the string begins with digit or is a java key word. |
| 313 | * | 368 | * |
| 314 | - * @param camelCasePrefixer string for adding prefix | 369 | + * @param camelCasePrefix string for adding prefix |
| 315 | * @return prefixed camel case string | 370 | * @return prefixed camel case string |
| 316 | */ | 371 | */ |
| 317 | - public static String addPrefix(String camelCasePrefixer) { | 372 | + private static String addPrefix(String camelCasePrefix) { |
| 318 | 373 | ||
| 319 | - if (camelCasePrefixer.matches(REGEX_FOR_FIRST_DIGIT)) { | 374 | + if (camelCasePrefix.matches(REGEX_FOR_FIRST_DIGIT)) { |
| 320 | - camelCasePrefixer = YANG_AUTO_PREFIX + camelCasePrefixer; | 375 | + camelCasePrefix = YANG_AUTO_PREFIX + camelCasePrefix; |
| 321 | } | 376 | } |
| 322 | - if (JAVA_KEY_WORDS.contains(camelCasePrefixer)) { | 377 | + if (JAVA_KEY_WORDS.contains(camelCasePrefix.toLowerCase())) { |
| 323 | - camelCasePrefixer = YANG_AUTO_PREFIX + camelCasePrefixer.substring(0, 1).toUpperCase() | 378 | + camelCasePrefix = YANG_AUTO_PREFIX + camelCasePrefix.substring(0, 1).toUpperCase() |
| 324 | - + camelCasePrefixer.substring(1); | 379 | + + camelCasePrefix.substring(1); |
| 325 | } | 380 | } |
| 326 | - return camelCasePrefixer; | 381 | + return camelCasePrefix; |
| 327 | } | 382 | } |
| 328 | 383 | ||
| 329 | /** | 384 | /** |
| ... | @@ -332,7 +387,7 @@ public final class JavaIdentifierSyntax { | ... | @@ -332,7 +387,7 @@ public final class JavaIdentifierSyntax { |
| 332 | * @param consecCapitalCaseRemover which requires the restriction of consecutive capital case | 387 | * @param consecCapitalCaseRemover which requires the restriction of consecutive capital case |
| 333 | * @return string without consecutive capital case | 388 | * @return string without consecutive capital case |
| 334 | */ | 389 | */ |
| 335 | - public static String restrictConsecutiveCapitalCase(String consecCapitalCaseRemover) { | 390 | + private static String restrictConsecutiveCapitalCase(String consecCapitalCaseRemover) { |
| 336 | 391 | ||
| 337 | for (int k = 0; k < consecCapitalCaseRemover.length(); k++) { | 392 | for (int k = 0; k < consecCapitalCaseRemover.length(); k++) { |
| 338 | if (k + 1 < consecCapitalCaseRemover.length()) { | 393 | if (k + 1 < consecCapitalCaseRemover.length()) { |
| ... | @@ -350,13 +405,14 @@ public final class JavaIdentifierSyntax { | ... | @@ -350,13 +405,14 @@ public final class JavaIdentifierSyntax { |
| 350 | 405 | ||
| 351 | /** | 406 | /** |
| 352 | * Returns the YANG identifier name as java identifier with first letter | 407 | * Returns the YANG identifier name as java identifier with first letter |
| 353 | - * in caps. | 408 | + * in capital. |
| 354 | * | 409 | * |
| 355 | * @param yangIdentifier identifier in YANG file | 410 | * @param yangIdentifier identifier in YANG file |
| 356 | * @return corresponding java identifier | 411 | * @return corresponding java identifier |
| 357 | */ | 412 | */ |
| 358 | - public static String getCaptialCase(String yangIdentifier) { | 413 | + public static String getCapitalCase(String yangIdentifier) { |
| 359 | - return yangIdentifier.substring(0, 1).toUpperCase() + yangIdentifier.substring(1); | 414 | + yangIdentifier = yangIdentifier.substring(0, 1).toUpperCase() + yangIdentifier.substring(1); |
| 415 | + return restrictConsecutiveCapitalCase(yangIdentifier); | ||
| 360 | } | 416 | } |
| 361 | 417 | ||
| 362 | /** | 418 | /** | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -40,7 +40,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.isRpcChil | ... | @@ -40,7 +40,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.isRpcChil |
| 40 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER; | 40 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER; |
| 41 | import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.addCurNodeInfoInParentTempFile; | 41 | import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.addCurNodeInfoInParentTempFile; |
| 42 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; | 42 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; |
| 43 | -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase; | 43 | +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; |
| 44 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCurNodePackage; | 44 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCurNodePackage; |
| 45 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage; | 45 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage; |
| 46 | import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED_INFO; | 46 | import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED_INFO; |
| ... | @@ -69,9 +69,8 @@ public final class YangJavaModelUtils { | ... | @@ -69,9 +69,8 @@ public final class YangJavaModelUtils { |
| 69 | YangPluginConfig yangPluginConfig) | 69 | YangPluginConfig yangPluginConfig) |
| 70 | throws IOException { | 70 | throws IOException { |
| 71 | javaCodeGeneratorInfo.getJavaFileInfo() | 71 | javaCodeGeneratorInfo.getJavaFileInfo() |
| 72 | - .setJavaName(getCaptialCase( | 72 | + .setJavaName(getCamelCase(((YangNode) javaCodeGeneratorInfo).getName(), |
| 73 | - getCamelCase(((YangNode) javaCodeGeneratorInfo).getName(), | 73 | + yangPluginConfig.getConflictResolver())); |
| 74 | - yangPluginConfig.getConflictResolver()))); | ||
| 75 | javaCodeGeneratorInfo.getJavaFileInfo().setPackage(getCurNodePackage((YangNode) javaCodeGeneratorInfo)); | 74 | javaCodeGeneratorInfo.getJavaFileInfo().setPackage(getCurNodePackage((YangNode) javaCodeGeneratorInfo)); |
| 76 | javaCodeGeneratorInfo.getJavaFileInfo().setPackageFilePath( | 75 | javaCodeGeneratorInfo.getJavaFileInfo().setPackageFilePath( |
| 77 | getPackageDirPathFromJavaJPackage(javaCodeGeneratorInfo.getJavaFileInfo().getPackage())); | 76 | getPackageDirPathFromJavaJPackage(javaCodeGeneratorInfo.getJavaFileInfo().getPackage())); |
| ... | @@ -89,8 +88,8 @@ public final class YangJavaModelUtils { | ... | @@ -89,8 +88,8 @@ public final class YangJavaModelUtils { |
| 89 | String pkg) | 88 | String pkg) |
| 90 | throws IOException { | 89 | throws IOException { |
| 91 | javaCodeGeneratorInfo.getJavaFileInfo() | 90 | javaCodeGeneratorInfo.getJavaFileInfo() |
| 92 | - .setJavaName(getCaptialCase( | 91 | + .setJavaName(getCamelCase(((YangNode) javaCodeGeneratorInfo).getName(), |
| 93 | - getCamelCase(((YangNode) javaCodeGeneratorInfo).getName(), yangPlugin.getConflictResolver()))); | 92 | + yangPlugin.getConflictResolver())); |
| 94 | javaCodeGeneratorInfo.getJavaFileInfo().setPackage(pkg); | 93 | javaCodeGeneratorInfo.getJavaFileInfo().setPackage(pkg); |
| 95 | javaCodeGeneratorInfo.getJavaFileInfo().setPackageFilePath( | 94 | javaCodeGeneratorInfo.getJavaFileInfo().setPackageFilePath( |
| 96 | getPackageDirPathFromJavaJPackage(javaCodeGeneratorInfo.getJavaFileInfo().getPackage())); | 95 | getPackageDirPathFromJavaJPackage(javaCodeGeneratorInfo.getJavaFileInfo().getPackage())); |
| ... | @@ -236,7 +235,7 @@ public final class YangJavaModelUtils { | ... | @@ -236,7 +235,7 @@ public final class YangJavaModelUtils { |
| 236 | YangNode parent = ((YangCase) javaCodeGeneratorInfo).getParent(); | 235 | YangNode parent = ((YangCase) javaCodeGeneratorInfo).getParent(); |
| 237 | String curNodeName = ((YangCase) javaCodeGeneratorInfo).getName(); | 236 | String curNodeName = ((YangCase) javaCodeGeneratorInfo).getName(); |
| 238 | if (!parent.getName().equals(curNodeName)) { | 237 | if (!parent.getName().equals(curNodeName)) { |
| 239 | - javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().addToExtendsList(getCaptialCase(getCamelCase( | 238 | + javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().addToExtendsList(getCapitalCase(getCamelCase( |
| 240 | parent.getName(), null))); | 239 | parent.getName(), null))); |
| 241 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().getBeanTempFiles() | 240 | javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().getBeanTempFiles() |
| 242 | .addParentInfoInCurNodeTempFile((YangNode) javaCodeGeneratorInfo); | 241 | .addParentInfoInCurNodeTempFile((YangNode) javaCodeGeneratorInfo); | ... | ... |
| ... | @@ -687,6 +687,11 @@ public final class UtilConstants { | ... | @@ -687,6 +687,11 @@ public final class UtilConstants { |
| 687 | public static final String REGEX_FOR_FIRST_DIGIT = "\\d.*"; | 687 | public static final String REGEX_FOR_FIRST_DIGIT = "\\d.*"; |
| 688 | 688 | ||
| 689 | /** | 689 | /** |
| 690 | + * Static attribute for regex with digits. | ||
| 691 | + */ | ||
| 692 | + public static final String REGEX_WITH_DIGITS = "(?=\\d+)"; | ||
| 693 | + | ||
| 694 | + /** | ||
| 690 | * Static attribute for regex for single letter. | 695 | * Static attribute for regex for single letter. |
| 691 | */ | 696 | */ |
| 692 | public static final String REGEX_FOR_SINGLE_LETTER = "[a-zA-Z]"; | 697 | public static final String REGEX_FOR_SINGLE_LETTER = "[a-zA-Z]"; |
| ... | @@ -697,6 +702,21 @@ public final class UtilConstants { | ... | @@ -697,6 +702,21 @@ public final class UtilConstants { |
| 697 | public static final String REGEX_FOR_DIGITS_WITH_SINGLE_LETTER = "[0-9]+[a-zA-Z]"; | 702 | public static final String REGEX_FOR_DIGITS_WITH_SINGLE_LETTER = "[0-9]+[a-zA-Z]"; |
| 698 | 703 | ||
| 699 | /** | 704 | /** |
| 705 | + * 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 | + /** | ||
| 700 | * Static attribute for class syntax. | 720 | * Static attribute for class syntax. |
| 701 | */ | 721 | */ |
| 702 | public static final String CLASS = "class"; | 722 | public static final String CLASS = "class"; | ... | ... |
| ... | @@ -25,7 +25,7 @@ import static org.hamcrest.core.Is.is; | ... | @@ -25,7 +25,7 @@ import static org.hamcrest.core.Is.is; |
| 25 | import static org.hamcrest.core.IsNot.not; | 25 | import static org.hamcrest.core.IsNot.not; |
| 26 | import static org.junit.Assert.assertThat; | 26 | import static org.junit.Assert.assertThat; |
| 27 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; | 27 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase; |
| 28 | -import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCaptialCase; | 28 | +import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase; |
| 29 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getJavaPackageFromPackagePath; | 29 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getJavaPackageFromPackagePath; |
| 30 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage; | 30 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage; |
| 31 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage; | 31 | import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage; |
| ... | @@ -61,6 +61,22 @@ public final class JavaIdentifierSyntaxTest { | ... | @@ -61,6 +61,22 @@ public final class JavaIdentifierSyntaxTest { |
| 61 | private static final String WITH_CAMEL_CASE3 = "yangAutoPrefix1123G123Gaa"; | 61 | private static final String WITH_CAMEL_CASE3 = "yangAutoPrefix1123G123Gaa"; |
| 62 | private static final String WITHOUT_CAMEL_CASE4 = "a-b-c-d-e-f-g-h"; | 62 | private static final String WITHOUT_CAMEL_CASE4 = "a-b-c-d-e-f-g-h"; |
| 63 | private static final String WITH_CAMEL_CASE4 = "aBcDeFgh"; | 63 | private static final String WITH_CAMEL_CASE4 = "aBcDeFgh"; |
| 64 | + private static final String WITHOUT_CAMEL_CASE5 = "TestName"; | ||
| 65 | + private static final String WITH_CAMEL_CASE5 = "testName"; | ||
| 66 | + private static final String WITHOUT_CAMEL_CASE6 = "TEST-NAME"; | ||
| 67 | + private static final String WITH_CAMEL_CASE6 = "testName"; | ||
| 68 | + private static final String WITHOUT_CAMEL_CASE7 = "TESTNAME"; | ||
| 69 | + private static final String WITH_CAMEL_CASE7 = "testname"; | ||
| 70 | + private static final String WITHOUT_CAMEL_CASE8 = "TE-ST-NA-ME"; | ||
| 71 | + private static final String WITH_CAMEL_CASE8 = "teStNaMe"; | ||
| 72 | + private static final String WITHOUT_CAMEL_CASE9 = "TEST3NAME"; | ||
| 73 | + private static final String WITH_CAMEL_CASE9 = "test3Name"; | ||
| 74 | + private static final String WITHOUT_CAMEL_CASE10 = "TEST3"; | ||
| 75 | + private static final String WITH_CAMEL_CASE10 = "test3"; | ||
| 76 | + private static final String WITHOUT_CAMEL_CASE11 = "TEST3nAMe"; | ||
| 77 | + private static final String WITH_CAMEL_CASE11 = "test3Name"; | ||
| 78 | + private static final String WITHOUT_CAMEL_CASE12 = "TEST3name"; | ||
| 79 | + private static final String WITH_CAMEL_CASE12 = "test3Name"; | ||
| 64 | private static final String WITHOUT_CAPITAL = "test_this"; | 80 | private static final String WITHOUT_CAPITAL = "test_this"; |
| 65 | private static final String WITH_CAPITAL = "Test_this"; | 81 | private static final String WITH_CAPITAL = "Test_this"; |
| 66 | private static final String WITH_SMALL = "test_this"; | 82 | private static final String WITH_SMALL = "test_this"; |
| ... | @@ -129,7 +145,7 @@ public final class JavaIdentifierSyntaxTest { | ... | @@ -129,7 +145,7 @@ public final class JavaIdentifierSyntaxTest { |
| 129 | */ | 145 | */ |
| 130 | @Test | 146 | @Test |
| 131 | public void getCapitalCaseTest() { | 147 | public void getCapitalCaseTest() { |
| 132 | - String capitalCase = getCaptialCase(WITHOUT_CAPITAL); | 148 | + String capitalCase = getCapitalCase(WITHOUT_CAPITAL); |
| 133 | assertThat(capitalCase.equals(WITH_CAPITAL), is(true)); | 149 | assertThat(capitalCase.equals(WITH_CAPITAL), is(true)); |
| 134 | } | 150 | } |
| 135 | 151 | ||
| ... | @@ -148,6 +164,22 @@ public final class JavaIdentifierSyntaxTest { | ... | @@ -148,6 +164,22 @@ public final class JavaIdentifierSyntaxTest { |
| 148 | assertThat(camelCase3.equals(WITH_CAMEL_CASE3), is(true)); | 164 | assertThat(camelCase3.equals(WITH_CAMEL_CASE3), is(true)); |
| 149 | String camelCase4 = getCamelCase(WITHOUT_CAMEL_CASE4, null); | 165 | String camelCase4 = getCamelCase(WITHOUT_CAMEL_CASE4, null); |
| 150 | assertThat(camelCase4.equals(WITH_CAMEL_CASE4), is(true)); | 166 | assertThat(camelCase4.equals(WITH_CAMEL_CASE4), is(true)); |
| 167 | + String camelCase5 = getCamelCase(WITHOUT_CAMEL_CASE5, null); | ||
| 168 | + assertThat(camelCase5.equals(WITH_CAMEL_CASE5), is(true)); | ||
| 169 | + String camelCase6 = getCamelCase(WITHOUT_CAMEL_CASE6, null); | ||
| 170 | + assertThat(camelCase6.equals(WITH_CAMEL_CASE6), is(true)); | ||
| 171 | + String camelCase7 = getCamelCase(WITHOUT_CAMEL_CASE7, null); | ||
| 172 | + assertThat(camelCase7.equals(WITH_CAMEL_CASE7), is(true)); | ||
| 173 | + String camelCase8 = getCamelCase(WITHOUT_CAMEL_CASE8, null); | ||
| 174 | + assertThat(camelCase8.equals(WITH_CAMEL_CASE8), is(true)); | ||
| 175 | + String camelCase9 = getCamelCase(WITHOUT_CAMEL_CASE9, null); | ||
| 176 | + assertThat(camelCase9.equals(WITH_CAMEL_CASE9), is(true)); | ||
| 177 | + String camelCase10 = getCamelCase(WITHOUT_CAMEL_CASE10, null); | ||
| 178 | + assertThat(camelCase10.equals(WITH_CAMEL_CASE10), is(true)); | ||
| 179 | + String camelCase11 = getCamelCase(WITHOUT_CAMEL_CASE11, null); | ||
| 180 | + assertThat(camelCase11.equals(WITH_CAMEL_CASE11), is(true)); | ||
| 181 | + String camelCase12 = getCamelCase(WITHOUT_CAMEL_CASE12, null); | ||
| 182 | + assertThat(camelCase12.equals(WITH_CAMEL_CASE12), is(true)); | ||
| 151 | } | 183 | } |
| 152 | 184 | ||
| 153 | /** | 185 | /** | ... | ... |
-
Please register or login to post a comment