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.

CodecProvider.java 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. Copyright (c) 2010 James Ahlborn
  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. */
  16. package com.healthmarketscience.jackcess;
  17. import java.io.IOException;
  18. import java.nio.charset.Charset;
  19. /**
  20. * Interface for a provider which can generate CodecHandlers for various types
  21. * of database encodings. The {@link DefaultCodecProvider} is the default
  22. * implementation of this inferface, but it does not have any actual
  23. * encoding/decoding support (due to possible export issues with calling
  24. * encryption APIs). See the separate
  25. * <a href="https://sourceforge.net/projects/jackcessencrypt/">Jackcess
  26. * Encrypt</a> project for an implementation of this interface which supports
  27. * various access database encryption types.
  28. *
  29. * @author James Ahlborn
  30. */
  31. public interface CodecProvider
  32. {
  33. /**
  34. * Returns a new CodecHandler for the database associated with the given
  35. * PageChannel.
  36. *
  37. * @param channel the PageChannel for a Database
  38. * @param charset the Charset for the Database
  39. *
  40. * @return a new CodecHandler, may not be {@code null}
  41. */
  42. public CodecHandler createHandler(PageChannel channel, Charset charset)
  43. throws IOException;
  44. }