Joda Time API

org.joda.time.tz
Class ZoneInfoProvider

java.lang.Object
  |
  +--org.joda.time.tz.ZoneInfoProvider
All Implemented Interfaces:
Provider

public class ZoneInfoProvider
extends java.lang.Object
implements Provider

ZoneInfoProvider loads compiled data files as generated by ZoneInfoCompiler.

Author:
Brian S O'Neill

Constructor Summary
ZoneInfoProvider(java.io.File fileDir)
          ZoneInfoProvider searches the given directory for compiled data files.
ZoneInfoProvider(java.lang.String resourcePath)
          ZoneInfoProvider searches the given ClassLoader resource path for compiled data files.
ZoneInfoProvider(java.lang.String resourcePath, java.lang.ClassLoader loader)
          ZoneInfoProvider searches the given ClassLoader resource path for compiled data files.
 
Method Summary
 java.util.Set getAvailableIDs()
          Returns an unmodifiable set of ids.
 DateTimeZone getDateTimeZone(java.lang.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(java.lang.Exception e)
          Called if an exception is thrown from getDateTimeZone while loading zone data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZoneInfoProvider

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

Throws:
java.io.IOException - if directory or map file cannot be read

ZoneInfoProvider

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

Throws:
java.io.IOException - if directory or map file cannot be read

ZoneInfoProvider

public ZoneInfoProvider(java.lang.String resourcePath,
                        java.lang.ClassLoader loader)
                 throws java.io.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.
Throws:
java.io.IOException - if directory or map file cannot be read
Method Detail

getDateTimeZone

public DateTimeZone getDateTimeZone(java.lang.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:
getDateTimeZone in interface Provider
Returns:
null if not found

getAvailableIDs

public java.util.Set getAvailableIDs()
Description copied from interface: Provider
Returns an unmodifiable set of ids. All providers must at least support id "UTC".

Specified by:
getAvailableIDs in interface Provider

uncaughtException

protected void uncaughtException(java.lang.Exception e)
Called if an exception is thrown from getDateTimeZone while loading zone data.


Joda Time API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.