Class ResourceZoneRulesDataProvider

java.lang.Object
javax.time.calendar.zone.ResourceZoneRulesDataProvider
All Implemented Interfaces:
ZoneRulesDataProvider

final class ResourceZoneRulesDataProvider extends Object implements ZoneRulesDataProvider
Loads time-zone rules stored in a file accessed via class loader.

ResourceZoneRulesDataProvider is thread-safe and immutable.

  • Field Details

  • Constructor Details

  • 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

      private static List<ResourceZoneRulesDataProvider> 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

      public String 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 interface ZoneRulesDataProvider
      Returns:
      the ID of the group, never null
    • getVersions

      public Set<ZoneRulesVersion> getVersions()
      Gets the provided rules, version by version.
      Specified by:
      getVersions in interface ZoneRulesDataProvider
      Returns:
      the provided rules, not to be modified, never null
    • getRegionIDs

      public Set<String> getRegionIDs()
      Gets the provided region IDs.
      Specified by:
      getRegionIDs in interface ZoneRulesDataProvider
      Returns:
      the provided region IDs, not to be modified, never null
    • loadRule

      ZoneRules loadRule(short index) throws Exception
      Loads the rule.
      Parameters:
      index - the index to retrieve
      Returns:
      the rules, should not be null
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object