Package net.fortuna.ical4j.model
Class TimeZoneRegistryImpl
- java.lang.Object
-
- net.fortuna.ical4j.model.TimeZoneRegistryImpl
-
- All Implemented Interfaces:
TimeZoneRegistry
public class TimeZoneRegistryImpl extends Object implements TimeZoneRegistry
$Id$ Created on 18/09/2005 The default implementation of aTimeZoneRegistry
. This implementation will search the classpath for applicable VTimeZone definitions used to back the provided TimeZone instances.
-
-
Field Summary
-
Fields inherited from interface net.fortuna.ical4j.model.TimeZoneRegistry
ZONE_ALIASES, ZONE_IDS
-
-
Constructor Summary
Constructors Constructor Description TimeZoneRegistryImpl()
Default constructor.TimeZoneRegistryImpl(String resourcePrefix)
Creates a new instance using the specified resource prefix.TimeZoneRegistryImpl(String resourcePrefix, boolean lenientTzResolution)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears all registered timezones.TimeZone
getTimeZone(String id)
Returns a timezone with the specified identifier.String
getTzId(String zoneId)
ZoneId
getZoneId(String tzId)
Map<String,ZoneRules>
getZoneRules()
void
register(TimeZone timezone)
Registers a new timezone for use with iCalendar objects.void
register(TimeZone timezone, boolean update)
Registers a new timezone for use with iCalendar objects.
-
-
-
Constructor Detail
-
TimeZoneRegistryImpl
public TimeZoneRegistryImpl()
Default constructor.
-
TimeZoneRegistryImpl
public TimeZoneRegistryImpl(String resourcePrefix)
Creates a new instance using the specified resource prefix.- Parameters:
resourcePrefix
- a prefix prepended to classpath resource lookups for default timezones
-
TimeZoneRegistryImpl
public TimeZoneRegistryImpl(String resourcePrefix, boolean lenientTzResolution)
-
-
Method Detail
-
register
public final void register(TimeZone timezone)
Registers a new timezone for use with iCalendar objects. If a timezone with the same identifier is already registered this timezone will take precedence.- Specified by:
register
in interfaceTimeZoneRegistry
- Parameters:
timezone
- a timezone to be registered for use with iCalendar objects
-
register
public final void register(TimeZone timezone, boolean update)
Registers a new timezone for use with iCalendar objects. If a timezone with the same identifier is already registered this timezone will take precedence.- Specified by:
register
in interfaceTimeZoneRegistry
- Parameters:
timezone
- a timezone to be registered for use with iCalendar objectsupdate
- attempt to update the definition from any specified TZURL property if true
-
clear
public final void clear()
Clears all registered timezones.- Specified by:
clear
in interfaceTimeZoneRegistry
-
getTimeZone
public final TimeZone getTimeZone(String id)
Returns a timezone with the specified identifier.- Specified by:
getTimeZone
in interfaceTimeZoneRegistry
- Parameters:
id
- a timezone identifier- Returns:
- a timezone matching the specified identifier. If no timezone is registered with the specified identifier null is returned.
-
getZoneRules
public Map<String,ZoneRules> getZoneRules()
- Specified by:
getZoneRules
in interfaceTimeZoneRegistry
-
getZoneId
public ZoneId getZoneId(String tzId)
- Specified by:
getZoneId
in interfaceTimeZoneRegistry
-
getTzId
public String getTzId(String zoneId)
- Specified by:
getTzId
in interfaceTimeZoneRegistry
-
-