APIdia Launch Partner
Top Description Inners Fields Constructors Methods
io.github.spannm.jackcess.impl

public Class DefaultCodecProvider

extends Object
implements CodecProvider
Class Inheritance
All Implemented Interfaces
io.github.spannm.jackcess.impl.CodecProvider
Imports
io.github.spannm.jackcess.JackcessRuntimeException, java.io.IOException, java.nio.ByteBuffer, java.nio.charset.Charset

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
DefaultCodecProvider.DummyHandler

CodecHandler implementation which does nothing, useful for databases with no extra encoding.

public static class
DefaultCodecProvider.UnsupportedHandler

CodecHandler implementation which always throws UnsupportedCodecException, useful for databases with unsupported encodings.

Field Summary

Modifier and TypeField and Description
public static final CodecHandler
DUMMY_HANDLER

common instance of DummyHandler

public static final CodecProvider
INSTANCE

common instance of DefaultCodecProvider

public static final CodecHandler

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public CodecHandler
createHandler(PageChannel channel, Charset charset)

Implements io.github.spannm.jackcess.impl.CodecProvider.createHandler.

Returns a new CodecHandler for the database associated with the given PageChannel.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DUMMY_HANDLERback to summary
public static final CodecHandler DUMMY_HANDLER

common instance of DummyHandler

INSTANCEback to summary
public static final CodecProvider INSTANCE

common instance of DefaultCodecProvider

UNSUPPORTED_HANDLERback to summary
public static final CodecHandler UNSUPPORTED_HANDLER

common instance of UnsupportedHandler

Constructor Detail

DefaultCodecProviderback to summary
public DefaultCodecProvider()

Method Detail

createHandlerback to summary
public CodecHandler createHandler(PageChannel channel, Charset charset) throws IOException

Implements io.github.spannm.jackcess.impl.CodecProvider.createHandler.

Doc from io.github.spannm.jackcess.impl.CodecProvider.createHandler.

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.

Annotations
@Override
io.github.spannm.jackcess.impl back to summary

public Class DefaultCodecProvider.DummyHandler

extends Object
implements CodecHandler
Class Inheritance
  • java.lang.Object
  • io.github.spannm.jackcess.impl.DefaultCodecProvider.DummyHandler
All Implemented Interfaces
io.github.spannm.jackcess.impl.CodecHandler

CodecHandler implementation which does nothing, useful for databases with no extra encoding.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canDecodeInline()

Implements io.github.spannm.jackcess.impl.CodecHandler.canDecodeInline.

Returns true if this handler can decode a page inline, false otherwise.

public boolean
canEncodePartialPage()

Implements io.github.spannm.jackcess.impl.CodecHandler.canEncodePartialPage.

Returns true if this handler can encode partial pages, false otherwise.

public void
decodePage(ByteBuffer inPage, ByteBuffer outPage, int pageNumber)

Implements io.github.spannm.jackcess.impl.CodecHandler.decodePage.

Decodes the given page buffer.

public ByteBuffer
encodePage(ByteBuffer page, int pageNumber, int pageOffset)

Implements io.github.spannm.jackcess.impl.CodecHandler.encodePage.

Encodes the given page buffer into a new page buffer and returns it.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DummyHandlerback to summary
public DummyHandler()

Method Detail

canDecodeInlineback to summary
public boolean canDecodeInline()

Implements io.github.spannm.jackcess.impl.CodecHandler.canDecodeInline.

Doc from io.github.spannm.jackcess.impl.CodecHandler.canDecodeInline.

Returns true if this handler can decode a page inline, false otherwise. If this method returns false, the decodePage method will always be called with separate buffers.

Annotations
@Override
canEncodePartialPageback to summary
public boolean canEncodePartialPage()

Implements io.github.spannm.jackcess.impl.CodecHandler.canEncodePartialPage.

Doc from io.github.spannm.jackcess.impl.CodecHandler.canEncodePartialPage.

