I have my input file in all XML/JSON/CSV/EXCEL formats.
I have written separate parsers for all. but I wanna choose my parse at run time.
which design pattern will be most suitable ?
I have implemented such as
if(file.endsWith(".csv"))
return CSVParser();
if(file.endsWith(".json"))
return JSONParser();
if(file.endsWith(".xml"))
return XMLParser();
else
return EXCELParser();
suggestion/guidelines please .
Aucun commentaire:
Enregistrer un commentaire