下面列出了java.util.spi.LocaleServiceProvider#getAvailableLocales ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleProviderAdapter.Type type : LocaleProviderAdapter.getAdapterPreference()) {
LocaleProviderAdapter lda = LocaleProviderAdapter.forType(type);
if (lda != null) {
LocaleServiceProvider lsp = lda.getLocaleServiceProvider(providerClass);
if (lsp != null) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleProviderAdapter.Type type : LocaleProviderAdapter.getAdapterPreference()) {
LocaleProviderAdapter lda = LocaleProviderAdapter.forType(type);
if (lda != null) {
LocaleServiceProvider lsp = lda.getLocaleServiceProvider(providerClass);
if (lsp != null) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}
/**
* Returns the union of locale sets that are available from
* each service provider. This method does NOT return the
* defensive copy.
*
* @return a set of available locales
*/
private synchronized Set<Locale> getAvailableLocaleSet() {
if (availableLocales == null) {
availableLocales = new HashSet<>();
for (LocaleServiceProvider lsp : providers.values()) {
Locale[] locales = lsp.getAvailableLocales();
for (Locale locale: locales) {
availableLocales.add(getLookupLocale(locale));
}
}
}
return availableLocales;
}