1 /* |
1 /* |
2 * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
584 } |
585 } |
585 } else { |
586 } else { |
586 pushContainer(qName, attributes); |
587 pushContainer(qName, attributes); |
587 } |
588 } |
588 break; |
589 break; |
|
590 case "currencyFormats": |
|
591 case "decimalFormats": |
|
592 case "percentFormats": |
|
593 { |
|
594 String script = attributes.getValue("numberSystem"); |
|
595 if (script != null) { |
|
596 addNumberingScript(script); |
|
597 currentNumberingSystem = script + "."; |
|
598 } |
|
599 pushContainer(qName, attributes); |
|
600 } |
|
601 break; |
589 case "currencyFormatLength": |
602 case "currencyFormatLength": |
590 if (attributes.getValue("type") == null) { |
603 if (attributes.getValue("type") == null) { |
591 // skipping type="short" data |
604 // skipping type="short" data |
592 // for FormatData |
605 // for FormatData |
593 pushContainer(qName, attributes); |
606 pushContainer(qName, attributes); |
594 } else { |
607 } else { |
595 pushIgnoredContainer(qName); |
608 pushIgnoredContainer(qName); |
596 } |
609 } |
597 break; |
610 break; |
598 case "currencyFormat": |
611 case "currencyFormat": |
|
612 { |
|
613 // for FormatData |
|
614 // copy string for later assembly into NumberPatterns |
|
615 String cfStyle = attributes.getValue("type"); |
|
616 if (cfStyle.equals("standard")) { |
|
617 pushStringEntry(qName, attributes, |
|
618 currentNumberingSystem + "NumberPatterns/currency"); |
|
619 } else if (cfStyle.equals("accounting")) { |
|
620 pushStringEntry(qName, attributes, |
|
621 currentNumberingSystem + "NumberPatterns/accounting"); |
|
622 } else { |
|
623 pushIgnoredContainer(qName); |
|
624 } |
|
625 } |
|
626 break; |
|
627 case "percentFormat": |
599 // for FormatData |
628 // for FormatData |
600 // copy string for later assembly into NumberPatterns |
629 // copy string for later assembly into NumberPatterns |
601 if (attributes.getValue("type").equals("standard")) { |
630 if (attributes.getValue("type").equals("standard")) { |
602 pushStringEntry(qName, attributes, "NumberPatterns/currency"); |
631 pushStringEntry(qName, attributes, |
603 } else { |
632 currentNumberingSystem + "NumberPatterns/percent"); |
604 pushIgnoredContainer(qName); |
|
605 } |
|
606 break; |
|
607 case "percentFormat": |
|
608 // for FormatData |
|
609 // copy string for later assembly into NumberPatterns |
|
610 if (attributes.getValue("type").equals("standard")) { |
|
611 pushStringEntry(qName, attributes, "NumberPatterns/percent"); |
|
612 } else { |
633 } else { |
613 pushIgnoredContainer(qName); |
634 pushIgnoredContainer(qName); |
614 } |
635 } |
615 break; |
636 break; |
616 case "defaultNumberingSystem": |
637 case "defaultNumberingSystem": |
634 if (digits == null) { |
655 if (digits == null) { |
635 pushIgnoredContainer(qName); |
656 pushIgnoredContainer(qName); |
636 break; |
657 break; |
637 } |
658 } |
638 |
659 |
639 @SuppressWarnings("unchecked") |
660 addNumberingScript(script); |
640 List<String> numberingScripts = (List<String>) get("numberingScripts"); |
|
641 if (numberingScripts == null) { |
|
642 numberingScripts = new ArrayList<>(); |
|
643 put("numberingScripts", numberingScripts); |
|
644 } |
|
645 numberingScripts.add(script); |
|
646 put(currentNumberingSystem + "NumberElements/zero", digits.substring(0, 1)); |
661 put(currentNumberingSystem + "NumberElements/zero", digits.substring(0, 1)); |
647 pushContainer(qName, attributes); |
662 pushContainer(qName, attributes); |
648 } |
663 } |
649 break; |
664 break; |
650 case "decimal": |
665 case "decimal": |