com.healthmarketscience.jackcess
Class DefaultCodecProvider

java.lang.Object
  extended by com.healthmarketscience.jackcess.DefaultCodecProvider
All Implemented Interfaces:
CodecProvider

public class DefaultCodecProvider
extends Object
implements CodecProvider

Default implementation of CodecProvider which does not have any actual encoding/decoding support. See CodecProvider for details on a more useful implementation.

Author:
James Ahlborn

Nested Class Summary
static class DefaultCodecProvider.DummyHandler
          CodecHandler implementation which does nothing, useful for databases with no extra encoding.
static class DefaultCodecProvider.UnsupportedHandler
          CodecHandler implementation which always throws UnsupportedCodecException, useful for databases with unsupported encodings.
 
Field Summary
static CodecHandler DUMMY_HANDLER
          common instance of DefaultCodecProvider.DummyHandler
static CodecProvider INSTANCE
          common instance of DefaultCodecProvider
static CodecHandler UNSUPPORTED_HANDLER
          common instance of DefaultCodecProvider.UnsupportedHandler
 
Constructor Summary
DefaultCodecProvider()
           
 
Method Summary
 CodecHandler createHandler(PageChannel channel, Charset charset)
          Returns a new CodecHandler for the database associated with the given PageChannel.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final CodecProvider INSTANCE
common instance of DefaultCodecProvider


DUMMY_HANDLER

public static final CodecHandler DUMMY_HANDLER
common instance of DefaultCodecProvider.DummyHandler


UNSUPPORTED_HANDLER

public static final CodecHandler UNSUPPORTED_HANDLER
common instance of DefaultCodecProvider.UnsupportedHandler

Constructor Detail

DefaultCodecProvider

public DefaultCodecProvider()
Method Detail

createHandler

public CodecHandler createHandler(PageChannel channel,
                                  Charset charset)
                           throws IOException
Returns a new CodecHandler for the database associated with the given PageChannel.

This implementation returns DUMMY_HANDLER for databases with no encoding and UNSUPPORTED_HANDLER for databases with any encoding.

Specified by:
createHandler in interface CodecProvider
Parameters:
channel - the PageChannel for a Database
charset - the Charset for the Database
Returns:
a new CodecHandler, may not be null
Throws:
IOException


Copyright © 2005-2013 Health Market Science. All Rights Reserved.