public abstract class HolidayManager extends Object
Modifier and Type | Field and Description |
---|---|
protected CalendarUtil |
calendarUtil
Utility for calendar operations
|
Constructor and Description |
---|
HolidayManager() |
Modifier and Type | Method and Description |
---|---|
static void |
clearManagerCache()
Clears the manager cache from all cached manager instances.
|
abstract void |
doInit() |
abstract CalendarHierarchy |
getCalendarHierarchy()
Returns the configured hierarchy structure for the specific manager.
|
ConfigurationDataSource |
getConfigurationDataSource()
Returns the
ConfigurationDataSource to be used to retrieve
holiday data. |
abstract Set<Holiday> |
getHolidays(int year,
String... args)
Returns the holidays for the requested year and hierarchy structure.
|
abstract Set<Holiday> |
getHolidays(LocalDate startDateInclusive,
LocalDate endDateInclusive,
String... args)
Returns the holidays for the requested interval and hierarchy structure.
|
static HolidayManager |
getInstance()
Creates a HolidayManager instance for the default locale country using
the configured properties from the configuration file.
|
static HolidayManager |
getInstance(HolidayCalendar c)
Deprecated.
Use
getInstance(ManagerParameter) instead. |
static HolidayManager |
getInstance(HolidayCalendar c,
Properties properties)
Deprecated.
Use
getInstance(ManagerParameter) instead. |
static HolidayManager |
getInstance(ManagerParameter parameter)
Creates and returns a
HolidayManager for the provided
ManagerParameters |
static HolidayManager |
getInstance(Properties properties)
Creates a HolidayManager instance for the default locale country using
the provided properties.
|
static HolidayManager |
getInstance(String calendar)
Deprecated.
Use
getInstance(ManagerParameter) instead. |
static HolidayManager |
getInstance(String calendar,
Properties properties)
Deprecated.
Use
getInstance(ManagerParameter) instead. |
ManagerParameter |
getManagerParameter() |
static Set<String> |
getSupportedCalendarCodes()
Returns a set of all currently supported calendar codes.
|
void |
init(ManagerParameter parameters)
Initializes the implementing manager for the provided calendar.
|
boolean |
isHoliday(Calendar c,
String... args)
Calls isHoliday with JODA time object.
|
boolean |
isHoliday(LocalDate c,
String... args)
Show if the requested date is a holiday.
|
static boolean |
isManagerCachingEnabled()
isManagerCachingEnabled.
|
void |
setConfigurationDataSource(ConfigurationDataSource configurationDataSource)
Sets the configuration datasource with this holiday manager.
|
static void |
setManagerCachingEnabled(boolean managerCachingEnabled)
If true, instantiated managers will be cached.
|
protected CalendarUtil calendarUtil
public static HolidayManager getInstance()
public static HolidayManager getInstance(Properties properties)
properties
- the overriding configuration properties.@Deprecated public static HolidayManager getInstance(HolidayCalendar c)
getInstance(ManagerParameter)
instead.c
- the HolidayCalendar
to use for creating a HolidayManager
instanceHolidayManager
@Deprecated public static HolidayManager getInstance(HolidayCalendar c, Properties properties)
getInstance(ManagerParameter)
instead.c
- the HolidayCalendar
to use for creating a HolidayManager
instanceproperties
- the configuration overriding Properties
HolidayManager
@Deprecated public static HolidayManager getInstance(String calendar)
getInstance(ManagerParameter)
instead.calendar
- the calendar to use for creating a HolidayManager
instanceHolidayManager
@Deprecated public static HolidayManager getInstance(String calendar, Properties properties)
getInstance(ManagerParameter)
instead.calendar
- the calendar to use for creating a HolidayManager
instanceproperties
- the configuration overriding Properties
HolidayManager
public static HolidayManager getInstance(ManagerParameter parameter)
HolidayManager
for the provided
ManagerParameters
parameter
- the ManagerParameters
to create the manager withHolidayManager
instancepublic static void setManagerCachingEnabled(boolean managerCachingEnabled)
managerCachingEnabled
- the managerCachingEnabled to setpublic static boolean isManagerCachingEnabled()
isManagerCachingEnabled.
public static void clearManagerCache()
public boolean isHoliday(Calendar c, String... args)
public boolean isHoliday(LocalDate c, String... args)
c
- The potential holiday.args
- Hierarchy to request the holidays for. i.e. args = {'ny'} ->
New York holidayspublic static Set<String> getSupportedCalendarCodes()
public void setConfigurationDataSource(ConfigurationDataSource configurationDataSource)
configurationDataSource
- the ConfigurationDataSource
to use.public ConfigurationDataSource getConfigurationDataSource()
ConfigurationDataSource
to be used to retrieve
holiday data.ConfigurationDataSource
to use.public ManagerParameter getManagerParameter()
public void init(ManagerParameter parameters)
parameters
- i.e. us, uk, depublic abstract void doInit()
public abstract Set<Holiday> getHolidays(int year, String... args)
year
- i.e. 2010args
- i.e. args = {'ny'}. returns US/New York holidays. No args ->
holidays common to whole countrypublic abstract Set<Holiday> getHolidays(LocalDate startDateInclusive, LocalDate endDateInclusive, String... args)
startDateInclusive
- the start date of the interval in which holidays lie, inclusiveendDateInclusive
- the end date of the interval in which holidays lie, inclusiveargs
- a String
object.public abstract CalendarHierarchy getCalendarHierarchy()
Copyright © 18.01.2010–2015. All rights reserved.