/*
 * CSVQueryExecuterFactory.java
 *
 * Created on August 3, 2006, 4:26 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package it.businesslogic.ireport.examples.queryexecuter;

import java.util.Map;
import net.sf.jasperreports.engine.JRDataset;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRQuery;
import net.sf.jasperreports.engine.query.JRQueryExecuter;
import net.sf.jasperreports.engine.query.JRQueryExecuterFactory;

/**
 *
 * @author gtoffoli
 */
public class CSVQueryExecuterFactory implements JRQueryExecuterFactory {
    
    public Object[] getBuiltinParameters() {
        return new Object[]{};
    }

    public JRQueryExecuter createQueryExecuter(JRDataset jRDataset, Map map) throws JRException {
        JRQuery query = jRDataset.getQuery();
        String queryString = query.getText();
        
        return new CSVQueryExecuter(queryString);
    }

    public boolean supportsQueryParameterType(String string) {
        return true;
    }
    
}
