if (format.equals(TransferFormats.XLS) || format.equals("excel")) {
String template = (String) context.get("template");
if (StringUtils.isEmpty(template)) {
return new ExcelItemWriter();
} else {
TemplateWriter writer = new ExcelTemplateWriter();
URL templateURL = ClassLoaderUtil.getResource(template, Exporter.class);
if (null == templateURL) {
throw new RuntimeException("Empty template path!");
} else {
writer.setTemplate(templateURL);
}
return writer;
}
} else if (format.equals(TransferFormats.CSV)) {
return new CsvItemWriter();