View Javadoc
1   package com.opencsv.processor;
2   
3   /**
4    * This is the interface for processors for an array of {@link String}s read by
5    * the {@link com.opencsv.CSVReader} <em>before</em> they are validated.
6    * <p>This should only be used if you have a very good understanding and full
7    * control of the data being processed or something you want applied to every
8    * column in the row.</p>
9    * <p>WARNING - using a processor can change the string in ways that could make
10   * it impossible to be processed or make it into a different format than what
11   * you are expecting based on the settings of the parser and reader. So great
12   * care must be taken when creating and using a RowProcessor.</p>
13   * <p>NOTE - Because of the potential problems a bad processor can cause we
14   * will close down any bug reports created for opencsv where a RowProcessor is
15   * involved with the recommendation they be reopened as a support request.</p>
16   *
17   * @author Scott Conway
18   * @since 5.0
19   */
20  public interface RowProcessor {
21  
22      /**
23       * Method that contains the code that will transform a single column/element.
24       * While not called directly by opencsv it is in the interface to provide an easy way to test
25       * if the processor is functioning properly.
26       *
27       * @param column {@link String} to be processed
28       * @return The processed {@link String}
29       */
30      String processColumnItem(String column);
31  
32      /**
33       * Method that will process the entire row.
34       *
35       * @param row Array of {@link String}s to be processed
36       */
37      void processRow(String[] row);
38  }