--- a/make/jdk/src/classes/build/tools/cldrconverter/LDMLParseHandler.java Thu Oct 17 20:27:44 2019 +0100
+++ b/make/jdk/src/classes/build/tools/cldrconverter/LDMLParseHandler.java Thu Oct 17 20:53:35 2019 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -508,7 +508,8 @@
String type = attributes.getValue("type");
if (null == type) {
// format data for decimal number format
- pushStringEntry(qName, attributes, "NumberPatterns/decimal");
+ pushStringEntry(qName, attributes,
+ currentNumberingSystem + "NumberPatterns/decimal");
currentStyle = type;
} else {
switch (type) {
@@ -586,6 +587,18 @@
pushContainer(qName, attributes);
}
break;
+ case "currencyFormats":
+ case "decimalFormats":
+ case "percentFormats":
+ {
+ String script = attributes.getValue("numberSystem");
+ if (script != null) {
+ addNumberingScript(script);
+ currentNumberingSystem = script + ".";
+ }
+ pushContainer(qName, attributes);
+ }
+ break;
case "currencyFormatLength":
if (attributes.getValue("type") == null) {
// skipping type="short" data
@@ -596,19 +609,27 @@
}
break;
case "currencyFormat":
- // for FormatData
- // copy string for later assembly into NumberPatterns
- if (attributes.getValue("type").equals("standard")) {
- pushStringEntry(qName, attributes, "NumberPatterns/currency");
- } else {
- pushIgnoredContainer(qName);
+ {
+ // for FormatData
+ // copy string for later assembly into NumberPatterns
+ String cfStyle = attributes.getValue("type");
+ if (cfStyle.equals("standard")) {
+ pushStringEntry(qName, attributes,
+ currentNumberingSystem + "NumberPatterns/currency");
+ } else if (cfStyle.equals("accounting")) {
+ pushStringEntry(qName, attributes,
+ currentNumberingSystem + "NumberPatterns/accounting");
+ } else {
+ pushIgnoredContainer(qName);
+ }
}
break;
case "percentFormat":
// for FormatData
// copy string for later assembly into NumberPatterns
if (attributes.getValue("type").equals("standard")) {
- pushStringEntry(qName, attributes, "NumberPatterns/percent");
+ pushStringEntry(qName, attributes,
+ currentNumberingSystem + "NumberPatterns/percent");
} else {
pushIgnoredContainer(qName);
}
@@ -636,13 +657,7 @@
break;
}
- @SuppressWarnings("unchecked")
- List<String> numberingScripts = (List<String>) get("numberingScripts");
- if (numberingScripts == null) {
- numberingScripts = new ArrayList<>();
- put("numberingScripts", numberingScripts);
- }
- numberingScripts.add(script);
+ addNumberingScript(script);
put(currentNumberingSystem + "NumberElements/zero", digits.substring(0, 1));
pushContainer(qName, attributes);
}
@@ -1015,6 +1030,13 @@
compactCount = "";
putIfEntry();
break;
+ case "currencyFormats":
+ case "decimalFormats":
+ case "percentFormats":
+ case "symbols":
+ currentNumberingSystem = "";
+ putIfEntry();
+ break;
default:
putIfEntry();
}
@@ -1081,4 +1103,16 @@
return key;
}
}
+
+ private void addNumberingScript(String script) {
+ @SuppressWarnings("unchecked")
+ List<String> numberingScripts = (List<String>) get("numberingScripts");
+ if (numberingScripts == null) {
+ numberingScripts = new ArrayList<>();
+ put("numberingScripts", numberingScripts);
+ }
+ if (!numberingScripts.contains(script)) {
+ numberingScripts.add(script);
+ }
+ }
}