package info.bukova.isspst.reporting;

import javax.servlet.ServletContext;

import org.springframework.beans.factory.annotation.Autowired;

public class GeneratorFactory {
	
	@Autowired
	private ServletContext context;
	
	public Generator createGenerator(ReportDefinition definition) {
		switch (definition.getReport().getType()) {
		case DYNAMIC:
			return new DynamicGenerator(definition);
		case DEFINED:
			return new PredefinedGenerator(definition, context);

		default:
			return null;
		}
	}

}
