Annotation Interface BusinessCalendar


@Target(TYPE) @Retention(RUNTIME) public @interface BusinessCalendar
Indicates that annotated interface is a "Business Calendar". Business calendar contains information about holidays and working schedule and provides methods for calculating and checking "business days" and "business time".

Annotated interfaces are parsed by the AnnotatedBusinessCalendarProvider and BusinessCalendar objects are created using the information from the annotated interface.

Business calendar definition example:

 @BusinessCalendar(name = "calendarName", code = "uniqueCalendarCode")
 public interface AnnotatedBusinessCalendarExample {

     @CronHoliday(expression = "* * * ? * SAT *", isWeekly = true)
     @CronHoliday(expression = "* * * 1-2 MAY ? *")
     void cronHolidays();

     @FixedDayHoliday(fixedDate = "2021-05-08")
     @FixedDayHoliday(fixedDate = "2021-05-09")
     void fixedHolidays();

     @FixedYearlyHoliday(month = Month.NOVEMBER, dayOfMonth = 4)
     @FixedYearlyHoliday(month = Month.JUNE, dayOfMonth = 12)
     void fixedYearlyHolidays();

     @ScheduledBusinessDay(dayOfWeek = DayOfWeek.MONDAY, startTime = "08:00", endTime = "17:00")
     @ScheduledBusinessDay(dayOfWeek = DayOfWeek.WEDNESDAY, startTime = "09:00", endTime = "17:00")
     @ScheduledBusinessDay(dayOfWeek = DayOfWeek.FRIDAY, startTime = "10:00", endTime = "15:00")
     void scheduledBusinessDays();

     @AdditionalBusinessDay(fixedDate = "2021-05-06", startTime = "10:00", endTime = "16:30")
     @AdditionalBusinessDay(fixedDate = "2021-05-07", startTime = "10:00", endTime = "16:30")
     void additionalBusinessDays();
 }
 
Business calendar interface can have any number of methods. Methods can have any names, they are used only to group holidays or working days logically. Methods return type does not matter.
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Unique identifier of business calendar.
    Business calendar name
  • Element Details

    • name

      String name
      Business calendar name
    • code

      String code
      Unique identifier of business calendar.