Class CharsetEncoderICU


  • public abstract class CharsetEncoderICU
    extends java.nio.charset.CharsetEncoder
    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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canEncode​(int[] codepoint)  
      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.
      boolean isLegalReplacement​(byte[] repl)
      Overrides super class method
      void setFallbackUsed​(boolean usesFallback)
      Sets whether this Encoder can use fallbacks?
      void setFromUContext​(java.lang.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
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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

        public final void setFromUContext​(java.lang.Object newContext)
        Sets fromUContext used in callbacks.
        Parameters:
        newContext - Object
        Throws:
        java.lang.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:
        isLegalReplacement in class java.nio.charset.CharsetEncoder