Package 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
Modifier and TypeMethodDescriptionGets theEncodingbased on this definition.intintbooleanCan (or should) this encoding be used for reverse mapping from Java to Firebird.booleanCan this implementation create anEncodinginstance, or does it provide information only (eg about unsupported character sets)
-
Method Details
-
getMaxBytesPerChar
int getMaxBytesPerChar()- Returns:
- Maximum number of bytes per character.
-
getJavaEncodingName
String getJavaEncodingName()- Returns:
- Java name of the encoding
-
getJavaCharset
Charset getJavaCharset()- Returns:
- Java
Charsetfor this encoding
-
getFirebirdEncodingName
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:
-