Package de.peacei.gae.foodsupplier.parser

Source Code of de.peacei.gae.foodsupplier.parser.MensaParserService

package de.peacei.gae.foodsupplier.parser;


import com.google.inject.Singleton;

import de.peacei.gae.foodsupplier.data.Mensa;
import de.peacei.gae.foodsupplier.data.Weekplan;

@Singleton
public class MensaParserService {

  public Weekplan readCurrentWeekplanForMensaWeekAndYear(Mensa mensa, int weekNumber, int year, String content) {
    if (mensa != null) {
      try {
        MensaParser mensaParser = mensa.getParserClass().newInstance();
        Weekplan weekplan = null;
        if (content != null) {
          weekplan = mensaParser.readWeekplanForWeek(content, weekNumber);
        }
        return weekplan;
      } catch (InstantiationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (IllegalAccessException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    return null;
  }
}
TOP

Related Classes of de.peacei.gae.foodsupplier.parser.MensaParserService

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.