
package de.ivu.elect.business.staat.boundary;

import java.util.List;

import javax.ejb.Stateless;
import javax.inject.Inject;

import de.ivu.elect.business.exchange.control.AbstractExporter;
import de.ivu.elect.business.exchange.control.ExportExchange;
import de.ivu.elect.business.exchange.control.NoContext;
import de.ivu.elect.business.exchange.entity.DateiExportArt;
import de.ivu.elect.business.staat.control.StaatExportExchange;
import de.ivu.elect.business.staat.entity.Staat;

@Stateless
public class StaatExporter extends AbstractExporter<List<Staat>, NoContext> {

  @Inject
  private StaatExportExchange exportExchange;

  @Inject
  private StaatDAO staatDao;

  public StaatExporter() {
    super();
  }

  @Override
  protected ExportExchange<List<Staat>, NoContext> getExchange() {
    return exportExchange;
  }

  @Override
  protected boolean isExportHeader() {
    return true;
  }

  @Override
  protected List<Staat> getExportObject(NoContext context) {
    return staatDao.findByAllOrderedByNameStaat();
  }

  @Override
  protected DateiExportArt getDateiExportArt() {
    return DateiExportArt.STAAT_EXPORT;
  }
}
