Package com.opencsv
Class CSVIterator
java.lang.Object
com.opencsv.CSVIterator
Provides an Iterator over the data found in opencsv.
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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
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 anUnsupportedOperationException
if called.void
setErrorLocale
(Locale errorLocale) Sets the locale for error messages.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
reader
-
nextLine
-
errorLocale
Locale for all translations.
-
-
Constructor Details
-
CSVIterator
- Parameters:
reader
- Reader for the CSV data.- Throws:
IOException
- If unable to read data from the reader.CsvValidationException
- if custom defined validator fails.
-
-
Method Details
-
setErrorLocale
Sets the locale for error messages.- Parameters:
errorLocale
- Locale for error messages. If null, the default locale is used.- Since:
- 4.0
-
hasNext
public boolean hasNext()Returns true if the iteration has more elements. In other words, returns true ifnext()
would return an element rather than throwing an exception. -
next
Returns the next element in the iterator. -
remove
public void remove()This method is not supported by opencsv and will throw anUnsupportedOperationException
if called.
-