/** * {@inheritDoc} * * Parses the provided configuration and creates holidays for the provided * year. */ @Override public void parse(int year, Set<Holiday> holidays, final Holidays config) { for (FixedWeekdayBetweenFixed fwm : config.getFixedWeekdayBetweenFixed()) { if (!isValid(fwm, year)) { continue; } LocalDate from = calendarUtil.create(year, fwm.getFrom()); LocalDate to = calendarUtil.create(year, fwm.getTo()); LocalDate result = null; while (!from.isAfter(to)) { if (from.getDayOfWeek() == xmlUtil.getWeekday(fwm.getWeekday())) { result = from; break; } from = from.plusDays(1); } if (result != null) { HolidayType type = xmlUtil.getType(fwm.getLocalizedType()); holidays.add(new Holiday(result, fwm.getDescriptionPropertiesKey(), type)); } } }