Package net.time4j.format
Interface TextProvider
public interface TextProvider
This SPI-interface enables the access to calendrical
standard text informations and will be instantiated by a
ServiceLoader
-mechanism.
The motivation is mainly to override the language-dependent forms of JDK-defaults with respect to standard elements like months, weekdays etc. Specific text forms which are not contained in JDK will instead be supplied by help of properties-files in the "data"-folder.
Note: All implementations must have a public no-arg constructor.
- Since:
- 2.0
- Author:
- Meno Hochschild
- See Also:
ServiceLoader
-
Method Summary
Modifier and TypeMethodDescriptionString[]
Locale[]
Yields the supported languages.String[]
Defines the supported calendar types.String[]
meridiems(String calendarType, Locale locale, TextWidth textWidth, OutputContext outputContext)
String[]
months(String calendarType, Locale locale, TextWidth textWidth, OutputContext outputContext, boolean leapForm)
String[]
quarters(String calendarType, Locale locale, TextWidth textWidth, OutputContext outputContext)
boolean
supportsCalendarType(String calendarType)
Queries if a calendar type is supported by this text provider.boolean
supportsLanguage(Locale language)
Queries if a language is supported by this text provider.String[]
weekdays(String calendarType, Locale locale, TextWidth textWidth, OutputContext outputContext)
-
Method Details
-
supportsCalendarType
Queries if a calendar type is supported by this text provider.
- Parameters:
calendarType
- the calendar type to be checked- Returns:
true
if given calendar type is supported elsefalse
- Since:
- 3.32/4.27
- See Also:
CalendarType
-
supportsLanguage
Queries if a language is supported by this text provider.
- Parameters:
language
- the language to be checked- Returns:
true
if given language is supported elsefalse
- Since:
- 3.32/4.27
-
getSupportedCalendarTypes
String[] getSupportedCalendarTypes()Defines the supported calendar types.
- Returns:
- String-array with calendar types
- See Also:
CalendarType
-
getAvailableLocales
Locale[] getAvailableLocales()Yields the supported languages.
Only the language part will be evaluated.
- Returns:
- Locale-array
- See Also:
Locale.getLanguage()
-
months
String[] months(String calendarType, Locale locale, TextWidth textWidth, OutputContext outputContext, boolean leapForm)- Parameters:
calendarType
- calendar typelocale
- language of text outputtextWidth
- text widthoutputContext
- output contextleapForm
- use leap form (for example the hebrew month "Adar II")?- Returns:
- unmodifiable sorted array of month names
-
quarters
String[] quarters(String calendarType, Locale locale, TextWidth textWidth, OutputContext outputContext)- Parameters:
calendarType
- calendar typelocale
- language of text outputtextWidth
- text widthoutputContext
- output context- Returns:
- unmodifiable sorted array of quarter names
-
weekdays
String[] weekdays(String calendarType, Locale locale, TextWidth textWidth, OutputContext outputContext)- Parameters:
calendarType
- calendar typelocale
- language of text outputtextWidth
- text widthoutputContext
- output context- Returns:
- unmodifiable sorted array of weekday names in calendar specific order (ISO-8601 starts with monday)
-
eras
- Parameters:
calendarType
- calendar typelocale
- language of text outputtextWidth
- text width- Returns:
- unmodifiable sorted array of era names
-
meridiems
String[] meridiems(String calendarType, Locale locale, TextWidth textWidth, OutputContext outputContext)- Parameters:
calendarType
- calendar typelocale
- language of text outputtextWidth
- text widthoutputContext
- output context- Returns:
- unmodifiable sorted array of AM/PM-names
-