diff --git a/utils/src/main/groovy/ConvertXML2Json.groovy b/utils/src/main/groovy/ConvertXML2Json.groovy index 1b48a41..40211d1 100644 --- a/utils/src/main/groovy/ConvertXML2Json.groovy +++ b/utils/src/main/groovy/ConvertXML2Json.groovy @@ -99,12 +99,26 @@ Property createProperty (attribute) { case "LAYOUT_WEIGHT": type = "float"; break; + case "SCALETYPE": + value = splitCamelCase(value).replaceAll(" ", "_"); + break; } return new Property( name, type, value ); } +String splitCamelCase(String s) { + return s.replaceAll( + String.format("%s|%s|%s", + "(?<=[A-Z])(?=[A-Z][a-z])", + "(?<=[^A-Z])(?=[A-Z])", + "(?<=[A-Za-z])(?=[^A-Za-z])" + ), + " " + ); +} + @groovy.transform.Canonical @groovy.transform.ToString(excludes='views') class View {