View Javadoc
1   /*
2   Copyright (c) 2007 Health Market Science, Inc.
3   
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7   
8       http://www.apache.org/licenses/LICENSE-2.0
9   
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15   */
16  
17  package com.healthmarketscience.jackcess.util;
18  
19  import java.io.IOException;
20  import java.util.List;
21  import com.healthmarketscience.jackcess.Column;
22  
23  /**
24   * Interface which allows customization of the behavior of the
25   * {@link ExportUtil} export methods.
26   * 
27   * @author James Ahlborn
28   * @usage _general_class_
29   */
30  public interface ExportFilter {
31  
32    /**
33     * The columns that should be used to create the exported file.
34     * 
35     * @param columns
36     *          the columns as determined by the export code, may be directly
37     *          modified and returned
38     * @return the columns to use when creating the export file
39     */
40    public List<Column> filterColumns(List<Column> columns) 
41      throws IOException;
42  
43    /**
44     * The desired values for the row.
45     * 
46     * @param row
47     *          the row data as determined by the import code, may be directly
48     *          modified
49     * @return the row data as it should be written to the import table.  if
50     *         {@code null}, the row will be skipped
51     */
52    public Object[] filterRow(Object[] row) throws IOException;
53  
54  }