private static MethodSpec indexFormatters ( String methodName , String registerMethodName , Map < LocaleID , ClassName > dateClasses ) { MethodSpec . Builder method = MethodSpec . methodBuilder ( methodName ) . addModifiers ( PRIVATE , STATIC ) ; for ( Map . Entry < LocaleID , ClassName > entry : dateClasses . entrySet ( ) ) { LocaleID localeId = entry . getKey ( ) ; ClassName className = entry . getValue ( ) ; method . addStatement ( "$T.$L(Locale.$L, $L.class)" , CLDR_BASE , registerMethodName , localeId . safe , className ) ; } return method . build ( ) ; }
Generates a static code block that populates the formatter map .