public GlobalizationPreferences setLocales ( String acceptLanguageString ) { if ( isFrozen ( ) ) { throw new UnsupportedOperationException ( "Attempt to modify immutable object" ) ; } ULocale [ ] acceptLocales = null ; try { acceptLocales = ULocale . parseAcceptLanguage ( acceptLanguageString , true ) ; } catch ( ParseException pe ) { //TODO: revisit after 3.8 throw new IllegalArgumentException ( "Invalid Accept-Language string" ) ; } return setLocales ( acceptLocales ) ; }
Convenience routine for setting the locale priority list from an Accept - Language string .