< prev index next >

make/jdk/src/classes/build/tools/cldrconverter/MetaZonesParseHandler.java

Print this page
rev 49555 : [mq]: 8189784

*** 1,7 **** /* ! * Copyright (c) 2012, 2013, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2012, 2018, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 25,41 **** --- 25,48 ---- package build.tools.cldrconverter; import java.io.File; import java.io.IOException; + import java.util.*; + import java.util.stream.*; + import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; class MetaZonesParseHandler extends AbstractLDMLHandler<String> { private String tzid, metazone; + // for java.time.format.ZoneNames.java + private List<String> mzoneMapEntryList = new ArrayList<>(); + private Map<String, String> zones = new HashMap<>(); + MetaZonesParseHandler() { } @Override public InputSource resolveEntity(String publicID, String systemID) throws IOException, SAXException {
*** 62,71 **** --- 69,91 ---- metazone = attributes.getValue("mzone"); } pushIgnoredContainer(qName); break; + case "mapZone": + String territory = attributes.getValue("territory"); + if (territory.equals("001")) { + zones.put(attributes.getValue("other"), attributes.getValue("type")); + } else { + mzoneMapEntryList.add(String.format(" \"%s\", \"%s\", \"%s\",", + attributes.getValue("other"), + territory, + attributes.getValue("type"))); + } + pushIgnoredContainer(qName); + break; + case "version": case "generation": pushIgnoredContainer(qName); break;
*** 87,92 **** --- 107,120 ---- put(tzid, metazone); break; } currentContainer = currentContainer.getParent(); } + + public Map<String, String> zidMap() { + return zones; + } + + public Stream<String> mzoneMapEntry() { + return mzoneMapEntryList.stream(); + } }
< prev index next >