public Map < LocaleID , ClassName > generate ( Path outputDir , DataReader reader ) throws IOException { Map < LocaleID , ClassName > numberClasses = new TreeMap <> ( ) ; Map < LocaleID , UnitData > unitMap = reader . units ( ) ; for ( Map . Entry < LocaleID , NumberData > entry : reader . numbers ( ) . entrySet ( ) ) { NumberData data = entry . getValue ( ) ; LocaleID localeId = entry . getKey ( ) ; String className = "_NumberFormatter_" + localeId . safe ; UnitData unitData = unitMap . get ( localeId ) ; TypeSpec type = create ( data , unitData , className ) ; CodeGenerator . saveClass ( outputDir , PACKAGE_CLDR_NUMBERS , className , type ) ; ClassName cls = ClassName . get ( PACKAGE_CLDR_NUMBERS , className ) ; numberClasses . put ( localeId , cls ) ; } // generate currency digit utility class String className = "_CurrencyUtil" ; TypeSpec type = createCurrencyUtil ( className , reader . currencies ( ) ) ; CodeGenerator . saveClass ( outputDir , PACKAGE_CLDR_NUMBERS , className , type ) ; return numberClasses ; }
Generate all number formatting classes .