public final class TzdbZoneRulesProvider extends ZoneRulesProvider
This class is public for the service loader to access.
| Constructor | Description |
|---|---|
TzdbZoneRulesProvider() |
Creates an instance.
|
TzdbZoneRulesProvider(java.io.InputStream stream) |
Creates an instance and loads the specified input stream.
|
TzdbZoneRulesProvider(java.net.URL url) |
Creates an instance and loads the specified URL.
|
| Modifier and Type | Method | 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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAvailableZoneIds, getRules, getVersions, provideRefresh, refresh, registerProviderpublic TzdbZoneRulesProvider()
ServiceLoader.ZoneRulesException - if unable to loadpublic TzdbZoneRulesProvider(java.net.URL url)
This could be used to wrap this provider in another instance.
url - the URL to load, not nullZoneRulesException - if unable to loadpublic TzdbZoneRulesProvider(java.io.InputStream stream)
This could be used to wrap this provider in another instance.
stream - the stream to load, not null, not closed after useZoneRulesException - 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 © 2007–2018 ThreeTen.org. All rights reserved.