public static interface Timezone.Provider
SPI interface which encapsulates the timezone repository and provides all necessary data for a given timezone id.
Implementations are usually stateless and should normally not
try to manage a cache. Instead Time4J uses its own cache. The
fact that this interface is used per java.util.ServiceLoader
requires a concrete implementation to offer a public no-arg
constructor.
ServiceLoader| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
getAliases()
Gets an alias table whose keys represent alternative identifiers
mapped to other aliases or finally canonical timezone IDs..
|
Set<String> |
getAvailableIDs()
Gets all available and supported timezone identifiers.
|
String |
getLocation()
Describes the location or source of the repository.
|
String |
getName()
Gets the name of the underlying repository.
|
String |
getVersion()
Queries the version of the underlying repository.
|
boolean |
isFallbackEnabled()
Determines if in case of a failed search another timezone should
be permitted as alternative with possibly different rules.
|
TransitionHistory |
load(String zoneID,
boolean fallback)
Loads an offset transition table for given timezone id.
|
Set<String> getAvailableIDs()
Gets all available and supported timezone identifiers.
TimeZone.getAvailableIDs()Map<String,String> getAliases()
Gets an alias table whose keys represent alternative identifiers mapped to other aliases or finally canonical timezone IDs..
Example: "PST" => "America/Los_Angeles".
TransitionHistory load(String zoneID, boolean fallback)
Loads an offset transition table for given timezone id.
This callback method has a second argument which indicates if
Time4J wants this method to return exactly matching data (default)
or permits the use of aliases (only possible if the method
isFallbackEnabled() returns true).
zoneID - timezone id (i.e. "Europe/London")fallback - fallback allowed if a timezone id cannot be
found, not even by alias?null if there are no dataIllegalStateException - if timezone database is brokengetAvailableIDs(),
getAliases(),
isFallbackEnabled(),
TimeZone.getTimeZone(String)boolean isFallbackEnabled()
Determines if in case of a failed search another timezone should be permitted as alternative with possibly different rules.
load(String, boolean)String getName()
Gets the name of the underlying repository.
The Olson/IANA-repository has the name "TZDB".
String getLocation()
Describes the location or source of the repository.
String getVersion()
Queries the version of the underlying repository.
In most cases the version has the Olson format starting with a four-digit year number followed by a small letter in range a-z.
Copyright © 2014. All rights reserved.