Top Description Fields Constructors Methods
net.fortuna.ical4j.model

public Class TimeZoneRegistryImpl

extends Object
implements TimeZoneRegistry
Class Inheritance
All Implemented Interfaces
net.fortuna.ical4j.model.TimeZoneRegistry
Imports
net.fortuna.ical4j.data.ParserException, net.fortuna.ical4j.util.CompatibilityHints, .ResourceLoader, org.apache.commons.lang3.Validate, org.slf4j.LoggerFactory, java.io.IOException, java.time.DateTimeException, .ZoneId, java.time.zone.ZoneRules, java.util.*, java.util.concurrent.ConcurrentHashMap, java.util.regex.Pattern

$Id$

Created on 18/09/2005

The default implementation of a TimeZoneRegistry. This implementation will search the classpath for applicable VTimeZone definitions used to back the provided TimeZone instances.

Author
Ben Fortuna

Field Summary

Modifier and TypeField and Description
private static final Properties
private static final String
private static final Map<String, TimeZone>
private final boolean
private final TimeZoneLoader
private final Map<String, TimeZone>
private static final Pattern
private final Map<String, String>
private final Map<String, ZoneRules>

Constructor Summary

AccessConstructor and Description
public
TimeZoneRegistryImpl()

Default constructor.

public
TimeZoneRegistryImpl(final String
a prefix prepended to classpath resource lookups for default timezones
resourcePrefix
)

Creates a new instance using the specified resource prefix.

public
TimeZoneRegistryImpl(final String resourcePrefix, boolean lenientTzResolution)

Method Summary

Modifier and TypeMethod and Description
public final void
clear()

Implements net.fortuna.ical4j.model.TimeZoneRegistry.clear.

Clears all registered timezones.

public final TimeZone
getTimeZone(final String
a timezone identifier
id
)

Implements net.fortuna.ical4j.model.TimeZoneRegistry.getTimeZone.

Returns a timezone with the specified identifier, potentially performing a network call to update the definition.

public String
public ZoneId
public Map<String, ZoneRules>
public final void
register(final TimeZone
a timezone to be registered for use with iCalendar objects
timezone
)

Implements net.fortuna.ical4j.model.TimeZoneRegistry.register.

Registers a new timezone for use with iCalendar objects.

public final void
register(final TimeZone
a timezone to be registered for use with iCalendar objects
timezone
,
boolean
attempt to update the definition from any specified TZURL property if true
update
)

Implements net.fortuna.ical4j.model.TimeZoneRegistry.register.

Registers a new timezone for use with iCalendar objects.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALIASESback to summary
private static final Properties ALIASES
DEFAULT_RESOURCE_PREFIXback to summary
private static final String DEFAULT_RESOURCE_PREFIX
DEFAULT_TIMEZONESback to summary
private static final Map<String, TimeZone> DEFAULT_TIMEZONES
lenientTzResolutionback to summary
private final boolean lenientTzResolution
timeZoneLoaderback to summary
private final TimeZoneLoader timeZoneLoader
timezonesback to summary
private final Map<String, TimeZone> timezones
TZ_ID_SUFFIXback to summary
private static final Pattern TZ_ID_SUFFIX
zoneIdsback to summary
private final Map<String, String> zoneIds
zoneRulesback to summary
private final Map<String, ZoneRules> zoneRules

Constructor Detail

TimeZoneRegistryImplback to summary
public TimeZoneRegistryImpl()

Default constructor.

TimeZoneRegistryImplback to summary
public TimeZoneRegistryImpl(final String resourcePrefix)

Creates a new instance using the specified resource prefix.

Parameters
resourcePrefix:String

a prefix prepended to classpath resource lookups for default timezones

TimeZoneRegistryImplback to summary
public TimeZoneRegistryImpl(final String resourcePrefix, boolean lenientTzResolution)

Method Detail

clearback to summary
public final void clear()

Implements net.fortuna.ical4j.model.TimeZoneRegistry.clear.

Doc from net.fortuna.ical4j.model.TimeZoneRegistry.clear.

Clears all registered timezones.

Annotations
@Override
getTimeZoneback to summary
public final TimeZone getTimeZone(final String id)

Implements net.fortuna.ical4j.model.TimeZoneRegistry.getTimeZone.

Doc from net.fortuna.ical4j.model.TimeZoneRegistry.getTimeZone.

Returns a timezone with the specified identifier, potentially performing a network call to update the definition.

Timezone definitions are cached in memory, but in case of a cache miss, a request to tzurl.org is done in a synchronized block.

Parameters
id:String

a timezone identifier

Returns:TimeZone

a timezone matching the specified identifier. If no timezone is registered with the specified identifier null is returned.

Annotations
@Override
getTzIdback to summary
public String getTzId(String zoneId)

Implements net.fortuna.ical4j.model.TimeZoneRegistry.getTzId.

Annotations
@Override
getZoneIdback to summary
public ZoneId getZoneId(String tzId)

Implements net.fortuna.ical4j.model.TimeZoneRegistry.getZoneId.

Annotations
@Override
getZoneRulesback to summary
public Map<String, ZoneRules> getZoneRules()

Implements net.fortuna.ical4j.model.TimeZoneRegistry.getZoneRules.

Annotations
@Override
registerback to summary
public final void register(final TimeZone timezone)

Implements net.fortuna.ical4j.model.TimeZoneRegistry.register.

Doc from net.fortuna.ical4j.model.TimeZoneRegistry.register.

Registers a new timezone for use with iCalendar objects. If a timezone with the same identifier is already registered this timezone will take precedence.

Parameters
timezone:TimeZone

a timezone to be registered for use with iCalendar objects

Annotations
@Override
registerback to summary
public final void register(final TimeZone timezone, boolean update)

Implements net.fortuna.ical4j.model.TimeZoneRegistry.register.

Doc from net.fortuna.ical4j.model.TimeZoneRegistry.register.

Registers a new timezone for use with iCalendar objects. If a timezone with the same identifier is already registered this timezone will take precedence.

Parameters
timezone:TimeZone

a timezone to be registered for use with iCalendar objects

update:boolean

attempt to update the definition from any specified TZURL property if true

Annotations
@Override