View Javadoc
1   package org.csveed.report;
2   
3   import java.util.List;
4   
5   /**
6   * Report on an error, always including at the very least an error message. If the error can be pinpointed
7   * to a line or cell, this information is included as well.
8   * @author Robert Bor
9   */
10  public interface CsvError {
11  
12      /**
13      * Returns all lines, first the message, then the content and focus line, if available. These lines
14      * are usable to print with a monospaced font, since the focus line will show in the line above where
15      * the error occurred. If lines are needed for the browser, use {@link #getRowParts()}.
16      * @return all lines, in printable format. Will always contain at least one line.
17      */
18      List<String> getPrintableLines();
19  
20      /**
21      * Gets the content line where the error occurred, if available. The line is split into RowPart entries.
22      * Every RowPart knows about itself when it must be highlighted. This method is useful for reporting
23      * on the error in another format, for example HTML or PDF, since you can control the highlighting.
24      * @return the content line split into RowPart entries. Will be an empty list if not available.
25      */
26      List<RowPart> getRowParts();
27  
28      /**
29      * Returns the line number where the error occurred, zero-based. Will be -1 if not applicable.
30      * @return line number where the error occurred
31      */
32      int getLineNumber();
33  
34      /**
35      * Returns the original error message
36      * @return error message
37      */
38      String getMessage();
39  
40  }