Class _Private_IonTextAppender

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public final class _Private_IonTextAppender
    extends java.lang.Object
    implements java.io.Closeable, java.io.Flushable
    NOT FOR APPLICATION USE!

    Generic text sink that enables optimized output of both ASCII and UTF-16.

    • Field Detail

      • OPERATOR_CHAR_FLAGS

        public static final boolean[] OPERATOR_CHAR_FLAGS
      • ZERO_PADDING

        public static final java.lang.String[] ZERO_PADDING
    • Method Detail

      • isIdentifierStart

        public static boolean isIdentifierStart​(int codePoint)
      • isIdentifierPart

        public static boolean isIdentifierPart​(int codePoint)
      • isOperatorPart

        public static boolean isOperatorPart​(int codePoint)
      • forAppendable

        public static _Private_IonTextAppender forAppendable​(java.lang.Appendable out)
        Doesn't escape non-ASCII characters.
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • appendAscii

        public void appendAscii​(char c)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • appendAscii

        public void appendAscii​(java.lang.CharSequence csq)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • appendAscii

        public void appendAscii​(java.lang.CharSequence csq,
                                int start,
                                int end)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • appendUtf16

        public void appendUtf16​(char c)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • appendUtf16Surrogate

        public void appendUtf16Surrogate​(char leadSurrogate,
                                         char trailSurrogate)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • printString

        public final void printString​(java.lang.CharSequence text)
                               throws java.io.IOException
        Print an Ion String type
        Parameters:
        text -
        Throws:
        java.io.IOException
      • printLongString

        public final void printLongString​(java.lang.CharSequence text)
                                   throws java.io.IOException
        Print an Ion triple-quoted string
        Parameters:
        text -
        Throws:
        java.io.IOException
      • printJsonString

        public final void printJsonString​(java.lang.CharSequence text)
                                   throws java.io.IOException
        Print a JSON string
        Parameters:
        text -
        Throws:
        java.io.IOException
      • isIdentifierKeyword

        public static boolean isIdentifierKeyword​(java.lang.CharSequence text)
        Determines whether the given text matches one of the Ion identifier keywords null, true, or false.

        This does not check for non-identifier keywords such as null.int.

        Parameters:
        text - the symbol to check.
        Returns:
        true if the text is an identifier keyword.
      • symbolNeedsQuoting

        public static boolean symbolNeedsQuoting​(java.lang.CharSequence symbol,
                                                 boolean quoteOperators)
        Determines whether the text of a symbol requires (single) quotes.
        Parameters:
        symbol - must be a non-empty string.
        quoteOperators - indicates whether the caller wants operators to be quoted; if true then operator symbols like != will return true. has looser quoting requirements than other containers.
        Returns:
        true if the given symbol requires quoting.
        Throws:
        java.lang.NullPointerException - if symbol is null.
      • printSymbol

        public final void printSymbol​(java.lang.CharSequence text)
                               throws java.io.IOException
        Print an Ion Symbol type. This method will check if symbol needs quoting
        Parameters:
        text -
        Throws:
        java.io.IOException
      • printQuotedSymbol

        public final void printQuotedSymbol​(java.lang.CharSequence text)
                                     throws java.io.IOException
        Print single-quoted Ion Symbol type
        Parameters:
        text -
        Throws:
        java.io.IOException
      • printInt

        public void printInt​(long value)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • printInt

        public void printInt​(java.math.BigInteger value)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • printDecimal

        public void printDecimal​(_Private_IonTextWriterBuilder _options,
                                 java.math.BigDecimal value)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • printFloat

        public void printFloat​(_Private_IonTextWriterBuilder _options,
                               double value)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • printFloat

        public void printFloat​(_Private_IonTextWriterBuilder _options,
                               java.lang.Double value)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • printBlob

        public void printBlob​(_Private_IonTextWriterBuilder _options,
                              byte[] value,
                              int start,
                              int len)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • printClob

        public void printClob​(_Private_IonTextWriterBuilder _options,
                              byte[] value,
                              int start,
                              int len)
                       throws java.io.IOException
        Throws:
        java.io.IOException