public final class DefaultEncodingDefinition extends java.lang.Object implements EncodingDefinition
EncodingDefinition
.Constructor and Description |
---|
DefaultEncodingDefinition(java.lang.String firebirdEncodingName,
java.nio.charset.Charset charset,
int maxBytesPerChar,
int firebirdCharacterSetId,
boolean firebirdOnly)
Initializes an instance of DefaultEncodingDefinition.
|
DefaultEncodingDefinition(java.lang.String firebirdEncodingName,
java.lang.String charsetName,
int maxBytesPerChar,
int firebirdCharacterSetId,
boolean firebirdOnly)
Initializes an instance of DefaultEncodingDefinition.
|
Modifier and Type | Method and Description |
---|---|
Encoding |
getEncoding()
Returns the
Encoding instance for 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) |
java.lang.String |
toString() |
public DefaultEncodingDefinition(java.lang.String firebirdEncodingName, java.nio.charset.Charset charset, int maxBytesPerChar, int firebirdCharacterSetId, boolean firebirdOnly)
firebirdEncodingName
- Name of the Firebird encodingcharset
- Java Charset
instance (null
for information-only instances)maxBytesPerChar
- Maximum number of bytes per character (eg 1 for ISO8859_1, 4 for UTF8, 3 for UNICODE-FSS)firebirdCharacterSetId
- Firebird character set idfirebirdOnly
- Mapping only applies from Firebird to Java, but not from Java to Firebird (eg Firebird UNICODE-FSS maps
to Java UTF-8, but Java UTF-8 does not map to Firebird UNICODE-FSS (but to Firebird UTF8)public DefaultEncodingDefinition(java.lang.String firebirdEncodingName, java.lang.String charsetName, int maxBytesPerChar, int firebirdCharacterSetId, boolean firebirdOnly)
The actual Java character set is loaded on-demand. If the provided name cannot be resolved to a Charset
at on-demand load time, it will be handled as information-only.
firebirdEncodingName
- Name of the Firebird encodingcharsetName
- Java character set name, or null
for information-only instancesmaxBytesPerChar
- Maximum number of bytes per character (eg 1 for ISO8859_1, 4 for UTF8, 3 for UNICODE-FSS)firebirdCharacterSetId
- Firebird character set idfirebirdOnly
- Mapping only applies from Firebird to Java, but not from Java to Firebird (eg Firebird UNICODE-FSS maps
to Java UTF-8, but Java UTF-8 does not map to Firebird UNICODE-FSS (but to Firebird UTF8)public int getMaxBytesPerChar()
getMaxBytesPerChar
in interface EncodingDefinition
public java.lang.String getJavaEncodingName()
getJavaEncodingName
in interface EncodingDefinition
public java.nio.charset.Charset getJavaCharset()
getJavaCharset
in interface EncodingDefinition
Charset
for this encodingpublic java.lang.String getFirebirdEncodingName()
getFirebirdEncodingName
in interface EncodingDefinition
public int getFirebirdCharacterSetId()
getFirebirdCharacterSetId
in interface EncodingDefinition
public boolean isFirebirdOnly()
EncodingDefinition
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 setUTF-8
is requested, Jaybird
should (in general) map to Firebird character set UTF8
.
isFirebirdOnly
in interface EncodingDefinition
true
when this encoding maps from Java to Firebird, false
otherwisepublic boolean isInformationOnly()
EncodingDefinition
Encoding
instance, or does it provide information only (eg about
unsupported character sets)isInformationOnly
in interface EncodingDefinition
true
if this EncodingDefinition only provides information, and is not capable of building a
concrete implementation.public Encoding getEncoding()
Encoding
instance for this definition. The same object is returned
each time this method is called.getEncoding
in interface EncodingDefinition
null
if this is an information only EncodingDefinitionEncodingDefinition.isInformationOnly()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.