Package com.amazon.ion.impl
Class _Private_IonTextAppender
java.lang.Object
com.amazon.ion.impl._Private_IonTextAppender
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
NOT FOR APPLICATION USE!
Generic text sink that enables optimized output of both ASCII and UTF-16.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidappendAscii(char c) voidappendAscii(CharSequence csq) voidappendAscii(CharSequence csq, int start, int end) voidappendUtf16(char c) voidappendUtf16Surrogate(char leadSurrogate, char trailSurrogate) voidclose()voidflush()static _Private_IonTextAppenderforAppendable(Appendable out) Doesn't escape non-ASCII characters.static _Private_IonTextAppenderforAppendable(Appendable out, Charset charset) static _Private_IonTextAppenderforFastAppendable(_Private_FastAppendable out, Charset charset) static _Private_IonTextAppenderforOutputStream(OutputStream out, Charset charset) static booleanDetermines whether the given text matches one of the Ion identifier keywordsnull,true, orfalse.static booleanisIdentifierPart(int codePoint) static booleanisIdentifierStart(int codePoint) static booleanisOperatorPart(int codePoint) voidprintBlob(_Private_IonTextWriterBuilder _options, byte[] value, int start, int len) voidprintClob(_Private_IonTextWriterBuilder _options, byte[] value, int start, int len) voidprintDecimal(_Private_IonTextWriterBuilder _options, BigDecimal value) voidprintFloat(_Private_IonTextWriterBuilder _options, double value) voidprintFloat(_Private_IonTextWriterBuilder _options, Double value) voidprintInt(long value) voidprintInt(BigInteger value) final voidprintJsonString(CharSequence text) Print a JSON stringfinal voidprintLongString(CharSequence text) Print an Ion triple-quoted stringfinal voidPrint single-quoted Ion Symbol typefinal voidprintString(CharSequence text) Print an Ion String typefinal voidprintSymbol(CharSequence text) Print an Ion Symbol type.static booleansymbolNeedsQuoting(CharSequence symbol, boolean quoteOperators) Determines whether the text of a symbol requires (single) quotes.
-
Field Details
-
OPERATOR_CHAR_FLAGS
public static final boolean[] OPERATOR_CHAR_FLAGS -
ZERO_PADDING
-
-
Method Details
-
isIdentifierStart
public static boolean isIdentifierStart(int codePoint) -
isIdentifierPart
public static boolean isIdentifierPart(int codePoint) -
isOperatorPart
public static boolean isOperatorPart(int codePoint) -
forFastAppendable
public static _Private_IonTextAppender forFastAppendable(_Private_FastAppendable out, Charset charset) -
forAppendable
- Parameters:
charset- must be eitherIonTextWriterBuilder.ASCIIorIonTextWriterBuilder.UTF8. When ASCII is used, all non-ASCII characters will be escaped. Otherwise, only select code points will be escaped.
-
forAppendable
Doesn't escape non-ASCII characters. -
forOutputStream
- Parameters:
charset- must be eitherIonTextWriterBuilder.ASCIIorIonTextWriterBuilder.UTF8. When ASCII is used, all non-ASCII characters will be escaped. Otherwise, only select code points will be escaped.
-
flush
- Specified by:
flushin interfaceFlushable- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
appendAscii
- Throws:
IOException
-
appendAscii
- Throws:
IOException
-
appendAscii
- Throws:
IOException
-
appendUtf16
- Throws:
IOException
-
appendUtf16Surrogate
- Throws:
IOException
-
printString
Print an Ion String type- Parameters:
text-- Throws:
IOException
-
printLongString
Print an Ion triple-quoted string- Parameters:
text-- Throws:
IOException
-
printJsonString
Print a JSON string- Parameters:
text-- Throws:
IOException
-
isIdentifierKeyword
Determines whether the given text matches one of the Ion identifier keywordsnull,true, orfalse.This does not check for non-identifier keywords such as
null.int.- Parameters:
text- the symbol to check.- Returns:
trueif the text is an identifier keyword.
-
symbolNeedsQuoting
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; iftruethen operator symbols like!=will returntrue. has looser quoting requirements than other containers.- Returns:
trueif the given symbol requires quoting.- Throws:
NullPointerException- ifsymbolisnull.
-
printSymbol
Print an Ion Symbol type. This method will check if symbol needs quoting- Parameters:
text-- Throws:
IOException
-
printQuotedSymbol
Print single-quoted Ion Symbol type- Parameters:
text-- Throws:
IOException
-
printInt
- Throws:
IOException
-
printInt
- Throws:
IOException
-
printDecimal
public void printDecimal(_Private_IonTextWriterBuilder _options, BigDecimal value) throws IOException - Throws:
IOException
-
printFloat
- Throws:
IOException
-
printFloat
- Throws:
IOException
-
printBlob
public void printBlob(_Private_IonTextWriterBuilder _options, byte[] value, int start, int len) throws IOException - Throws:
IOException
-
printClob
public void printClob(_Private_IonTextWriterBuilder _options, byte[] value, int start, int len) throws IOException - Throws:
IOException
-