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.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. Copyright (c) 2010 James Ahlborn
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package com.healthmarketscience.jackcess.impl;
  14. import java.io.IOException;
  15. import java.nio.charset.Charset;
  16. /**
  17. * Interface for a provider which can generate CodecHandlers for various types
  18. * of database encodings. The {@link DefaultCodecProvider} is the default
  19. * implementation of this inferface, but it does not have any actual
  20. * encoding/decoding support (due to possible export issues with calling
  21. * encryption APIs). See the separate
  22. * <a href="https://sourceforge.net/projects/jackcessencrypt/">Jackcess
  23. * Encrypt</a> project for an implementation of this interface which supports
  24. * various access database encryption types.
  25. *
  26. * @author James Ahlborn
  27. */
  28. public interface CodecProvider
  29. {
  30. /**
  31. * Returns a new CodecHandler for the database associated with the given
  32. * PageChannel.
  33. *
  34. * @param channel the PageChannel for a Database
  35. * @param charset the Charset for the Database
  36. *
  37. * @return a new CodecHandler, may not be {@code null}
  38. */
  39. public CodecHandler createHandler(PageChannel channel, Charset charset)
  40. throws IOException;
  41. }