public final class TzdbZoneRulesProvider extends ZoneRulesProvider
This class is public for the service loader to access.
| Constructor and Description |
|---|
TzdbZoneRulesProvider()
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected ZoneRules |
provideRules(java.lang.String zoneId,
boolean forCaching)
SPI method to get the rules for the zone ID.
|
protected java.util.NavigableMap<java.lang.String,ZoneRules> |
provideVersions(java.lang.String zoneId)
SPI method to get the history of rules for the zone ID.
|
protected java.util.Set<java.lang.String> |
provideZoneIds()
SPI method to get the available zone IDs.
|
java.lang.String |
toString() |
getAvailableZoneIds, getRules, getVersions, provideRefresh, refresh, registerProviderpublic TzdbZoneRulesProvider()
ServiceLoader.ZoneRulesException - if unable to loadprotected java.util.Set<java.lang.String> provideZoneIds()
ZoneRulesProvider
This obtains the IDs that this ZoneRulesProvider provides.
A provider should provide data for at least one region.
The returned regions remain available and valid for the lifetime of the application. A dynamic provider may increase the set of regions as more data becomes available.
provideZoneIds in class ZoneRulesProviderprotected ZoneRules provideRules(java.lang.String zoneId, boolean forCaching)
ZoneRulesProviderThis loads the rules for the region and version specified. The version may be null to indicate the "latest" version.
provideRules in class ZoneRulesProviderzoneId - the time-zone region ID, not nullprotected java.util.NavigableMap<java.lang.String,ZoneRules> provideVersions(java.lang.String zoneId)
ZoneRulesProviderThis returns a map of historical rules keyed by a version string. The exact meaning and format of the version is provider specific. The version must follow lexicographical order, thus the returned map will be order from the oldest known rules to the newest available rules. The default 'TZDB' group uses version numbering consisting of the year followed by a letter, such as '2009e' or '2012f'.
Implementations must provide a result for each valid zone ID, however they do not have to provide a history of rules. Thus the map will always contain one element, and will only contain more than one element if historical rule information is available.
The returned versions remain available and valid for the lifetime of the application. A dynamic provider may increase the set of versions as more data becomes available.
provideVersions in class ZoneRulesProviderzoneId - the zone region ID as used by ZoneId, not nullpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014. All Rights Reserved.