org.firebirdsql.encodings

## Interface EncodingDefinition

- All Known Implementing Classes:
    DefaultEncodingDefinition

      public interface EncodingDefinition

  Definition of a Firebird encoding. This is a mapping from the Firebird encoding to a Java Charset and additional information needed by Jaybird to process this encoding.
  Since:
    3.0
  Author:
    Mark Rotteveel

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Encoding` | `getEncoding()` Gets the `Encoding` based on this definition.
    `int` | `getFirebirdCharacterSetId()`
    `java.lang.String` | `getFirebirdEncodingName()`
    `java.nio.charset.Charset` | `getJavaCharset()`
    `java.lang.String` | `getJavaEncodingName()`
    `int` | `getMaxBytesPerChar()`
    `boolean` | `isFirebirdOnly()` Can (or should) this encoding be used for reverse mapping from Java to Firebird.
    `boolean` | `isInformationOnly()` Can this implementation create an `Encoding` instance, or does it provide information only (eg about unsupported character sets)

- - ### Method Detail

    - #### getMaxBytesPerChar

          int getMaxBytesPerChar()

      Returns:
        Maximum number of bytes per character.

    - #### getJavaEncodingName

          java.lang.String getJavaEncodingName()

      Returns:
        Java name of the encoding

    - #### getJavaCharset

          java.nio.charset.Charset getJavaCharset()

      Returns:
        Java `Charset` for this encoding

    - #### getFirebirdEncodingName

          java.lang.String getFirebirdEncodingName()

      Returns:
        Firebird name of the encoding

    - #### getFirebirdCharacterSetId

          int getFirebirdCharacterSetId()

      Returns:
        Firebird id of the encoding

    - #### isFirebirdOnly

          boolean isFirebirdOnly()

      Can (or should) this encoding be used for reverse mapping from Java to Firebird.

      The best example of this is the Firebird character set `UNICODE-FSS` which maps to the Java character set `UTF-8`, but when Java character set`UTF-8` is requested, Jaybird should (in general) map to Firebird character set `UTF8`.

      Returns:
        `true` when this encoding maps from Java to Firebird, `false` otherwise

    - #### isInformationOnly

          boolean isInformationOnly()

      Can this implementation create an `Encoding` instance, or does it provide information only (eg about unsupported character sets)
      Returns:
        `true` if this EncodingDefinition only provides information, and is not capable of building a concrete implementation.

    - #### getEncoding

          Encoding getEncoding()

      Gets the `Encoding` based on this definition.

      Implementations can return the same instance on every call, or create a new one each time this method is called

      Returns:
        Encoding object or `null` if this is an information only EncodingDefinition
      See Also:
        `isInformationOnly()`

Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.