Interface ZoneModelProvider

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.

Meno Hochschild
See Also:
  • Method Details

    • getAvailableIDs

      Set<String> getAvailableIDs()

      Gets all available and supported timezone identifiers.

      unmodifiable set of timezone ids
      See Also:
    • getAliases

      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".

      map from all timezone aliases to canoncial ids
    • load

      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")
      timezone history or null if there are no data
      IllegalArgumentException - if given id is wrong
      IllegalStateException - if timezone database is broken
      See Also:
      getAvailableIDs(), getAliases(), TimeZone.getTimeZone(String)
    • getFallback

      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.

      name of alternative provider or empty if no fallback happens
      See Also:
    • getName

      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.

    • getLocation

      String getLocation()

      Describes the location or source of the repository.

      String which refers to an URI or empty if unknown
    • getVersion

      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.

      String (for example "2011n") or empty if unknown
    • getSpecificZoneNameRepository

      default ZoneNameProvider getSpecificZoneNameRepository()

      Queries if specific zone names are to be used.

      specific name repository or null if not relevant