public interface ZoneModelProvider
SPI interface which encapsulates the timezone repository and provides all necessary data and transitions 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 |
getFallback()
Determines if in case of a failed search another
ZoneModelProvider
should be called as alternative with possibly different rules. |
String |
getLocation()
Describes the location or source of the repository.
|
String |
getName()
Gets the name of the underlying repository.
|
default ZoneNameProvider |
getSpecificZoneNameRepository()
Queries if specific zone names are to be used.
|
String |
getVersion()
Queries the version of the underlying repository.
|
TransitionHistory |
load(String zoneID)
Loads an offset transition history 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)
Loads an offset transition history for given timezone id.
The argument never contains the provider name as prefix. It is instead the part after the "~"-char (if not absent).
zoneID - timezone id (i.e. "Europe/London")null if there are no dataIllegalArgumentException - if given id is wrongIllegalStateException - if timezone database is brokengetAvailableIDs(),
getAliases(),
TimeZone.getTimeZone(String)String getFallback()
Determines if in case of a failed search another ZoneModelProvider
should be called as alternative with possibly different rules.
The special name "DEFAULT" can be used to denote the default zone provider. Note that the fallback provider will only affect the rules but not the id or display names of a new timezone.
load(String)String getName()
Gets the name of the underlying repository.
The Olson/IANA-repository (and any provider which makes use of these data (direct or indirect)) has the name "TZDB". The names "java.util.TimeZone" and "DEFAULT" are reserved and cannot be used.
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.
default ZoneNameProvider getSpecificZoneNameRepository()
Queries if specific zone names are to be used.
null if not relevantCopyright © 2014–2017. All rights reserved.