author | naoto |
Wed, 07 Aug 2019 14:56:26 -0700 | |
changeset 57679 | 314e62bbdb16 |
parent 52869 | c5c0db0b7c2f |
child 58058 | b553ad95acf0 |
permissions | -rw-r--r-- |
13583 | 1 |
/* |
57679 | 2 |
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. |
13583 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package build.tools.cldrconverter; |
|
27 |
||
28 |
import java.io.File; |
|
29 |
import java.io.IOException; |
|
32015 | 30 |
import java.text.DateFormatSymbols; |
13583 | 31 |
import java.util.ArrayList; |
32 |
import java.util.HashMap; |
|
31263 | 33 |
import java.util.HashSet; |
13583 | 34 |
import java.util.List; |
35 |
import java.util.Locale; |
|
36 |
import java.util.Map; |
|
31263 | 37 |
import java.util.Set; |
13583 | 38 |
import org.xml.sax.Attributes; |
39 |
import org.xml.sax.InputSource; |
|
40 |
import org.xml.sax.SAXException; |
|
41 |
||
42 |
/** |
|
43 |
* Handles parsing of files in Locale Data Markup Language and produces a map |
|
44 |
* that uses the keys and values of JRE locale data. |
|
45 |
*/ |
|
46 |
class LDMLParseHandler extends AbstractLDMLHandler<Object> { |
|
47 |
private String defaultNumberingSystem; |
|
48 |
private String currentNumberingSystem = ""; |
|
49 |
private CalendarType currentCalendarType; |
|
50 |
private String zoneNameStyle; // "long" or "short" for time zone names |
|
51 |
private String zonePrefix; |
|
52 |
private final String id; |
|
31263 | 53 |
private String currentContext = ""; // "format"/"stand-alone" |
54 |
private String currentWidth = ""; // "wide"/"narrow"/"abbreviated" |
|
52869 | 55 |
private String currentStyle = ""; // short, long for decimalFormat |
56 |
private String compactCount = ""; // one or other for decimalFormat |
|
13583 | 57 |
|
58 |
LDMLParseHandler(String id) { |
|
59 |
this.id = id; |
|
60 |
} |
|
61 |
||
62 |
@Override |
|
63 |
public InputSource resolveEntity(String publicID, String systemID) throws IOException, SAXException { |
|
64 |
// avoid HTTP traffic to unicode.org |
|
65 |
if (systemID.startsWith(CLDRConverter.LDML_DTD_SYSTEM_ID)) { |
|
66 |
return new InputSource((new File(CLDRConverter.LOCAL_LDML_DTD)).toURI().toString()); |
|
67 |
} |
|
68 |
return null; |
|
69 |
} |
|
70 |
||
71 |
@Override |
|
72 |
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { |
|
73 |
switch (qName) { |
|
74 |
// |
|
75 |
// Generic information |
|
76 |
// |
|
77 |
case "identity": |
|
78 |
// ignore this element - it has language and territory elements that aren't locale data |
|
79 |
pushIgnoredContainer(qName); |
|
80 |
break; |
|
48251
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
81 |
|
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
82 |
// for LocaleNames |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
83 |
// copy string |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
84 |
case "localeSeparator": |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
85 |
pushStringEntry(qName, attributes, |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
86 |
CLDRConverter.LOCALE_SEPARATOR); |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
87 |
break; |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
88 |
case "localeKeyTypePattern": |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
89 |
pushStringEntry(qName, attributes, |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
90 |
CLDRConverter.LOCALE_KEYTYPE); |
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
91 |
break; |
31263 | 92 |
|
13583 | 93 |
case "language": |
31263 | 94 |
case "script": |
95 |
case "territory": |
|
96 |
case "variant": |
|
13583 | 97 |
// for LocaleNames |
98 |
// copy string |
|
31263 | 99 |
pushStringEntry(qName, attributes, |
100 |
CLDRConverter.LOCALE_NAME_PREFIX + |
|
101 |
(qName.equals("variant") ? "%%" : "") + |
|
102 |
attributes.getValue("type")); |
|
13583 | 103 |
break; |
104 |
||
48251
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
105 |
case "key": |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
106 |
// for LocaleNames |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
107 |
// copy string |
49904
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
108 |
{ |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
109 |
String key = convertOldKeyName(attributes.getValue("type")); |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
110 |
if (key.length() == 2) { |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
111 |
pushStringEntry(qName, attributes, |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
112 |
CLDRConverter.LOCALE_KEY_PREFIX + key); |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
113 |
} else { |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
114 |
pushIgnoredContainer(qName); |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
115 |
} |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
116 |
} |
48251
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
117 |
break; |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
118 |
|
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
119 |
case "type": |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
120 |
// for LocaleNames/CalendarNames |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
121 |
// copy string |
49904
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
122 |
{ |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
123 |
String key = convertOldKeyName(attributes.getValue("key")); |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
124 |
if (key.length() == 2) { |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
125 |
pushStringEntry(qName, attributes, |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
126 |
CLDRConverter.LOCALE_TYPE_PREFIX + key + "." + |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
127 |
attributes.getValue("type")); |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
128 |
} else { |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
129 |
pushIgnoredContainer(qName); |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
130 |
} |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
131 |
} |
48251
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
132 |
break; |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
133 |
|
13583 | 134 |
// |
135 |
// Currency information |
|
136 |
// |
|
137 |
case "currency": |
|
138 |
// for CurrencyNames |
|
139 |
// stash away "type" value for nested <symbol> |
|
140 |
pushKeyContainer(qName, attributes, attributes.getValue("type")); |
|
141 |
break; |
|
142 |
case "symbol": |
|
143 |
// for CurrencyNames |
|
144 |
// need to get the key from the containing <currency> element |
|
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
145 |
pushStringEntry(qName, attributes, CLDRConverter.CURRENCY_SYMBOL_PREFIX |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
146 |
+ getContainerKey()); |
13583 | 147 |
break; |
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
148 |
|
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
149 |
// Calendar or currency |
13583 | 150 |
case "displayName": |
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
151 |
{ |
31263 | 152 |
if (currentContainer.getqName().equals("field")) { |
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
153 |
pushStringEntry(qName, attributes, |
31263 | 154 |
(currentCalendarType != null ? currentCalendarType.keyElementName() : "") |
155 |
+ "field." + getContainerKey()); |
|
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
156 |
} else { |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
157 |
// for CurrencyNames |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
158 |
// need to get the key from the containing <currency> element |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
159 |
// ignore if is has "count" attribute |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
160 |
String containerKey = getContainerKey(); |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
161 |
if (containerKey != null && attributes.getValue("count") == null) { |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
162 |
pushStringEntry(qName, attributes, |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
163 |
CLDRConverter.CURRENCY_NAME_PREFIX |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
164 |
+ containerKey.toLowerCase(Locale.ROOT), |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
165 |
attributes.getValue("type")); |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
166 |
} else { |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
167 |
pushIgnoredContainer(qName); |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
168 |
} |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
169 |
} |
13583 | 170 |
} |
171 |
break; |
|
172 |
||
173 |
// |
|
174 |
// Calendar information |
|
175 |
// |
|
176 |
case "calendar": |
|
177 |
{ |
|
178 |
// mostly for FormatData (CalendarData items firstDay and minDays are also nested) |
|
179 |
// use only if it's supported by java.util.Calendar. |
|
180 |
String calendarName = attributes.getValue("type"); |
|
181 |
currentCalendarType = CalendarType.forName(calendarName); |
|
182 |
if (currentCalendarType != null) { |
|
183 |
pushContainer(qName, attributes); |
|
184 |
} else { |
|
185 |
pushIgnoredContainer(qName); |
|
186 |
} |
|
187 |
} |
|
188 |
break; |
|
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
189 |
case "fields": |
31263 | 190 |
{ |
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
191 |
pushContainer(qName, attributes); |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
192 |
} |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
193 |
break; |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
194 |
case "field": |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
195 |
{ |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
196 |
String type = attributes.getValue("type"); |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
197 |
switch (type) { |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
198 |
case "era": |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
199 |
case "year": |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
200 |
case "month": |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
201 |
case "week": |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
202 |
case "weekday": |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
203 |
case "dayperiod": |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
204 |
case "hour": |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
205 |
case "minute": |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
206 |
case "second": |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
207 |
case "zone": |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
208 |
pushKeyContainer(qName, attributes, type); |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
209 |
break; |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
210 |
default: |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
211 |
pushIgnoredContainer(qName); |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
212 |
break; |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
213 |
} |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
214 |
} |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
215 |
break; |
13583 | 216 |
case "monthContext": |
217 |
{ |
|
218 |
// for FormatData |
|
219 |
// need to keep stand-alone and format, to allow for inheritance in CLDR |
|
220 |
String type = attributes.getValue("type"); |
|
221 |
if ("stand-alone".equals(type) || "format".equals(type)) { |
|
31263 | 222 |
currentContext = type; |
13583 | 223 |
pushKeyContainer(qName, attributes, type); |
224 |
} else { |
|
225 |
pushIgnoredContainer(qName); |
|
226 |
} |
|
227 |
} |
|
228 |
break; |
|
229 |
case "monthWidth": |
|
230 |
{ |
|
231 |
// for FormatData |
|
232 |
// create string array for the two types that the JRE knows |
|
233 |
// keep info about the context type so we can sort out inheritance later |
|
31263 | 234 |
if (currentCalendarType == null) { |
235 |
pushIgnoredContainer(qName); |
|
236 |
break; |
|
237 |
} |
|
13583 | 238 |
String prefix = (currentCalendarType == null) ? "" : currentCalendarType.keyElementName(); |
31263 | 239 |
currentWidth = attributes.getValue("type"); |
240 |
switch (currentWidth) { |
|
13583 | 241 |
case "wide": |
242 |
pushStringArrayEntry(qName, attributes, prefix + "MonthNames/" + getContainerKey(), 13); |
|
243 |
break; |
|
244 |
case "abbreviated": |
|
245 |
pushStringArrayEntry(qName, attributes, prefix + "MonthAbbreviations/" + getContainerKey(), 13); |
|
246 |
break; |
|
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
247 |
case "narrow": |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
248 |
pushStringArrayEntry(qName, attributes, prefix + "MonthNarrows/" + getContainerKey(), 13); |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
249 |
break; |
13583 | 250 |
default: |
251 |
pushIgnoredContainer(qName); |
|
252 |
break; |
|
253 |
} |
|
254 |
} |
|
255 |
break; |
|
256 |
case "month": |
|
257 |
// for FormatData |
|
258 |
// add to string array entry of monthWidth element |
|
259 |
pushStringArrayElement(qName, attributes, Integer.parseInt(attributes.getValue("type")) - 1); |
|
260 |
break; |
|
261 |
case "dayContext": |
|
262 |
{ |
|
263 |
// for FormatData |
|
264 |
// need to keep stand-alone and format, to allow for multiple inheritance in CLDR |
|
265 |
String type = attributes.getValue("type"); |
|
266 |
if ("stand-alone".equals(type) || "format".equals(type)) { |
|
31263 | 267 |
currentContext = type; |
13583 | 268 |
pushKeyContainer(qName, attributes, type); |
269 |
} else { |
|
270 |
pushIgnoredContainer(qName); |
|
271 |
} |
|
272 |
} |
|
273 |
break; |
|
274 |
case "dayWidth": |
|
275 |
{ |
|
276 |
// for FormatData |
|
277 |
// create string array for the two types that the JRE knows |
|
278 |
// keep info about the context type so we can sort out inheritance later |
|
279 |
String prefix = (currentCalendarType == null) ? "" : currentCalendarType.keyElementName(); |
|
31263 | 280 |
currentWidth = attributes.getValue("type"); |
281 |
switch (currentWidth) { |
|
13583 | 282 |
case "wide": |
283 |
pushStringArrayEntry(qName, attributes, prefix + "DayNames/" + getContainerKey(), 7); |
|
284 |
break; |
|
285 |
case "abbreviated": |
|
286 |
pushStringArrayEntry(qName, attributes, prefix + "DayAbbreviations/" + getContainerKey(), 7); |
|
287 |
break; |
|
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
288 |
case "narrow": |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
289 |
pushStringArrayEntry(qName, attributes, prefix + "DayNarrows/" + getContainerKey(), 7); |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
290 |
break; |
13583 | 291 |
default: |
292 |
pushIgnoredContainer(qName); |
|
293 |
break; |
|
294 |
} |
|
295 |
} |
|
296 |
break; |
|
297 |
case "day": |
|
298 |
// for FormatData |
|
299 |
// add to string array entry of monthWidth element |
|
300 |
pushStringArrayElement(qName, attributes, Integer.parseInt(DAY_OF_WEEK_MAP.get(attributes.getValue("type"))) - 1); |
|
301 |
break; |
|
302 |
case "dayPeriodContext": |
|
303 |
// for FormatData |
|
304 |
// need to keep stand-alone and format, to allow for multiple inheritance in CLDR |
|
305 |
// for FormatData |
|
306 |
// need to keep stand-alone and format, to allow for multiple inheritance in CLDR |
|
307 |
{ |
|
308 |
String type = attributes.getValue("type"); |
|
309 |
if ("stand-alone".equals(type) || "format".equals(type)) { |
|
31263 | 310 |
currentContext = type; |
13583 | 311 |
pushKeyContainer(qName, attributes, type); |
312 |
} else { |
|
313 |
pushIgnoredContainer(qName); |
|
314 |
} |
|
315 |
} |
|
316 |
break; |
|
317 |
case "dayPeriodWidth": |
|
318 |
// for FormatData |
|
319 |
// create string array entry for am/pm. only keeping wide |
|
31263 | 320 |
currentWidth = attributes.getValue("type"); |
321 |
switch (currentWidth) { |
|
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
322 |
case "wide": |
13583 | 323 |
pushStringArrayEntry(qName, attributes, "AmPmMarkers/" + getContainerKey(), 2); |
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
324 |
break; |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
325 |
case "narrow": |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
326 |
pushStringArrayEntry(qName, attributes, "narrow.AmPmMarkers/" + getContainerKey(), 2); |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
327 |
break; |
38747 | 328 |
case "abbreviated": |
329 |
pushStringArrayEntry(qName, attributes, "abbreviated.AmPmMarkers/" + getContainerKey(), 2); |
|
330 |
break; |
|
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
331 |
default: |
13583 | 332 |
pushIgnoredContainer(qName); |
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
333 |
break; |
13583 | 334 |
} |
335 |
break; |
|
336 |
case "dayPeriod": |
|
337 |
// for FormatData |
|
338 |
// add to string array entry of AmPmMarkers element |
|
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
339 |
if (attributes.getValue("alt") == null) { |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
340 |
switch (attributes.getValue("type")) { |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
341 |
case "am": |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
342 |
pushStringArrayElement(qName, attributes, 0); |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
343 |
break; |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
344 |
case "pm": |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
345 |
pushStringArrayElement(qName, attributes, 1); |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
346 |
break; |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
347 |
default: |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
348 |
pushIgnoredContainer(qName); |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
349 |
break; |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
350 |
} |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
351 |
} else { |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
352 |
// discard alt values |
13583 | 353 |
pushIgnoredContainer(qName); |
354 |
} |
|
355 |
break; |
|
356 |
case "eraNames": |
|
357 |
// CLDR era names are inconsistent in terms of their lengths. For example, |
|
358 |
// the full names of Japanese imperial eras are eraAbbr, while the full names |
|
359 |
// of the Julian eras are eraNames. |
|
360 |
if (currentCalendarType == null) { |
|
361 |
assert currentContainer instanceof IgnoredContainer; |
|
362 |
pushIgnoredContainer(qName); |
|
363 |
} else { |
|
364 |
String key = currentCalendarType.keyElementName() + "long.Eras"; // for now |
|
365 |
pushStringArrayEntry(qName, attributes, key, currentCalendarType.getEraLength(qName)); |
|
366 |
} |
|
367 |
break; |
|
368 |
case "eraAbbr": |
|
369 |
// for FormatData |
|
370 |
// create string array entry |
|
371 |
if (currentCalendarType == null) { |
|
372 |
assert currentContainer instanceof IgnoredContainer; |
|
373 |
pushIgnoredContainer(qName); |
|
374 |
} else { |
|
375 |
String key = currentCalendarType.keyElementName() + "Eras"; |
|
376 |
pushStringArrayEntry(qName, attributes, key, currentCalendarType.getEraLength(qName)); |
|
377 |
} |
|
378 |
break; |
|
379 |
case "eraNarrow": |
|
380 |
// mainly used for the Japanese imperial calendar |
|
381 |
if (currentCalendarType == null) { |
|
382 |
assert currentContainer instanceof IgnoredContainer; |
|
383 |
pushIgnoredContainer(qName); |
|
384 |
} else { |
|
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
385 |
String key = currentCalendarType.keyElementName() + "narrow.Eras"; |
13583 | 386 |
pushStringArrayEntry(qName, attributes, key, currentCalendarType.getEraLength(qName)); |
387 |
} |
|
388 |
break; |
|
389 |
case "era": |
|
390 |
// for FormatData |
|
391 |
// add to string array entry of eraAbbr element |
|
392 |
if (currentCalendarType == null) { |
|
393 |
assert currentContainer instanceof IgnoredContainer; |
|
394 |
pushIgnoredContainer(qName); |
|
395 |
} else { |
|
396 |
int index = Integer.parseInt(attributes.getValue("type")); |
|
397 |
index = currentCalendarType.normalizeEraIndex(index); |
|
398 |
if (index >= 0) { |
|
399 |
pushStringArrayElement(qName, attributes, index); |
|
400 |
} else { |
|
401 |
pushIgnoredContainer(qName); |
|
402 |
} |
|
403 |
if (currentContainer.getParent() == null) { |
|
404 |
throw new InternalError("currentContainer: null parent"); |
|
405 |
} |
|
406 |
} |
|
407 |
break; |
|
16852 | 408 |
case "quarterContext": |
409 |
{ |
|
410 |
// for FormatData |
|
411 |
// need to keep stand-alone and format, to allow for inheritance in CLDR |
|
412 |
String type = attributes.getValue("type"); |
|
413 |
if ("stand-alone".equals(type) || "format".equals(type)) { |
|
31263 | 414 |
currentContext = type; |
16852 | 415 |
pushKeyContainer(qName, attributes, type); |
416 |
} else { |
|
417 |
pushIgnoredContainer(qName); |
|
418 |
} |
|
419 |
} |
|
420 |
break; |
|
421 |
case "quarterWidth": |
|
422 |
{ |
|
423 |
// for FormatData |
|
424 |
// keep info about the context type so we can sort out inheritance later |
|
425 |
String prefix = (currentCalendarType == null) ? "" : currentCalendarType.keyElementName(); |
|
31263 | 426 |
currentWidth = attributes.getValue("type"); |
427 |
switch (currentWidth) { |
|
16852 | 428 |
case "wide": |
429 |
pushStringArrayEntry(qName, attributes, prefix + "QuarterNames/" + getContainerKey(), 4); |
|
430 |
break; |
|
431 |
case "abbreviated": |
|
432 |
pushStringArrayEntry(qName, attributes, prefix + "QuarterAbbreviations/" + getContainerKey(), 4); |
|
433 |
break; |
|
434 |
case "narrow": |
|
435 |
pushStringArrayEntry(qName, attributes, prefix + "QuarterNarrows/" + getContainerKey(), 4); |
|
436 |
break; |
|
437 |
default: |
|
438 |
pushIgnoredContainer(qName); |
|
439 |
break; |
|
440 |
} |
|
441 |
} |
|
442 |
break; |
|
443 |
case "quarter": |
|
444 |
// for FormatData |
|
445 |
// add to string array entry of quarterWidth element |
|
446 |
pushStringArrayElement(qName, attributes, Integer.parseInt(attributes.getValue("type")) - 1); |
|
447 |
break; |
|
13583 | 448 |
|
449 |
// |
|
450 |
// Time zone names |
|
451 |
// |
|
452 |
case "timeZoneNames": |
|
453 |
pushContainer(qName, attributes); |
|
454 |
break; |
|
39644 | 455 |
case "hourFormat": |
456 |
pushStringEntry(qName, attributes, "timezone.hourFormat"); |
|
457 |
break; |
|
458 |
case "gmtFormat": |
|
459 |
pushStringEntry(qName, attributes, "timezone.gmtFormat"); |
|
460 |
break; |
|
49904
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
461 |
case "gmtZeroFormat": |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
462 |
pushStringEntry(qName, attributes, "timezone.gmtZeroFormat"); |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
463 |
break; |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
464 |
case "regionFormat": |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
465 |
{ |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
466 |
String type = attributes.getValue("type"); |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
467 |
pushStringEntry(qName, attributes, "timezone.regionFormat" + |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
468 |
(type == null ? "" : "." + type)); |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
469 |
} |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
470 |
break; |
13583 | 471 |
case "zone": |
472 |
{ |
|
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
473 |
String tzid = attributes.getValue("type"); // Olson tz id |
13583 | 474 |
zonePrefix = CLDRConverter.TIMEZONE_ID_PREFIX; |
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
475 |
put(zonePrefix + tzid, new HashMap<String, String>()); |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
476 |
pushKeyContainer(qName, attributes, tzid); |
13583 | 477 |
} |
478 |
break; |
|
479 |
case "metazone": |
|
480 |
{ |
|
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
481 |
String zone = attributes.getValue("type"); // LDML meta zone id |
13583 | 482 |
zonePrefix = CLDRConverter.METAZONE_ID_PREFIX; |
483 |
put(zonePrefix + zone, new HashMap<String, String>()); |
|
484 |
pushKeyContainer(qName, attributes, zone); |
|
485 |
} |
|
486 |
break; |
|
487 |
case "long": |
|
488 |
zoneNameStyle = "long"; |
|
489 |
pushContainer(qName, attributes); |
|
490 |
break; |
|
491 |
case "short": |
|
492 |
zoneNameStyle = "short"; |
|
493 |
pushContainer(qName, attributes); |
|
494 |
break; |
|
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
495 |
case "generic": // generic name |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
496 |
case "standard": // standard time name |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
497 |
case "daylight": // daylight saving (summer) time name |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
498 |
pushStringEntry(qName, attributes, CLDRConverter.ZONE_NAME_PREFIX + qName + "." + zoneNameStyle); |
13583 | 499 |
break; |
49904
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
500 |
case "exemplarCity": |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
501 |
pushStringEntry(qName, attributes, CLDRConverter.EXEMPLAR_CITY_PREFIX); |
13583 | 502 |
break; |
503 |
||
504 |
// |
|
505 |
// Number format information |
|
506 |
// |
|
507 |
case "decimalFormatLength": |
|
52869 | 508 |
String type = attributes.getValue("type"); |
509 |
if (null == type) { |
|
510 |
// format data for decimal number format |
|
13583 | 511 |
pushStringEntry(qName, attributes, "NumberPatterns/decimal"); |
52869 | 512 |
currentStyle = type; |
13583 | 513 |
} else { |
52869 | 514 |
switch (type) { |
515 |
case "short": |
|
516 |
case "long": |
|
517 |
// considering "short" and long for |
|
518 |
// compact number formatting patterns |
|
519 |
pushKeyContainer(qName, attributes, type); |
|
520 |
currentStyle = type; |
|
521 |
break; |
|
522 |
default: |
|
523 |
pushIgnoredContainer(qName); |
|
524 |
break; |
|
525 |
} |
|
526 |
} |
|
527 |
break; |
|
528 |
case "decimalFormat": |
|
529 |
if(currentStyle == null) { |
|
530 |
pushContainer(qName, attributes); |
|
531 |
} else { |
|
532 |
switch (currentStyle) { |
|
533 |
case "short": |
|
534 |
pushStringListEntry(qName, attributes, |
|
535 |
currentStyle+".CompactNumberPatterns"); |
|
536 |
break; |
|
537 |
case "long": |
|
538 |
pushStringListEntry(qName, attributes, |
|
539 |
currentStyle+".CompactNumberPatterns"); |
|
540 |
break; |
|
541 |
default: |
|
542 |
pushIgnoredContainer(qName); |
|
543 |
break; |
|
544 |
} |
|
545 |
} |
|
546 |
break; |
|
547 |
case "pattern": |
|
548 |
String containerName = currentContainer.getqName(); |
|
549 |
if (containerName.equals("decimalFormat")) { |
|
550 |
if (currentStyle == null) { |
|
551 |
pushContainer(qName, attributes); |
|
552 |
} else { |
|
553 |
// The compact number patterns parsing assumes that the order |
|
554 |
// of patterns are always in the increasing order of their |
|
555 |
// type attribute i.e. type = 1000... |
|
556 |
// Between the inflectional forms for a type (e.g. |
|
557 |
// count = "one" and count = "other" for type = 1000), it is |
|
558 |
// assumed that the count = "one" always appears before |
|
559 |
// count = "other" |
|
560 |
switch (currentStyle) { |
|
561 |
case "short": |
|
562 |
case "long": |
|
563 |
String count = attributes.getValue("count"); |
|
564 |
// first pattern of count = "one" or count = "other" |
|
565 |
if ((count.equals("one") || count.equals("other")) |
|
566 |
&& compactCount.equals("")) { |
|
567 |
compactCount = count; |
|
568 |
pushStringListElement(qName, attributes, |
|
569 |
(int) Math.log10(Double.parseDouble(attributes.getValue("type")))); |
|
570 |
} else if ((count.equals("one") || count.equals("other")) |
|
571 |
&& compactCount.equals(count)) { |
|
572 |
// extract patterns with similar "count" |
|
573 |
// attribute value |
|
574 |
pushStringListElement(qName, attributes, |
|
575 |
(int) Math.log10(Double.parseDouble(attributes.getValue("type")))); |
|
576 |
} else { |
|
577 |
pushIgnoredContainer(qName); |
|
578 |
} |
|
579 |
break; |
|
580 |
default: |
|
581 |
pushIgnoredContainer(qName); |
|
582 |
break; |
|
583 |
} |
|
584 |
} |
|
585 |
} else { |
|
586 |
pushContainer(qName, attributes); |
|
13583 | 587 |
} |
588 |
break; |
|
38747 | 589 |
case "currencyFormatLength": |
590 |
if (attributes.getValue("type") == null) { |
|
591 |
// skipping type="short" data |
|
592 |
// for FormatData |
|
593 |
pushContainer(qName, attributes); |
|
594 |
} else { |
|
595 |
pushIgnoredContainer(qName); |
|
596 |
} |
|
597 |
break; |
|
13583 | 598 |
case "currencyFormat": |
57679 | 599 |
{ |
600 |
// for FormatData |
|
601 |
// copy string for later assembly into NumberPatterns |
|
602 |
String cfStyle = attributes.getValue("type"); |
|
603 |
if (cfStyle.equals("standard")) { |
|
604 |
pushStringEntry(qName, attributes, "NumberPatterns/currency"); |
|
605 |
} else if (cfStyle.equals("accounting")) { |
|
606 |
pushStringEntry(qName, attributes, "NumberPatterns/accounting"); |
|
607 |
} else { |
|
608 |
pushIgnoredContainer(qName); |
|
609 |
} |
|
31263 | 610 |
} |
13583 | 611 |
break; |
612 |
case "percentFormat": |
|
613 |
// for FormatData |
|
614 |
// copy string for later assembly into NumberPatterns |
|
31263 | 615 |
if (attributes.getValue("type").equals("standard")) { |
57679 | 616 |
pushStringEntry(qName, attributes, "NumberPatterns/percent"); |
31263 | 617 |
} else { |
618 |
pushIgnoredContainer(qName); |
|
619 |
} |
|
13583 | 620 |
break; |
621 |
case "defaultNumberingSystem": |
|
622 |
// default numbering system if multiple numbering systems are used. |
|
623 |
pushStringEntry(qName, attributes, "DefaultNumberingSystem"); |
|
624 |
break; |
|
625 |
case "symbols": |
|
626 |
// for FormatData |
|
627 |
// look up numberingSystems |
|
628 |
symbols: { |
|
629 |
String script = attributes.getValue("numberSystem"); |
|
630 |
if (script == null) { |
|
631 |
// Has no script. Just ignore. |
|
632 |
pushIgnoredContainer(qName); |
|
633 |
break; |
|
634 |
} |
|
635 |
||
636 |
// Use keys as <script>."NumberElements/<symbol>" |
|
637 |
currentNumberingSystem = script + "."; |
|
638 |
String digits = CLDRConverter.handlerNumbering.get(script); |
|
639 |
if (digits == null) { |
|
640 |
pushIgnoredContainer(qName); |
|
641 |
break; |
|
642 |
} |
|
48251
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
643 |
|
13583 | 644 |
@SuppressWarnings("unchecked") |
645 |
List<String> numberingScripts = (List<String>) get("numberingScripts"); |
|
646 |
if (numberingScripts == null) { |
|
647 |
numberingScripts = new ArrayList<>(); |
|
648 |
put("numberingScripts", numberingScripts); |
|
649 |
} |
|
650 |
numberingScripts.add(script); |
|
651 |
put(currentNumberingSystem + "NumberElements/zero", digits.substring(0, 1)); |
|
652 |
pushContainer(qName, attributes); |
|
653 |
} |
|
654 |
break; |
|
655 |
case "decimal": |
|
656 |
// for FormatData |
|
657 |
// copy string for later assembly into NumberElements |
|
45461
8b6f0a3850ab
8178872: Decimal form is inconsistent between CLDR and Java in some special locales
rgoel
parents:
39644
diff
changeset
|
658 |
if (currentContainer.getqName().equals("symbols")) { |
8b6f0a3850ab
8178872: Decimal form is inconsistent between CLDR and Java in some special locales
rgoel
parents:
39644
diff
changeset
|
659 |
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/decimal"); |
8b6f0a3850ab
8178872: Decimal form is inconsistent between CLDR and Java in some special locales
rgoel
parents:
39644
diff
changeset
|
660 |
} else { |
8b6f0a3850ab
8178872: Decimal form is inconsistent between CLDR and Java in some special locales
rgoel
parents:
39644
diff
changeset
|
661 |
pushIgnoredContainer(qName); |
8b6f0a3850ab
8178872: Decimal form is inconsistent between CLDR and Java in some special locales
rgoel
parents:
39644
diff
changeset
|
662 |
} |
13583 | 663 |
break; |
664 |
case "group": |
|
665 |
// for FormatData |
|
666 |
// copy string for later assembly into NumberElements |
|
45461
8b6f0a3850ab
8178872: Decimal form is inconsistent between CLDR and Java in some special locales
rgoel
parents:
39644
diff
changeset
|
667 |
if (currentContainer.getqName().equals("symbols")) { |
8b6f0a3850ab
8178872: Decimal form is inconsistent between CLDR and Java in some special locales
rgoel
parents:
39644
diff
changeset
|
668 |
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/group"); |
8b6f0a3850ab
8178872: Decimal form is inconsistent between CLDR and Java in some special locales
rgoel
parents:
39644
diff
changeset
|
669 |
} else { |
8b6f0a3850ab
8178872: Decimal form is inconsistent between CLDR and Java in some special locales
rgoel
parents:
39644
diff
changeset
|
670 |
pushIgnoredContainer(qName); |
8b6f0a3850ab
8178872: Decimal form is inconsistent between CLDR and Java in some special locales
rgoel
parents:
39644
diff
changeset
|
671 |
} |
13583 | 672 |
break; |
673 |
case "list": |
|
674 |
// for FormatData |
|
675 |
// copy string for later assembly into NumberElements |
|
676 |
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/list"); |
|
677 |
break; |
|
678 |
case "percentSign": |
|
679 |
// for FormatData |
|
680 |
// copy string for later assembly into NumberElements |
|
681 |
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/percent"); |
|
682 |
break; |
|
683 |
case "nativeZeroDigit": |
|
684 |
// for FormatData |
|
685 |
// copy string for later assembly into NumberElements |
|
686 |
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/zero"); |
|
687 |
break; |
|
688 |
case "patternDigit": |
|
689 |
// for FormatData |
|
690 |
// copy string for later assembly into NumberElements |
|
691 |
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/pattern"); |
|
692 |
break; |
|
693 |
case "plusSign": |
|
694 |
// TODO: DecimalFormatSymbols doesn't support plusSign |
|
695 |
pushIgnoredContainer(qName); |
|
696 |
break; |
|
697 |
case "minusSign": |
|
698 |
// for FormatData |
|
699 |
// copy string for later assembly into NumberElements |
|
700 |
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/minus"); |
|
701 |
break; |
|
702 |
case "exponential": |
|
703 |
// for FormatData |
|
704 |
// copy string for later assembly into NumberElements |
|
705 |
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/exponential"); |
|
706 |
break; |
|
707 |
case "perMille": |
|
708 |
// for FormatData |
|
709 |
// copy string for later assembly into NumberElements |
|
710 |
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/permille"); |
|
711 |
break; |
|
712 |
case "infinity": |
|
713 |
// for FormatData |
|
714 |
// copy string for later assembly into NumberElements |
|
715 |
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/infinity"); |
|
716 |
break; |
|
717 |
case "nan": |
|
718 |
// for FormatData |
|
719 |
// copy string for later assembly into NumberElements |
|
720 |
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/nan"); |
|
721 |
break; |
|
722 |
case "timeFormatLength": |
|
723 |
{ |
|
724 |
// for FormatData |
|
725 |
// copy string for later assembly into DateTimePatterns |
|
726 |
String prefix = (currentCalendarType == null) ? "" : currentCalendarType.keyElementName(); |
|
727 |
pushStringEntry(qName, attributes, prefix + "DateTimePatterns/" + attributes.getValue("type") + "-time"); |
|
728 |
} |
|
729 |
break; |
|
730 |
case "dateFormatLength": |
|
731 |
{ |
|
732 |
// for FormatData |
|
733 |
// copy string for later assembly into DateTimePatterns |
|
734 |
String prefix = (currentCalendarType == null) ? "" : currentCalendarType.keyElementName(); |
|
735 |
pushStringEntry(qName, attributes, prefix + "DateTimePatterns/" + attributes.getValue("type") + "-date"); |
|
736 |
} |
|
737 |
break; |
|
31263 | 738 |
case "dateTimeFormatLength": |
13583 | 739 |
{ |
740 |
// for FormatData |
|
741 |
// copy string for later assembly into DateTimePatterns |
|
742 |
String prefix = (currentCalendarType == null) ? "" : currentCalendarType.keyElementName(); |
|
31263 | 743 |
pushStringEntry(qName, attributes, prefix + "DateTimePatterns/" + attributes.getValue("type") + "-dateTime"); |
13583 | 744 |
} |
745 |
break; |
|
746 |
case "localizedPatternChars": |
|
747 |
{ |
|
748 |
// for FormatData |
|
749 |
// copy string for later adaptation to JRE use |
|
750 |
String prefix = (currentCalendarType == null) ? "" : currentCalendarType.keyElementName(); |
|
751 |
pushStringEntry(qName, attributes, prefix + "DateTimePatternChars"); |
|
752 |
} |
|
753 |
break; |
|
754 |
||
31263 | 755 |
// "alias" for root |
756 |
case "alias": |
|
757 |
{ |
|
52869 | 758 |
if (id.equals("root") && !isIgnored(attributes) |
759 |
&& ((currentContainer.getqName().equals("decimalFormatLength")) |
|
760 |
|| (currentCalendarType != null && !currentCalendarType.lname().startsWith("islamic-")))) { // ignore islamic variants |
|
31263 | 761 |
pushAliasEntry(qName, attributes, attributes.getValue("path")); |
762 |
} else { |
|
763 |
pushIgnoredContainer(qName); |
|
764 |
} |
|
765 |
} |
|
766 |
break; |
|
767 |
||
13583 | 768 |
default: |
769 |
// treat anything else as a container |
|
770 |
pushContainer(qName, attributes); |
|
771 |
break; |
|
772 |
} |
|
773 |
} |
|
774 |
||
31263 | 775 |
private static final String[] CONTEXTS = {"stand-alone", "format"}; |
776 |
private static final String[] WIDTHS = {"wide", "narrow", "abbreviated"}; |
|
777 |
private static final String[] LENGTHS = {"full", "long", "medium", "short"}; |
|
778 |
||
779 |
private void populateWidthAlias(String type, Set<String> keys) { |
|
780 |
for (String context : CONTEXTS) { |
|
781 |
for (String width : WIDTHS) { |
|
782 |
String keyName = toJDKKey(type+"Width", context, width); |
|
783 |
if (keyName.length() > 0) { |
|
784 |
keys.add(keyName + "," + context + "," + width); |
|
785 |
} |
|
786 |
} |
|
787 |
} |
|
788 |
} |
|
789 |
||
790 |
private void populateFormatLengthAlias(String type, Set<String> keys) { |
|
791 |
for (String length: LENGTHS) { |
|
792 |
String keyName = toJDKKey(type+"FormatLength", currentContext, length); |
|
793 |
if (keyName.length() > 0) { |
|
794 |
keys.add(keyName + "," + currentContext + "," + length); |
|
795 |
} |
|
796 |
} |
|
797 |
} |
|
798 |
||
799 |
private Set<String> populateAliasKeys(String qName, String context, String width) { |
|
800 |
HashSet<String> ret = new HashSet<>(); |
|
801 |
String keyName = qName; |
|
802 |
||
803 |
switch (qName) { |
|
804 |
case "monthWidth": |
|
805 |
case "dayWidth": |
|
806 |
case "quarterWidth": |
|
807 |
case "dayPeriodWidth": |
|
808 |
case "dateFormatLength": |
|
809 |
case "timeFormatLength": |
|
810 |
case "dateTimeFormatLength": |
|
811 |
case "eraNames": |
|
812 |
case "eraAbbr": |
|
813 |
case "eraNarrow": |
|
814 |
ret.add(toJDKKey(qName, context, width) + "," + context + "," + width); |
|
815 |
break; |
|
816 |
case "days": |
|
817 |
populateWidthAlias("day", ret); |
|
818 |
break; |
|
819 |
case "months": |
|
820 |
populateWidthAlias("month", ret); |
|
821 |
break; |
|
822 |
case "quarters": |
|
823 |
populateWidthAlias("quarter", ret); |
|
824 |
break; |
|
825 |
case "dayPeriods": |
|
826 |
populateWidthAlias("dayPeriod", ret); |
|
827 |
break; |
|
828 |
case "eras": |
|
829 |
ret.add(toJDKKey("eraNames", context, width) + "," + context + "," + width); |
|
830 |
ret.add(toJDKKey("eraAbbr", context, width) + "," + context + "," + width); |
|
831 |
ret.add(toJDKKey("eraNarrow", context, width) + "," + context + "," + width); |
|
832 |
break; |
|
833 |
case "dateFormats": |
|
834 |
populateFormatLengthAlias("date", ret); |
|
835 |
break; |
|
836 |
case "timeFormats": |
|
837 |
populateFormatLengthAlias("time", ret); |
|
838 |
break; |
|
839 |
default: |
|
840 |
break; |
|
841 |
} |
|
842 |
return ret; |
|
843 |
} |
|
844 |
||
845 |
private String translateWidthAlias(String qName, String context, String width) { |
|
846 |
String keyName = qName; |
|
847 |
String type = Character.toUpperCase(qName.charAt(0)) + qName.substring(1, qName.indexOf("Width")); |
|
848 |
||
849 |
switch (width) { |
|
850 |
case "wide": |
|
851 |
keyName = type + "Names/" + context; |
|
852 |
break; |
|
853 |
case "abbreviated": |
|
854 |
keyName = type + "Abbreviations/" + context; |
|
855 |
break; |
|
856 |
case "narrow": |
|
857 |
keyName = type + "Narrows/" + context; |
|
858 |
break; |
|
859 |
default: |
|
860 |
assert false; |
|
861 |
} |
|
862 |
||
863 |
return keyName; |
|
864 |
} |
|
865 |
||
866 |
private String toJDKKey(String containerqName, String context, String type) { |
|
867 |
String keyName = containerqName; |
|
868 |
||
869 |
switch (containerqName) { |
|
870 |
case "monthWidth": |
|
871 |
case "dayWidth": |
|
872 |
case "quarterWidth": |
|
873 |
keyName = translateWidthAlias(keyName, context, type); |
|
874 |
break; |
|
875 |
case "dayPeriodWidth": |
|
876 |
switch (type) { |
|
877 |
case "wide": |
|
878 |
keyName = "AmPmMarkers/" + context; |
|
879 |
break; |
|
880 |
case "narrow": |
|
881 |
keyName = "narrow.AmPmMarkers/" + context; |
|
882 |
break; |
|
883 |
case "abbreviated": |
|
38747 | 884 |
keyName = "abbreviated.AmPmMarkers/" + context; |
31263 | 885 |
break; |
886 |
} |
|
887 |
break; |
|
888 |
case "dateFormatLength": |
|
889 |
case "timeFormatLength": |
|
890 |
case "dateTimeFormatLength": |
|
891 |
keyName = "DateTimePatterns/" + |
|
892 |
type + "-" + |
|
893 |
keyName.substring(0, keyName.indexOf("FormatLength")); |
|
894 |
break; |
|
895 |
case "eraNames": |
|
896 |
keyName = "long.Eras"; |
|
897 |
break; |
|
898 |
case "eraAbbr": |
|
899 |
keyName = "Eras"; |
|
900 |
break; |
|
901 |
case "eraNarrow": |
|
902 |
keyName = "narrow.Eras"; |
|
903 |
break; |
|
904 |
case "dateFormats": |
|
905 |
case "timeFormats": |
|
906 |
case "days": |
|
907 |
case "months": |
|
908 |
case "quarters": |
|
909 |
case "dayPeriods": |
|
910 |
case "eras": |
|
911 |
break; |
|
52869 | 912 |
case "decimalFormatLength": // used for compact number formatting patterns |
913 |
keyName = type + ".CompactNumberPatterns"; |
|
914 |
break; |
|
31263 | 915 |
default: |
916 |
keyName = ""; |
|
917 |
break; |
|
918 |
} |
|
919 |
||
920 |
return keyName; |
|
921 |
} |
|
922 |
||
36857
3e52f7c8ad89
8153041: Remove unused redundant parameter in CLDRConverter
naoto
parents:
32015
diff
changeset
|
923 |
private String getTarget(String path, String calType, String context, String width) { |
3e52f7c8ad89
8153041: Remove unused redundant parameter in CLDRConverter
naoto
parents:
32015
diff
changeset
|
924 |
// Target qName |
31263 | 925 |
int lastSlash = path.lastIndexOf('/'); |
36857
3e52f7c8ad89
8153041: Remove unused redundant parameter in CLDRConverter
naoto
parents:
32015
diff
changeset
|
926 |
String qName = path.substring(lastSlash+1); |
31263 | 927 |
int bracket = qName.indexOf('['); |
928 |
if (bracket != -1) { |
|
929 |
qName = qName.substring(0, bracket); |
|
930 |
} |
|
931 |
||
932 |
// calType |
|
933 |
String typeKey = "/calendar[@type='"; |
|
934 |
int start = path.indexOf(typeKey); |
|
935 |
if (start != -1) { |
|
936 |
calType = path.substring(start+typeKey.length(), path.indexOf("']", start)); |
|
937 |
} |
|
938 |
||
939 |
// context |
|
940 |
typeKey = "Context[@type='"; |
|
941 |
start = path.indexOf(typeKey); |
|
942 |
if (start != -1) { |
|
943 |
context = (path.substring(start+typeKey.length(), path.indexOf("']", start))); |
|
944 |
} |
|
945 |
||
946 |
// width |
|
947 |
typeKey = "Width[@type='"; |
|
948 |
start = path.indexOf(typeKey); |
|
949 |
if (start != -1) { |
|
950 |
width = path.substring(start+typeKey.length(), path.indexOf("']", start)); |
|
951 |
} |
|
952 |
||
52869 | 953 |
// used for compact number formatting patterns aliases |
954 |
typeKey = "decimalFormatLength[@type='"; |
|
955 |
start = path.indexOf(typeKey); |
|
956 |
if (start != -1) { |
|
957 |
String style = path.substring(start + typeKey.length(), path.indexOf("']", start)); |
|
958 |
return toJDKKey(qName, "", style); |
|
959 |
} |
|
960 |
||
31263 | 961 |
return calType + "." + toJDKKey(qName, context, width); |
962 |
} |
|
963 |
||
13583 | 964 |
@Override |
965 |
public void endElement(String uri, String localName, String qName) throws SAXException { |
|
966 |
assert qName.equals(currentContainer.getqName()) : "current=" + currentContainer.getqName() + ", param=" + qName; |
|
967 |
switch (qName) { |
|
968 |
case "calendar": |
|
969 |
assert !(currentContainer instanceof Entry); |
|
970 |
currentCalendarType = null; |
|
971 |
break; |
|
972 |
||
973 |
case "defaultNumberingSystem": |
|
974 |
if (currentContainer instanceof StringEntry) { |
|
975 |
defaultNumberingSystem = ((StringEntry) currentContainer).getValue(); |
|
976 |
assert defaultNumberingSystem != null; |
|
977 |
put(((StringEntry) currentContainer).getKey(), defaultNumberingSystem); |
|
978 |
} else { |
|
979 |
defaultNumberingSystem = null; |
|
980 |
} |
|
981 |
break; |
|
982 |
||
983 |
case "timeZoneNames": |
|
984 |
zonePrefix = null; |
|
985 |
break; |
|
31263 | 986 |
|
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
13583
diff
changeset
|
987 |
case "generic": |
13583 | 988 |
case "standard": |
989 |
case "daylight": |
|
49904
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
990 |
case "exemplarCity": |
13583 | 991 |
if (zonePrefix != null && (currentContainer instanceof Entry)) { |
992 |
@SuppressWarnings("unchecked") |
|
993 |
Map<String, String> valmap = (Map<String, String>) get(zonePrefix + getContainerKey()); |
|
994 |
Entry<?> entry = (Entry<?>) currentContainer; |
|
49904
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
995 |
if (qName.equals("exemplarCity")) { |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
996 |
put(CLDRConverter.EXEMPLAR_CITY_PREFIX + getContainerKey(), (String) entry.getValue()); |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
997 |
} else { |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
998 |
valmap.put(entry.getKey(), (String) entry.getValue()); |
cadca99d52e7
8181157: CLDR Timezone name fallback implementation
naoto
parents:
48251
diff
changeset
|
999 |
} |
13583 | 1000 |
} |
1001 |
break; |
|
31263 | 1002 |
|
1003 |
case "monthWidth": |
|
1004 |
case "dayWidth": |
|
1005 |
case "dayPeriodWidth": |
|
1006 |
case "quarterWidth": |
|
1007 |
currentWidth = ""; |
|
1008 |
putIfEntry(); |
|
1009 |
break; |
|
1010 |
||
1011 |
case "monthContext": |
|
1012 |
case "dayContext": |
|
1013 |
case "dayPeriodContext": |
|
1014 |
case "quarterContext": |
|
1015 |
currentContext = ""; |
|
1016 |
putIfEntry(); |
|
1017 |
break; |
|
52869 | 1018 |
case "decimalFormatLength": |
1019 |
currentStyle = ""; |
|
1020 |
compactCount = ""; |
|
1021 |
putIfEntry(); |
|
1022 |
break; |
|
13583 | 1023 |
default: |
31263 | 1024 |
putIfEntry(); |
1025 |
} |
|
1026 |
currentContainer = currentContainer.getParent(); |
|
1027 |
} |
|
1028 |
||
1029 |
private void putIfEntry() { |
|
1030 |
if (currentContainer instanceof AliasEntry) { |
|
1031 |
Entry<?> entry = (Entry<?>) currentContainer; |
|
1032 |
String containerqName = entry.getParent().getqName(); |
|
52869 | 1033 |
if (containerqName.equals("decimalFormatLength")) { |
1034 |
String srcKey = toJDKKey(containerqName, "", currentStyle); |
|
1035 |
String targetKey = getTarget(entry.getKey(), "", "", ""); |
|
1036 |
CLDRConverter.aliases.put(srcKey, targetKey); |
|
1037 |
} else { |
|
1038 |
Set<String> keyNames = populateAliasKeys(containerqName, currentContext, currentWidth); |
|
1039 |
if (!keyNames.isEmpty()) { |
|
1040 |
for (String keyName : keyNames) { |
|
1041 |
String[] tmp = keyName.split(",", 3); |
|
1042 |
String calType = currentCalendarType.lname(); |
|
1043 |
String src = calType+"."+tmp[0]; |
|
1044 |
String target = getTarget( |
|
1045 |
entry.getKey(), |
|
1046 |
calType, |
|
1047 |
tmp[1].length()>0 ? tmp[1] : currentContext, |
|
1048 |
tmp[2].length()>0 ? tmp[2] : currentWidth); |
|
1049 |
if (target.substring(target.lastIndexOf('.')+1).equals(containerqName)) { |
|
1050 |
target = target.substring(0, target.indexOf('.'))+"."+tmp[0]; |
|
1051 |
} |
|
1052 |
CLDRConverter.aliases.put(src.replaceFirst("^gregorian.", ""), |
|
1053 |
target.replaceFirst("^gregorian.", "")); |
|
31263 | 1054 |
} |
1055 |
} |
|
1056 |
} |
|
1057 |
} else if (currentContainer instanceof Entry) { |
|
48251
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1058 |
Entry<?> entry = (Entry<?>) currentContainer; |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1059 |
Object value = entry.getValue(); |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1060 |
if (value != null) { |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1061 |
String key = entry.getKey(); |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1062 |
// Tweak for MonthNames for the root locale, Needed for |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1063 |
// SimpleDateFormat.format()/parse() roundtrip. |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1064 |
if (id.equals("root") && key.startsWith("MonthNames")) { |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1065 |
value = new DateFormatSymbols(Locale.US).getShortMonths(); |
13583 | 1066 |
} |
48251
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1067 |
put(entry.getKey(), value); |
13583 | 1068 |
} |
1069 |
} |
|
1070 |
} |
|
48251
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1071 |
|
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1072 |
public String convertOldKeyName(String key) { |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1073 |
// Explicitly obtained from "alias" attribute in each "key" element. |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1074 |
switch (key) { |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1075 |
case "calendar": |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1076 |
return "ca"; |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1077 |
case "currency": |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1078 |
return "cu"; |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1079 |
case "collation": |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1080 |
return "co"; |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1081 |
case "numbers": |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1082 |
return "nu"; |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1083 |
case "timezone": |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1084 |
return "tz"; |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1085 |
default: |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1086 |
return key; |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1087 |
} |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1088 |
} |
57148c79bd75
8176841: Additional Unicode Language-Tag Extensions
naoto
parents:
47216
diff
changeset
|
1089 |
} |