APIdia Launch Partner
Top Description Fields Constructors Methods
sun.util.locale.provider

public Class DateTimeFormatterPatternProviderImpl

extends DateTimeFormatterPatternProvider
implements AvailableLanguageTags
Class Inheritance
All Implemented Interfaces
sun.util.locale.provider.AvailableLanguageTags
Imports
java.time.DateTimeException, java.time.format.DateTimeFormatterPatternProvider, .FormatStyle, java.util.Locale, .Objects, .Optional, .Set

Concrete implementation of the java.time.format.DateTimeFormatterPatternProvider class

Field Summary

Modifier and TypeField and Description
private final Set<String>
private final LocaleProviderAdapter.Type

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Set<String>
getAvailableLanguageTags()

Implements sun.util.locale.provider.AvailableLanguageTags.getAvailableLanguageTags.

Returns a set of available language tags of a LocaleServiceProvider.

public Locale[]

Returns:

an array of all locales for which this locale service provider can provide localized objects or names
getAvailableLocales
()

Implements abstract java.util.spi.LocaleServiceProvider.getAvailableLocales.

Returns an array of all locales for which this locale service provider can provide localized objects or names.

public String
getDateTimeFormatterPattern(FormatStyle dateStyle, FormatStyle timeStyle, String calType, Locale locale)

Implements abstract java.time.format.DateTimeFormatterPatternProvider.getDateTimeFormatterPattern.

Returns the localized pattern string for the date style, time style, calendar type, and locale.

public String
getDateTimeFormatterPattern(String requestedTemplate, String calType, Locale locale)

Implements abstract java.time.format.DateTimeFormatterPatternProvider.getDateTimeFormatterPattern.

Returns the localized pattern string for the requested template, calendar type, and locale.

public boolean
isSupportedLocale(Locale locale)

Overrides java.util.spi.LocaleServiceProvider.isSupportedLocale.

Returns true if the given locale is supported by this locale service provider.

Field Detail

langtagsback to summary
private final Set<String> langtags
typeback to summary
private final LocaleProviderAdapter.Type type

Constructor Detail

DateTimeFormatterPatternProviderImplback to summary
public DateTimeFormatterPatternProviderImpl(LocaleProviderAdapter.Type type, Set<String> langtags)

Method Detail

getAvailableLanguageTagsback to summary
public Set<String> getAvailableLanguageTags()

Implements sun.util.locale.provider.AvailableLanguageTags.getAvailableLanguageTags.

Doc from sun.util.locale.provider.AvailableLanguageTags.getAvailableLanguageTags.

Returns a set of available language tags of a LocaleServiceProvider. Note that the returned set doesn't contain the language tag for Locale.Root.

Annotations
@Override
getAvailableLocalesback to summary
public Locale[] getAvailableLocales()

Implements abstract java.util.spi.LocaleServiceProvider.getAvailableLocales.

Returns an array of all locales for which this locale service provider can provide localized objects or names.

Returns:Locale[]

an array of all locales for which this locale service provider can provide localized objects or names

Annotations
@Override
getDateTimeFormatterPatternback to summary
public String getDateTimeFormatterPattern(FormatStyle dateStyle, FormatStyle timeStyle, String calType, Locale locale)

Implements abstract java.time.format.DateTimeFormatterPatternProvider.getDateTimeFormatterPattern.

Doc from java.time.format.DateTimeFormatterPatternProvider.getDateTimeFormatterPattern.

Returns the localized pattern string for the date style, time style, calendar type, and locale. Either dateStyle or timeStyle may be null. In such cases, the returned pattern represents only the time or only the date, respectively. If both are null, an IllegalArgumentException is thrown.

Annotations
@Override
getDateTimeFormatterPatternback to summary
public String getDateTimeFormatterPattern(String requestedTemplate, String calType, Locale locale)

Implements abstract java.time.format.DateTimeFormatterPatternProvider.getDateTimeFormatterPattern.

Doc from java.time.format.DateTimeFormatterPatternProvider.getDateTimeFormatterPattern.

Returns the localized pattern string for the requested template, calendar type, and locale. The requestedTemplate must match the regular expression described in DateTimeFormatterBuilder#appendLocalized(String); otherwise, an IllegalArgumentException is thrown.

Annotations
@Override
isSupportedLocaleback to summary
public boolean isSupportedLocale(Locale locale)

Overrides java.util.spi.LocaleServiceProvider.isSupportedLocale.

Doc from java.util.spi.LocaleServiceProvider.isSupportedLocale.

Returns true if the given locale is supported by this locale service provider. The given locale may contain extensions that should be taken into account for the support determination.

The default implementation returns true if the given locale is equal to any of the available Locales returned by getAvailableLocales() with ignoring any extensions in both the given locale and the available locales. Concrete locale service provider implementations should override this method if those implementations are Locale extensions-aware. For example, DecimalFormatSymbolsProvider implementations will need to check extensions in the given locale to see if any numbering system is specified and can be supported. However, CollatorProvider implementations may not be affected by any particular numbering systems, and in that case, extensions for numbering systems should be ignored.

Annotations
@Override