import org.jfin.date.holiday.HolidayCalendarFactory;
import org.jfin.date.holiday.HolidayCalendar;
import org.jfin.date.holiday.HolidayCalendarException;

/**
 * Created by IntelliJ IDEA.
 * User: dmb
 * Date: Oct 27, 2006
 * Time: 8:05:19 AM
 * To change this template use File | Settings | File Templates.
 */
public class CustomHolidayCalendarFactory extends HolidayCalendarFactory {
	public HolidayCalendar getHolidayCalendar(String locale) {
		// This is where you determine, based upon the locale string
		// what holiday calendar to return, and how it is configured
		if("TUES".equals(locale)) {
			return new TuesdayHolidayCalendar();
		} else {
			throw new HolidayCalendarException("We don't support the locale \""+locale+"\", try \"TUES\"");
		}
	}

	public String[] getAvailableLocales() {
		// Return the names of the locales
		// provided (here just TUES for the
		// tuesday holiday calendar
		return new String[]{"TUES"};
	}
}
