public class QueryFactory {
public static Query getQuery(QueryElement queryElement, Report report) throws BadReportSyntaxException {
Query query;
if (queryElement instanceof PreparedQueryElement) {
query = new PreparedQuery((PreparedQueryElement)queryElement,report);
} else {
query = new GeneratedQuery((GeneratedQueryElement)queryElement);
}
return query;
}