
package de.ivu.elect.presentation;

import javax.enterprise.inject.Instance;
import javax.inject.Inject;
import javax.inject.Named;

import de.ivu.elect.jee.faces.security.AbstractConditionViewValidator;

@Named(AbstractConditionViewValidator.CONDITION_VIEW_VALIDATOR_NAME)
public class ConditionViewValidator extends AbstractConditionViewValidator<View> {

  @Inject
  @View
  private transient Instance<Object> views;

  public ConditionViewValidator() {
    super();
  }

  @Override
  protected Iterable<Object> getAllViews() {
    return views;
  }

  @Override
  @SuppressWarnings("rawtypes")
  protected Class getViewAnnotationClass() {
    return View.class;
  }

  @Override
  protected String getViewId(View viewAnnotation) {
    return viewAnnotation.viewId();
  }
}
