Class DefaultCodecProvider
- java.lang.Object
-
- com.healthmarketscience.jackcess.impl.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. SeeCodecProviderfor details on a more useful implementation.- Author:
- James Ahlborn
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultCodecProvider.DummyHandlerCodecHandler implementation which does nothing, useful for databases with no extra encoding.static classDefaultCodecProvider.UnsupportedHandlerCodecHandler implementation which always throws UnsupportedCodecException, useful for databases with unsupported encodings.
-
Field Summary
Fields Modifier and Type Field Description static CodecHandlerDUMMY_HANDLERcommon instance ofDefaultCodecProvider.DummyHandlerstatic CodecProviderINSTANCEcommon instance of DefaultCodecProviderstatic CodecHandlerUNSUPPORTED_HANDLERcommon instance ofDefaultCodecProvider.UnsupportedHandler
-
Constructor Summary
Constructors Constructor Description DefaultCodecProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CodecHandlercreateHandler(PageChannel channel, Charset charset)Returns a new CodecHandler for the database associated with the given PageChannel.
-
-
-
Field Detail
-
INSTANCE
public static final CodecProvider INSTANCE
common instance of DefaultCodecProvider
-
DUMMY_HANDLER
public static final CodecHandler DUMMY_HANDLER
common instance ofDefaultCodecProvider.DummyHandler
-
UNSUPPORTED_HANDLER
public static final CodecHandler UNSUPPORTED_HANDLER
common instance ofDefaultCodecProvider.UnsupportedHandler
-
-
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:
createHandlerin interfaceCodecProvider- Parameters:
channel- the PageChannel for a Databasecharset- the Charset for the Database- Returns:
- a new CodecHandler, may not be
null - Throws:
IOException
-
-