Arrays that are empty or null are considered to have 0 elements. An empty or null first row is considered invalid.
As with all row validators the assumption is you have control of the data and have skipped any initial empty lines. If you have data that has empty lines or separators lines in your data then you should not use this class. Either extend it or write your own validator.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| public boolean | isValid(String[] row)
Implements com. Performs the validation check on the string and returns the result. |
| public void | validate(String[] row)
Implements com. Performs the validation check on the row (an array of |
| NO_ROWS | back to summary |
|---|---|
| private static final int NO_ROWS | |
| numRows | back to summary |
|---|---|
| private int numRows | |
| RowMustHaveSameNumberOfColumnsAsFirstRowValidator | back to summary |
|---|---|
| public RowMustHaveSameNumberOfColumnsAsFirstRowValidator() Default constructor. | |
| firstRowNotSetYet | back to summary |
|---|---|
| private boolean firstRowNotSetYet() | |
| isValid | back to summary |
|---|---|
| public boolean isValid(String[] row) Implements com. Doc from com. Performs the validation check on the string and returns the result. While not called directly in opencsv it is in the interface to provide an easy way to test if the validator is functioning properly.
| |
| validate | back to summary |
|---|---|
| public void validate(String[] row) throws CsvValidationException Implements com. Doc from com. Performs the validation check on the row (an array of
| |