Coverage Report - de.jollyday.parser.impl.HinduHolidayParser
 
Classes in this File Line Coverage Branch Coverage Complexity
HinduHolidayParser
0%
0/10
0%
0/6
5
HinduHolidayParser$1
0%
0/1
N/A
5
 
 1  
 /**
 2  
  * Copyright 2010 Sven Diedrichsen 
 3  
  * 
 4  
  * Licensed under the Apache License, Version 2.0 (the "License"); 
 5  
  * you may not use this file except in compliance with the License. 
 6  
  * You may obtain a copy of the License at 
 7  
  * 
 8  
  * http://www.apache.org/licenses/LICENSE-2.0 
 9  
  * 
 10  
  * Unless required by applicable law or agreed to in writing, software 
 11  
  * distributed under the License is distributed on an 
 12  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
 13  
  * express or implied. See the License for the specific language 
 14  
  * governing permissions and limitations under the License. 
 15  
  */
 16  
 package de.jollyday.parser.impl;
 17  
 
 18  
 import java.util.Set;
 19  
 
 20  
 import de.jollyday.Holiday;
 21  
 import de.jollyday.config.HinduHoliday;
 22  
 import de.jollyday.config.Holidays;
 23  
 import de.jollyday.parser.AbstractHolidayParser;
 24  
 
 25  
 /**
 26  
  * <p>HinduHolidayParser class.</p>
 27  
  *
 28  
  * @author Sven
 29  
  * @version $Id: $
 30  
  */
 31  0
 public class HinduHolidayParser extends AbstractHolidayParser {
 32  
 
 33  
         /** {@inheritDoc} */
 34  
         @Override
 35  
         public void parse(int year, Set<Holiday> holidays, final Holidays config) {
 36  0
                 for (HinduHoliday hh : config.getHinduHoliday()) {
 37  0
                         if (!isValid(hh, year))
 38  0
                                 continue;
 39  0
                         switch (hh.getType()) {
 40  
                         case HOLI:
 41  
                                 // 20 February and ending on 21 March (20th march in leap years)
 42  
                                 // TODO: Calculate with hindu calendar.
 43  0
                                 break;
 44  
                         default:
 45  0
                                 throw new IllegalArgumentException("Unknown hindu holiday "
 46  0
                                                 + hh.getType());
 47  
                         }
 48  0
                 }
 49  0
         }
 50  
 
 51  
 }