Package org.firebirdsql.encodings
Interface EncodingDefinition
-
- All Known Implementing Classes:
DefaultEncodingDefinition
public interface EncodingDefinitionDefinition 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 Description EncodinggetEncoding()Gets theEncodingbased on this definition.intgetFirebirdCharacterSetId()java.lang.StringgetFirebirdEncodingName()java.nio.charset.CharsetgetJavaCharset()java.lang.StringgetJavaEncodingName()intgetMaxBytesPerChar()booleanisFirebirdOnly()Can (or should) this encoding be used for reverse mapping from Java to Firebird.booleanisInformationOnly()Can this implementation create anEncodinginstance, 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
Charsetfor 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-FSSwhich maps to the Java character setUTF-8, but when Java character setUTF-8is requested, Jaybird should (in general) map to Firebird character setUTF8.- Returns:
truewhen this encoding maps from Java to Firebird,falseotherwise
-
isInformationOnly
boolean isInformationOnly()
Can this implementation create anEncodinginstance, or does it provide information only (eg about unsupported character sets)- Returns:
trueif this EncodingDefinition only provides information, and is not capable of building a concrete implementation.
-
getEncoding
Encoding getEncoding()
Gets theEncodingbased 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
nullif this is an information only EncodingDefinition - See Also:
isInformationOnly()
-
-