public final class _Private_IonTextAppender
extends java.lang.Object
implements java.io.Closeable, java.io.Flushable
Generic text sink that enables optimized output of both ASCII and UTF-16.
Modifier and Type | Field and Description |
---|---|
static boolean[] |
OPERATOR_CHAR_FLAGS |
static java.lang.String[] |
ZERO_PADDING |
Modifier and Type | Method and Description |
---|---|
void |
appendAscii(char c) |
void |
appendAscii(java.lang.CharSequence csq) |
void |
appendAscii(java.lang.CharSequence csq,
int start,
int end) |
void |
appendUtf16(char c) |
void |
appendUtf16Surrogate(char leadSurrogate,
char trailSurrogate) |
void |
close() |
void |
flush() |
static _Private_IonTextAppender |
forAppendable(java.lang.Appendable out)
Doesn't escape non-ASCII characters.
|
static _Private_IonTextAppender |
forAppendable(java.lang.Appendable out,
java.nio.charset.Charset charset) |
static _Private_IonTextAppender |
forFastAppendable(_Private_FastAppendable out,
java.nio.charset.Charset charset) |
static _Private_IonTextAppender |
forOutputStream(java.io.OutputStream out,
java.nio.charset.Charset charset) |
static boolean |
isIdentifierKeyword(java.lang.CharSequence text)
Determines whether the given text matches one of the Ion identifier
keywords
null , true , or false . |
static boolean |
isIdentifierPart(int codePoint) |
static boolean |
isIdentifierStart(int codePoint) |
static boolean |
isOperatorPart(int codePoint) |
void |
printBlob(_Private_IonTextWriterBuilder _options,
byte[] value,
int start,
int len) |
void |
printClob(_Private_IonTextWriterBuilder _options,
byte[] value,
int start,
int len) |
void |
printDecimal(_Private_IonTextWriterBuilder _options,
java.math.BigDecimal value) |
void |
printFloat(_Private_IonTextWriterBuilder _options,
double value) |
void |
printFloat(_Private_IonTextWriterBuilder _options,
java.lang.Double value) |
void |
printInt(java.math.BigInteger value) |
void |
printInt(long value) |
void |
printJsonString(java.lang.CharSequence text)
Print a JSON string
|
void |
printLongString(java.lang.CharSequence text)
Print an Ion triple-quoted string
|
void |
printQuotedSymbol(java.lang.CharSequence text)
Print single-quoted Ion Symbol type
|
void |
printString(java.lang.CharSequence text)
Print an Ion String type
|
void |
printSymbol(java.lang.CharSequence text)
Print an Ion Symbol type.
|
static boolean |
symbolNeedsQuoting(java.lang.CharSequence symbol,
boolean quoteOperators)
Determines whether the text of a symbol requires (single) quotes.
|
public static final boolean[] OPERATOR_CHAR_FLAGS
public static final java.lang.String[] ZERO_PADDING
public static boolean isIdentifierStart(int codePoint)
public static boolean isIdentifierPart(int codePoint)
public static boolean isOperatorPart(int codePoint)
public static _Private_IonTextAppender forFastAppendable(_Private_FastAppendable out, java.nio.charset.Charset charset)
public static _Private_IonTextAppender forAppendable(java.lang.Appendable out, java.nio.charset.Charset charset)
charset
- must be either IonTextWriterBuilder.ASCII
or
IonTextWriterBuilder.UTF8
. When ASCII is used, all non-ASCII
characters will be escaped. Otherwise, only select code points will be
escaped.public static _Private_IonTextAppender forAppendable(java.lang.Appendable out)
public static _Private_IonTextAppender forOutputStream(java.io.OutputStream out, java.nio.charset.Charset charset)
charset
- must be either IonTextWriterBuilder.ASCII
or
IonTextWriterBuilder.UTF8
. When ASCII is used, all non-ASCII
characters will be escaped. Otherwise, only select code points will be
escaped.public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public void appendAscii(char c) throws java.io.IOException
java.io.IOException
public void appendAscii(java.lang.CharSequence csq) throws java.io.IOException
java.io.IOException
public void appendAscii(java.lang.CharSequence csq, int start, int end) throws java.io.IOException
java.io.IOException
public void appendUtf16(char c) throws java.io.IOException
java.io.IOException
public void appendUtf16Surrogate(char leadSurrogate, char trailSurrogate) throws java.io.IOException
java.io.IOException
public final void printString(java.lang.CharSequence text) throws java.io.IOException
text
- java.io.IOException
public final void printLongString(java.lang.CharSequence text) throws java.io.IOException
text
- java.io.IOException
public final void printJsonString(java.lang.CharSequence text) throws java.io.IOException
text
- java.io.IOException
public static boolean isIdentifierKeyword(java.lang.CharSequence text)
null
, true
, or false
.
This does not check for non-identifier keywords such as
null.int
.
text
- the symbol to check.true
if the text is an identifier keyword.public static boolean symbolNeedsQuoting(java.lang.CharSequence symbol, boolean quoteOperators)
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.true
if the given symbol requires quoting.java.lang.NullPointerException
- if symbol
is null
.public final void printSymbol(java.lang.CharSequence text) throws java.io.IOException
text
- java.io.IOException
public final void printQuotedSymbol(java.lang.CharSequence text) throws java.io.IOException
text
- java.io.IOException
public void printInt(long value) throws java.io.IOException
java.io.IOException
public void printInt(java.math.BigInteger value) throws java.io.IOException
java.io.IOException
public void printDecimal(_Private_IonTextWriterBuilder _options, java.math.BigDecimal value) throws java.io.IOException
java.io.IOException
public void printFloat(_Private_IonTextWriterBuilder _options, double value) throws java.io.IOException
java.io.IOException
public void printFloat(_Private_IonTextWriterBuilder _options, java.lang.Double value) throws java.io.IOException
java.io.IOException
public void printBlob(_Private_IonTextWriterBuilder _options, byte[] value, int start, int len) throws java.io.IOException
java.io.IOException
public void printClob(_Private_IonTextWriterBuilder _options, byte[] value, int start, int len) throws java.io.IOException
java.io.IOException