org.joda.time.tz

Class ZoneInfoProvider

Implemented Interfaces:
Provider

public class ZoneInfoProvider
extends java.lang.Object
implements Provider

ZoneInfoProvider loads compiled data files as generated by ZoneInfoCompiler.

ZoneInfoProvider is thread-safe and publicly immutable.

Author:
Brian S O'Neill
Since:
1.0

Constructor Summary

ZoneInfoProvider(File fileDir)
ZoneInfoProvider searches the given directory for compiled data files.
ZoneInfoProvider(String resourcePath)
ZoneInfoProvider searches the given ClassLoader resource path for compiled data files.
ZoneInfoProvider(String resourcePath, ClassLoader loader)
ZoneInfoProvider searches the given ClassLoader resource path for compiled data files.

Method Summary

Set
getAvailableIDs()
Gets a list of all the available zone ids.
DateTimeZone
getZone(String id)
If an error is thrown while loading zone data, uncaughtException is called to log the error and null is returned for this and all future requests.
protected void
uncaughtException(Exception ex)
Called if an exception is thrown from getZone while loading zone data.

Constructor Details

ZoneInfoProvider

public ZoneInfoProvider(File fileDir)
            throws IOException
ZoneInfoProvider searches the given directory for compiled data files.

ZoneInfoProvider

public ZoneInfoProvider(String resourcePath)
            throws IOException
ZoneInfoProvider searches the given ClassLoader resource path for compiled data files. Resources are loaded from the ClassLoader that loaded this class.

ZoneInfoProvider

public ZoneInfoProvider(String resourcePath,
                        ClassLoader loader)
            throws IOException
ZoneInfoProvider searches the given ClassLoader resource path for compiled data files.
Parameters:
loader - ClassLoader to load compiled data files from. If null, use system ClassLoader.

Method Details

getAvailableIDs

public Set getAvailableIDs()
Gets a list of all the available zone ids.
Specified by:
getAvailableIDs in interface Provider
Returns:
the zone ids

getZone

public DateTimeZone getZone(String id)
If an error is thrown while loading zone data, uncaughtException is called to log the error and null is returned for this and all future requests.
Specified by:
getZone in interface Provider
Parameters:
id - the id to load
Returns:
the loaded zone

uncaughtException

protected void uncaughtException(Exception ex)
Called if an exception is thrown from getZone while loading zone data.
Parameters:
ex - the exception

Copyright (c) 2001-2006 - Joda.org