You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ImportFilter.java 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. Copyright (c) 2007 Health Market Science, Inc.
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with this library; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  14. USA
  15. You can contact Health Market Science at info@healthmarketscience.com
  16. or at the following address:
  17. Health Market Science
  18. 2700 Horizon Drive
  19. Suite 200
  20. King of Prussia, PA 19406
  21. */
  22. package com.healthmarketscience.jackcess;
  23. import java.io.IOException;
  24. import java.sql.ResultSetMetaData;
  25. import java.sql.SQLException;
  26. import java.util.List;
  27. /**
  28. * Interface which allows customization of the behavior of the
  29. * <code>Database</code> import/copy methods.
  30. *
  31. * @author James Ahlborn
  32. */
  33. public interface ImportFilter {
  34. /**
  35. * The columns that should be used to create the imported table.
  36. * @param destColumns the columns as determined by the import code, may be
  37. * directly modified and returned
  38. * @param srcColumns the sql metadata, only available if importing from a
  39. * JDBC source
  40. * @return the columns to use when creating the import table
  41. */
  42. public List<Column> filterColumns(List<Column> destColumns,
  43. ResultSetMetaData srcColumns)
  44. throws SQLException, IOException;
  45. /**
  46. * The desired values for the row.
  47. * @param row 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)
  53. throws SQLException, IOException;
  54. }