Package javax.time.calendar.zone
Class ResourceZoneRulesDataProvider
java.lang.Object
javax.time.calendar.zone.ResourceZoneRulesDataProvider
- All Implemented Interfaces:
ZoneRulesDataProvider
Loads time-zone rules stored in a file accessed via class loader.
ResourceZoneRulesDataProvider is thread-safe and immutable.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Version of the rules. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Loads the rules from a URL, often in a jar file. -
Method Summary
Modifier and TypeMethodDescriptionGets the time-zone group ID of the data available via this provider, such as 'TZDB'.Gets the provided region IDs.Gets the provided rules, version by version.(package private) static void
load()
Loads any time-zone rules data stored in files.private static List<ResourceZoneRulesDataProvider>
Loads the rules from files in the class loader, often jar files.(package private) ZoneRules
loadRule
(short index) Loads the rule.toString()
-
Field Details
-
groupID
The group ID. -
versions
All the versions in the provider. -
regions
All the regions in the provider. -
rules
The rules.
-
-
Constructor Details
-
ResourceZoneRulesDataProvider
Loads the rules from a URL, often in a jar file.- Parameters:
providers
- the list to add to, not nullurl
- the jar file to load, not null- Throws:
Exception
- if an error occursClassNotFoundException
IOException
-
-
Method Details
-
load
static void load()Loads any time-zone rules data stored in files.- Throws:
RuntimeException
- if the time-zone rules cannot be loaded
-
loadResources
Loads the rules from files in the class loader, often jar files.- Returns:
- the list of loaded rules, never null
- Throws:
Exception
- if an error occurs
-
getGroupID
Gets the time-zone group ID of the data available via this provider, such as 'TZDB'.Group IDs must match regex
[A-Za-z0-9._-]+
. Group IDs should use reverse domain name notation, like packages. Group IDs without a dot are reserved.- Specified by:
getGroupID
in interfaceZoneRulesDataProvider
- Returns:
- the ID of the group, never null
-
getVersions
Gets the provided rules, version by version.- Specified by:
getVersions
in interfaceZoneRulesDataProvider
- Returns:
- the provided rules, not to be modified, never null
-
getRegionIDs
Gets the provided region IDs.- Specified by:
getRegionIDs
in interfaceZoneRulesDataProvider
- Returns:
- the provided region IDs, not to be modified, never null
-
loadRule
Loads the rule.- Parameters:
index
- the index to retrieve- Returns:
- the rules, should not be null
- Throws:
Exception
-
toString
-