Returns true if this handler can encode partial pages, false otherwise. If this method returns false, the encodePage method will never be called with a non-zero pageOffset.

Annotations
@Override
decodePageback to summary
public void decodePage(ByteBuffer inPage, ByteBuffer outPage, int pageNumber)

Implements io.github.spannm.jackcess.impl.CodecHandler.decodePage.

Doc from io.github.spannm.jackcess.impl.CodecHandler.decodePage.

Decodes the given page buffer.

Annotations
@Override
encodePageback to summary
public ByteBuffer encodePage(ByteBuffer page, int pageNumber, int pageOffset)

Implements io.github.spannm.jackcess.impl.CodecHandler.encodePage.

Doc from io.github.spannm.jackcess.impl.CodecHandler.encodePage.

Encodes the given page buffer into a new page buffer and returns it. The returned page buffer will be used immediately and discarded so that it may be re-used for subsequent page encodings.

Annotations
@Override
io.github.spannm.jackcess.impl back to summary

public Class DefaultCodecProvider.UnsupportedHandler

extends Object
implements CodecHandler
Class Inheritance
  • java.lang.Object
  • io.github.spannm.jackcess.impl.DefaultCodecProvider.UnsupportedHandler
All Implemented Interfaces
io.github.spannm.jackcess.impl.CodecHandler

CodecHandler implementation which always throws UnsupportedCodecException, useful for databases with unsupported encodings.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canDecodeInline()

Implements io.github.spannm.jackcess.impl.CodecHandler.canDecodeInline.

Returns true if this handler can decode a page inline, false otherwise.

public boolean
canEncodePartialPage()

Implements io.github.spannm.jackcess.impl.CodecHandler.canEncodePartialPage.

Returns true if this handler can encode partial pages, false otherwise.

public void
decodePage(ByteBuffer inPage, ByteBuffer outPage, int pageNumber)

Implements io.github.spannm.jackcess.impl.CodecHandler.decodePage.

Decodes the given page buffer.

public ByteBuffer
encodePage(ByteBuffer page, int pageNumber, int pageOffset)

Implements io.github.spannm.jackcess.impl.CodecHandler.encodePage.

Encodes the given page buffer into a new page buffer and returns it.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UnsupportedHandlerback to summary
public UnsupportedHandler()

Method Detail

canDecodeInlineback to summary
public boolean canDecodeInline()

Implements io.github.spannm.jackcess.impl.CodecHandler.canDecodeInline.

Doc from io.github.spannm.jackcess.impl.CodecHandler.canDecodeInline.

Returns true if this handler can decode a page inline, false otherwise. If this method returns false, the decodePage method will always be called with separate buffers.

Annotations
@Override
canEncodePartialPageback to summary
public boolean canEncodePartialPage()

Implements io.github.spannm.jackcess.impl.CodecHandler.canEncodePartialPage.

Doc from io.github.spannm.jackcess.impl.CodecHandler.canEncodePartialPage.

Returns true if this handler can encode partial pages, false otherwise. If this method returns false, the encodePage method will never be called with a non-zero pageOffset.

Annotations
@Override
decodePageback to summary
public void decodePage(ByteBuffer inPage, ByteBuffer outPage, int pageNumber)

Implements io.github.spannm.jackcess.impl.CodecHandler.decodePage.

Doc from io.github.spannm.jackcess.impl.CodecHandler.decodePage.

Decodes the given page buffer.

Annotations
@Override
encodePageback to summary
public ByteBuffer encodePage(ByteBuffer page, int pageNumber, int pageOffset)

Implements io.github.spannm.jackcess.impl.CodecHandler.encodePage.

Doc from io.github.spannm.jackcess.impl.CodecHandler.encodePage.

Encodes the given page buffer into a new page buffer and returns it. The returned page buffer will be used immediately and discarded so that it may be re-used for subsequent page encodings.

Annotations
@Override