new ArrayList<Map<String,String>>();
//if the filepath is an empty string (which is the case if the calling
// macro could not find a grammar URL), just return an empty list
if(filepath.equals("")) {
return new CollectionModel(listOfJapeDocs,new DefaultObjectWrapper());
}
JapeDocParser parser = new JapeDocParser();
try {
listOfJapeDocs = parser.parse(filepath);
} catch(Exception ex) {
throw new GateRuntimeException("Problem parsing JAPE File "+filepath,ex);
}
// convert the docstrings according to the required format conversion!
Converter converter = ConverterFactory.getConverter(fromFormat, toFormat);
for(Map<String,String> entry : listOfJapeDocs) {
entry.put("docstring",converter.convert(entry.get("docstring")));
}
return new CollectionModel(listOfJapeDocs,new DefaultObjectWrapper());
}