public void parse (final int nYear, final HolidayMap aHolidayMap, final Holidays aConfig)
  {
    for (final FixedWeekdayBetweenFixed aFixedWeekdayBetweenFixed : aConfig.getFixedWeekdayBetweenFixed ())
    {
      if (!isValid (aFixedWeekdayBetweenFixed, nYear))
        continue;

      final DayOfWeek nExpectedWeekday = XMLHolidayHelper.getWeekday (aFixedWeekdayBetweenFixed.getWeekday ());
      LocalDate aFrom = XMLHolidayHelper.create (nYear, aFixedWeekdayBetweenFixed.getFrom ());
      final LocalDate aTo = XMLHolidayHelper.create (nYear, aFixedWeekdayBetweenFixed.getTo ());
      LocalDate aResult = null;
      while (!aFrom.isAfter (aTo))
      {
        if (aFrom.getDayOfWeek () == nExpectedWeekday)
        {
          aResult = aFrom;
          break;
        }
        aFrom = aFrom.plusDays (1);
      }

      if (aResult != null)
      {
        final IHolidayType aType = XMLHolidayHelper.getType (aFixedWeekdayBetweenFixed.getLocalizedType ());
        final String sPropertyKey = aFixedWeekdayBetweenFixed.getDescriptionPropertiesKey ();
        aHolidayMap.add (aResult, new ResourceBundleHoliday (aType, sPropertyKey));
      }
    }
  }
public void parse ( final int nYear , final HolidayMap aHolidayMap , final Holidays aConfig ) { for ( final FixedWeekdayBetweenFixed aFixedWeekdayBetweenFixed : aConfig . getFixedWeekdayBetweenFixed ( ) ) { if ( ! isValid ( aFixedWeekdayBetweenFixed , nYear ) ) continue ; final DayOfWeek nExpectedWeekday = XMLHolidayHelper . getWeekday ( aFixedWeekdayBetweenFixed . getWeekday ( ) ) ; LocalDate aFrom = XMLHolidayHelper . create ( nYear , aFixedWeekdayBetweenFixed . getFrom ( ) ) ; final LocalDate aTo = XMLHolidayHelper . create ( nYear , aFixedWeekdayBetweenFixed . getTo ( ) ) ; LocalDate aResult = null ; while ( ! aFrom . isAfter ( aTo ) ) { if ( aFrom . getDayOfWeek ( ) == nExpectedWeekday ) { aResult = aFrom ; break ; } aFrom = aFrom . plusDays ( 1 ) ; } if ( aResult != null ) { final IHolidayType aType = XMLHolidayHelper . getType ( aFixedWeekdayBetweenFixed . getLocalizedType ( ) ) ; final String sPropertyKey = aFixedWeekdayBetweenFixed . getDescriptionPropertiesKey ( ) ; aHolidayMap . add ( aResult , new ResourceBundleHoliday ( aType , sPropertyKey ) ) ; } } }
Parses the provided configuration and creates holidays for the provided
year.