public void generate ( Path outputDir , DataReader reader ) throws IOException { String className = "_PluralRules" ; TypeSpec . Builder type = TypeSpec . classBuilder ( className ) . addModifiers ( PUBLIC ) . superclass ( TYPE_BASE ) ; Map < String , FieldSpec > fieldMap = buildConditionFields ( reader . cardinals ( ) , reader . ordinals ( ) ) ; for ( Map . Entry < String , FieldSpec > entry : fieldMap . entrySet ( ) ) { type . addField ( entry . getValue ( ) ) ; } buildPluralMethod ( type , "Cardinal" , reader . cardinals ( ) , fieldMap ) ; buildPluralMethod ( type , "Ordinal" , reader . ordinals ( ) , fieldMap ) ; CodeGenerator . saveClass ( outputDir , PACKAGE_CLDR_PLURALS , className , type . build ( ) ) ; }
Generate a class for plural rule evaluation .