package com.mblinn.oo.tinyweb;

import java.util.List;
import java.util.Map;

public class StrategyView implements View {
  private RenderingsStrategy viewRenderer;

  public StrategyView(RenderingsStrategy viewRenderer) {
    this.viewRenderer = viewRenderer;
  }

  @Override
  public String render(Map<String, List<String>> model) {
    try {
      return viewRenderer.renderView(model);
    } catch (Exception e) {
      throw new RenderingException(e);
    }
  }
}
