public class CSVIterator extends Object implements Iterator<String[]>
Fair warning! This mechanism of getting at the data opencsv delivers has limitations when used with the opencsv annotations. Locales and custom converters are not supported. Further features may or may not work.
Constructor and Description |
---|
CSVIterator(CSVReader reader) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Returns true if the iteration has more elements.
|
String[] |
next()
Returns the next element in the iterator.
|
void |
remove()
This method is not supported by opencsv and will throw an
UnsupportedOperationException if called. |
void |
setErrorLocale(Locale errorLocale)
Sets the locale for error messages.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public CSVIterator(CSVReader reader) throws IOException, CsvValidationException
reader
- Reader for the CSV data.IOException
- If unable to read data from the reader.CsvValidationException
- if custom defined validator fails.public void setErrorLocale(Locale errorLocale)
errorLocale
- Locale for error messages. If null, the default locale
is used.public boolean hasNext()
next()
would return an element
rather than throwing an exception.public String[] next()
public void remove()
UnsupportedOperationException
if called.Copyright © 2005–2023. All rights reserved.