Package com.adobe.agl.charset
Class CharsetEncoderICU
java.lang.Object
java.nio.charset.CharsetEncoder
com.adobe.agl.charset.CharsetEncoderICU
An abstract class that provides framework methods of decoding operations for concrete
subclasses.
In the future this class will contain API that will implement converter semantics of ICU4C.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanEncode(int[] codepoint) booleanIs this Encoder allowed to use fallbacks? A fallback mapping is a mapping that will convert a Unicode codepoint sequence to a byte sequence, but the encoded byte sequence will round trip convert to a different Unicode codepoint sequence.booleanisLegalReplacement(byte[] repl) Overrides super class methodvoidsetFallbackUsed(boolean usesFallback) Sets whether this Encoder can use fallbacks?final voidsetFromUContext(Object newContext) Sets fromUContext used in callbacks.Methods inherited from class java.nio.charset.CharsetEncoder
averageBytesPerChar, canEncode, canEncode, charset, encode, encode, flush, malformedInputAction, maxBytesPerChar, onMalformedInput, onUnmappableCharacter, replacement, replaceWith, reset, unmappableCharacterAction
-
Method Details
-
isFallbackUsed
public boolean isFallbackUsed()Is this Encoder allowed to use fallbacks? A fallback mapping is a mapping that will convert a Unicode codepoint sequence to a byte sequence, but the encoded byte sequence will round trip convert to a different Unicode codepoint sequence.- Returns:
- true if the converter uses fallback, false otherwise.
-
setFallbackUsed
public void setFallbackUsed(boolean usesFallback) Sets whether this Encoder can use fallbacks?- Parameters:
usesFallback- true if the user wants the converter to take advantage of the fallback mapping, false otherwise.
-
setFromUContext
Sets fromUContext used in callbacks.- Parameters:
newContext- Object- Throws:
IllegalArgumentException
-
canEncode
public boolean canEncode(int[] codepoint) - Parameters:
codepoint- Unicode code point as int array- Returns:
- true if the input sequence can be converted
-
isLegalReplacement
public boolean isLegalReplacement(byte[] repl) Overrides super class method- Overrides:
isLegalReplacementin classCharsetEncoder
-