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.sql.ResultSetMetaData;
21  import java.sql.SQLException;
22  import java.util.List;
23  import com.healthmarketscience.jackcess.ColumnBuilder;
24  
25  /**
26   * Simple concrete implementation of ImportFilter which just returns the given
27   * values.
28   *
29   * @author James Ahlborn
30   * @usage _general_class_
31   */
32  public class SimpleImportFilter implements ImportFilter {
33  
34    public static final SimpleImportFilter INSTANCE = new SimpleImportFilter();
35    
36    public SimpleImportFilter() {
37    }
38  
39    public List<ColumnBuilder> filterColumns(List<ColumnBuilder> destColumns,
40                                             ResultSetMetaData srcColumns)
41       throws SQLException, IOException
42    {
43      return destColumns;
44    }
45  
46    public Object[] filterRow(Object[] row)
47      throws SQLException, IOException
48    {
49      return row;
50    }
51  
52  }