package de.ivu.elect.presentation.exchange;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Instance;
import javax.inject.Inject;

import de.ivu.elect.presentation.View;

@RequestScoped
public class SupportedFileFormatErmittlerViewResolver implements Serializable {

  @View
  @Inject
  // Wildfly Anpassung, auf --Object-- ImportExportViewMarker gehen und dann per instanceof prüfen
  transient Instance<ImportExportViewMarker> views;

  public List<AbstractImportExportView> getViews() {
    List<AbstractImportExportView> result = new ArrayList<>();
    for (Object view : views) {
      if (view instanceof AbstractImportExportView) {
        result.add((AbstractImportExportView) view);
      }
    }
    return result;
  }
}
