Base type for Ion writers. This handles the writeIonEvents and provides default handlers for the list forms of write. This also resolves symbols if a symbol table is available (which it will not be if the underlying writer is a system writer).
| Modifier and Type | Field and Description |
|---|---|
| private SymbolTable[] | |
| private int | |
| pack-priv static final String | |
| protected static final String | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | _Private_IonWriterBase(boolean
true if SID validation should be performed; otherwise, false.
See requireSymbolValidation)_Private_IonTextWriterBuilder#withInvalidSidsAllowed(boolean)
|
| Modifier and Type | Method and Description |
|---|---|
| public <T> T | asFacet(Class<T>
The type token of the requested facet type. facetType)Implements com. Returns a facet of this subject if supported. |
| pack-priv abstract String | |
| private void | |
| pack-priv abstract int | Returns: the index or -1.the annotation to find. name)Returns the given annotation's index in the value's annotations list, or -1 if not present. |
| protected abstract int | Returns: int depth of container nestingReturns the current depth of containers the writer is at. |
| pack-priv abstract int[] | Returns: pending type annotations as symbol ID ints, null if the annotations cannot be expressed as IDs.Gets the current list of pending annotations. |
| pack-priv abstract String[] | Returns: pending type annotations as strings, null if the annotations cannot be expressed as strings.Gets the current list of pending annotations. |
| public abstract boolean | Returns: true if a field name has been set false otherwiseReturns true if the field name has been set either through setFieldName or setFieldId. |
| public boolean | |
| public final SymbolTable | |
| private void | |
| public abstract void | setSymbolTable(SymbolTable
base symbol table for encoding. Must not be null. symbols)Sets the symbol table to use for encoding to be the passed in symbol table. |
| private final void | |
| pack-priv final void | |
| private final void | |
| private final void | |
| public void | writeBlob(byte[]
may be null to represent value)null.blob.Implements com. write the byte array out as an IonBlob value. |
| public void | writeClob(byte[]
may be null to represent value)null.clob.Implements com. write the byte array out as an IonClob value. |
| public abstract void | writeDecimal(BigDecimal
may be null to represent value)null.decimal.Redeclares com. Writes a BigDecimal value as an Ion decimal. |
| public void | |
| pack-priv abstract void | |
| public void | writeNull()
Implements com. Writes a value of Ion's null type ( |
| pack-priv abstract void | |
| public final void | writeSymbolToken(SymbolToken
may be null to represent tok)null.symbol.Implements com. Writes the content of an Ion symbol value. |
| public void | writeTimestampUTC(Date
java.util Date holding the UTC timestamp;
may be null to represent value)null.timestamp.Implements com. writes the passed in Date (in milliseconds since the epoch) as an IonTimestamp. |
| public void | writeValue(IonValue
may be null, in which case this method does nothing. value)Implements com.
Deprecated
writes the contents of the passed in Ion value to the output. |
| public void | writeValue(IonReader reader)
Implements com. Overrides can optimize special cases. |
| pack-priv final void | writeValueRecursively(IonReader
The IonReader that will provide a value to write. reader)Writes the provided IonReader's current value including any annotations. |
| public void | writeValues(IonReader reader)
Implements com. Writes a reader's current value, and all following values until the end of the current container. |
| _symbol_table_stack | back to summary |
|---|---|
| private SymbolTable[] _symbol_table_stack | |
| _symbol_table_top | back to summary |
|---|---|
| private int _symbol_table_top | |
| ERROR_FINISH_NOT_AT_TOP_LEVEL | back to summary |
|---|---|
| pack-priv static final String ERROR_FINISH_NOT_AT_TOP_LEVEL | |
| ERROR_MISSING_FIELD_NAME | back to summary |
|---|---|
| protected static final String ERROR_MISSING_FIELD_NAME | |
| requireSymbolValidation | back to summary |
|---|---|
| private final boolean requireSymbolValidation | |
| _Private_IonWriterBase | back to summary |
|---|---|
public _Private_IonWriterBase(boolean requireSymbolValidation)
| |
| asFacet | back to summary |
|---|---|
| public <T> T asFacet(Class<T> facetType) Implements com. Doc from com. Returns a facet of this subject if supported.
| |
| assumeKnownSymbol | back to summary |
|---|---|
| pack-priv abstract String assumeKnownSymbol(int sid) Translates a symbol using the current symtab.
| |
| clear_system_value_stack | back to summary |
|---|---|
| private void clear_system_value_stack() | |
| findAnnotation | back to summary |
|---|---|
| pack-priv abstract int findAnnotation(String name) Returns the given annotation's index in the value's annotations list, or -1 if not present.
| |
| getDepth | back to summary |
|---|---|
| protected abstract int getDepth() Returns the current depth of containers the writer is at. This is 0 if the writer is at top-level.
| |
| getTypeAnnotationIds | back to summary |
|---|---|
| pack-priv abstract int[] getTypeAnnotationIds() Gets the current list of pending annotations.
This is the contents of the current If the annotations were set as string they will be converted to symbol IDs (ints) if a symbol table is available. In the event a symbol table is not available a null array will be returned. If no annotations are set a 0 length array will be returned.
| |
| getTypeAnnotations | back to summary |
|---|---|
| pack-priv abstract String[] getTypeAnnotations() Gets the current list of pending annotations.
This is the contents of the current If the annotations were set as IDs they will be converted if a symbol table is available. In the event a symbol table is not available a null array will be returned. If no annotations are set a 0 length array will be returned.
| |
| isFieldNameSet | back to summary |
|---|---|
| public abstract boolean isFieldNameSet() Returns true if the field name has been set either through setFieldName or setFieldId. This is generally more efficient than calling getFieldName or getFieldId and checking the return type as it does not need to resolve the name through a symbol table. This returns false if the field name has not been set.
| |
| isStreamCopyOptimized | back to summary |
|---|---|
| public boolean isStreamCopyOptimized() | |
| pop_passed_symbol_table | back to summary |
|---|---|
| public final SymbolTable pop_passed_symbol_table() Implements com. | |
| push_symbol_table | back to summary |
|---|---|
| private void push_symbol_table(SymbolTable symbols) | |
| setSymbolTable | back to summary |
|---|---|
| public abstract void setSymbolTable(SymbolTable symbols) throws IOException Sets the symbol table to use for encoding to be the passed in symbol table. The can only be done between top-level values. As symbols are written this symbol table is used to resolve them. If the symbols are undefined this symbol table is updated to include them as local symbols. The updated symbol table will be written before any of the local values are emitted. If the symbol table is the system symbol table an Ion version marker will be written to the output. If symbols not in the system symbol table are written a local symbol table will be created and written before the current top level value.
| |
| transfer_symbol_tables | back to summary |
|---|---|
| private final void transfer_symbol_tables(_Private_ReaderWriter reader) throws IOException | |
| validateSymbolId | back to summary |
|---|---|
| pack-priv final void validateSymbolId(int sid) | |
| write_value_annotations_helper | back to summary |
|---|---|
| private final void write_value_annotations_helper(IonReader reader) | |
| write_value_field_name_helper | back to summary |
|---|---|
private final void write_value_field_name_helper(IonReader reader)
| |
| writeBlob | back to summary |
|---|---|
| public void writeBlob(byte[] value) throws IOException Implements com. Doc from com. write the byte array out as an IonBlob value. This copies the byte array.
| |
| writeClob | back to summary |
|---|---|
| public void writeClob(byte[] value) throws IOException Implements com. Doc from com. write the byte array out as an IonClob value. This copies the byte array.
| |
| writeDecimal | back to summary |
|---|---|
| public abstract void writeDecimal(BigDecimal value) throws IOException Redeclares com. Doc from com. Writes a BigDecimal value as an Ion decimal. Ion uses an arbitrarily long sign/value and an arbitrarily long signed exponent to write the value. This preserves all of the BigDecimal digits, the number of significant digits.
To write a negative zero value, pass this method a
| |
| writeFloat | back to summary |
|---|---|
| public void writeFloat(float value) throws IOException | |
| writeIonVersionMarker | back to summary |
|---|---|
| pack-priv abstract void writeIonVersionMarker() throws IOException Write an Ion version marker symbol to the output. This is the $ion_1_0 value currently (in later versions the number may change). In text output this appears as the text symbol. In binary this will be the symbol id if the writer is in a list, sexp or struct. If the writer is currently at the top level this will write the "magic cookie" value. Writing a version marker will reset the symbol table to be the system symbol table. | |
| writeNull | back to summary |
|---|---|
| public void writeNull() throws IOException Implements com. Doc from com. Writes a value of Ion's null type ( | |
| writeSymbol | back to summary |
|---|---|
| pack-priv abstract void writeSymbol(int symbolId) throws IOException Write symbolId out as an IonSymbol value. The value must be valid in the symbol table.
| |
| writeSymbolToken | back to summary |
|---|---|
| public final void writeSymbolToken(SymbolToken tok) throws IOException Implements com. Doc from com. Writes the content of an Ion symbol value.
| |
| writeTimestampUTC | back to summary |
|---|---|
| public void writeTimestampUTC(Date value) throws IOException Implements com. Doc from com. writes the passed in Date (in milliseconds since the epoch) as an IonTimestamp. The Date value is treated as a UTC value with an unknown timezone offset (a z value).
| |
| writeValue | back to summary |
|---|---|
| public void writeValue(IonValue value) throws IOException Implements com. Doc from com. Deprecated
writes the contents of the passed in Ion value to the output. This method also writes annotations and field names (if in a struct), and performs a deep write, including the contents of any containers encountered.
| |
| writeValue | back to summary |
|---|---|
| public void writeValue(IonReader reader) throws IOException Implements com. Overrides can optimize special cases. | |
| writeValueRecursively | back to summary |
|---|---|
| pack-priv final void writeValueRecursively(IonReader reader) throws IOException Writes the provided IonReader's current value including any annotations. This function will not advance the
IonReader beyond the end of the current value; users wishing to continue using the IonReader at the current
depth will need to call
| |
| writeValues | back to summary |
|---|---|
| public void writeValues(IonReader reader) throws IOException Implements com. Doc from com. Writes a reader's current value, and all following values until the end
of the current container. If there's no current value then this method
calls
This method iterates until This method also writes annotations and field names (if in a struct), and performs a deep write, including the contents of any containers encountered. | |