Returns iterator over created objects.
- Author
- Nikolay Musienko
- Details:
Reads data from file, translates it to java objects, return iterator over this objects
127 return new AbstractIterator<T>() {
129 private CSVParser parser;
137 throw new TechnicalException(
"File path can't be NULL!");
140 parser =
new CSVParser(
new BufferedReader(
new FileReader(
new File(path))), strategy);
141 }
catch (FileNotFoundException e) {
142 throw Throwables.propagate(e);
145 objectCreator.setHeader(parser.getLine());
146 }
catch (IOException e){
147 throw Throwables.propagate(e);
154 protected T computeNext() {
156 String[] strings = parser.getLine();
157 if(strings == null) {
160 return objectCreator.createObject(strings);
161 }
catch (IOException e) {
162 throw Throwables.propagate(e);