de.jaret.util.date.holidayenumerator
Class HolidayEnumeratorFactory

java.lang.Object
  extended by de.jaret.util.date.holidayenumerator.HolidayEnumeratorFactory

public class HolidayEnumeratorFactory
extends Object

Factory for supplying a configured HolidayEnumerator. HolidayEnumerators are charcterized by a locale and an optional additional RegionID. The latter is used to differentiate regions in a country and should be used more finegrained than the Locale's variant.

This factory searches in the package de.jaret.util.date.holidayenumertor for classes named "HolidayEnumerator_"+ locale string represenation (i.e. "de_DE"). They should have a no argument constructor or a constructor taking the regionId as an argument.

Version:
$Id: HolidayEnumeratorFactory.java 293 2007-03-11 17:50:57Z olk $
Author:
Peter Kliem

Constructor Summary
HolidayEnumeratorFactory()
           
 
Method Summary
static List<Locale> getAvailableHolidayEnumeratorLocales()
          Retrieve the list of Locales for that HolidayEnumerators can be found.
static HolidayEnumerator getHolidayEnumeratorInstance(Locale locale, String regionId)
          Supply a configured HolidayEnumerator for a locale and a RegionID.
static HolidayEnumerator getHolidayEnumeratorInstance(String languageAndCountry, String regionId)
          Supply holidayenumerator for a combinated String of language and country (e.g. de_DE) and an optional regionID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HolidayEnumeratorFactory

public HolidayEnumeratorFactory()
Method Detail

getHolidayEnumeratorInstance

public static HolidayEnumerator getHolidayEnumeratorInstance(Locale locale,
                                                             String regionId)
Supply a configured HolidayEnumerator for a locale and a RegionID. The RegionID is an addition to the locale concept, allowing differentiation beetween areas in a country.

Parameters:
locale - Locale for the HolidayEnumerator
regionId - optional RegionID. (may be null).
Returns:
configured HolidayEnumerator or null if no HolidayEnumerator is available for the specified locale.

getHolidayEnumeratorInstance

public static HolidayEnumerator getHolidayEnumeratorInstance(String languageAndCountry,
                                                             String regionId)
Supply holidayenumerator for a combinated String of language and country (e.g. de_DE) and an optional regionID.

Parameters:
languageAndCountry - languag_country
regionId - optional region ID
Returns:
holidayenumerator or null if not available or arguments not valid

getAvailableHolidayEnumeratorLocales

public static List<Locale> getAvailableHolidayEnumeratorLocales()
Retrieve the list of Locales for that HolidayEnumerators can be found. This operation tries to instantiate the holiday enumerators, so it is quite expensive the first time called.

Returns:
List of Locales.


Copyright © 2013. All Rights Reserved.