| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private SymbolToken[] | |
| private boolean | _anything_written
Indicates whether we've written anything at all. |
| pack-priv final SymbolTable | _default_system_symbol_table
The system symtab used when resetting the stream. |
| private String | |
| private int | |
| private IonType | _field_name_type
really ion type is only used for int, string or null (unknown) |
| private IonWriterBuilder. | _initial_ivm_handling
What to do about IVMs at the start of the stream. |
| private final IonWriterBuilder. | _ivm_minimizing
What to do about non-initial IVMs. |
| private boolean | _previous_value_was_ivm
Indicates whether the (immediately previous emitted value was an IVM. |
| private SymbolTable | _symbol_table
Must be either local or system table, and never null. |
| private static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv | IonWriterSystem(SymbolTable
must not be null. defaultSystemSymbolTable, IonWriterBuilder.
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final int | |
| public final void | addTypeAnnotation(String
string annotation to append to the annotation list annotation)Implements com. Adds a given string to the list of pending annotations. |
| pack-priv final int | |
| public <T> T | asFacet(Class<T>
The type token of the requested facet type. facetType)Overrides com. Implements com. Returns a facet of this subject if supported. |
| pack-priv final SymbolToken | |
| pack-priv final String | assumeKnownSymbol(int sid)
Implements abstract com. Translates a symbol using the current symtab. |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv void | |
| pack-priv final void | ensureAnnotationCapacity(int length)
Ensures that our |
| pack-priv final int | findAnnotation(String
the annotation to find. name)Implements abstract com. Returns the given annotation's index in the value's annotations list, or -1 if not present. |
| public void | finish()
Implements com. Indicates that writing is completed and all buffered data should be written and flushed as if this were the end of the Ion data stream. |
| pack-priv final SymbolTable | |
| pack-priv final int | Returns: symbol id of the name of the field about to be written or -1 if it is not setReturns the symbol id of the current field name, if the field name has been set. |
| public final SymbolTable | getSymbolTable()
Implements com. Gets the symbol table that is currently in use by the writer. |
| pack-priv final int[] | getTypeAnnotationIds()
Implements abstract com. Gets the current list of pending annotations. |
| pack-priv final String[] | getTypeAnnotations()
Implements abstract com. Gets the current list of pending annotations. |
| pack-priv final SymbolToken[] | |
| pack-priv final boolean | |
| pack-priv SymbolTable | Returns: not null.Builds a new local symbol table from the current contextual symtab (a system symtab). |
| pack-priv final int[] | |
| public final boolean | isFieldNameSet()
Implements abstract com. Returns true if the field name has been set either through setFieldName or setFieldId. |
| public final void | setFieldName(String
text of the field name name)Implements com. Sets the pending field name to the given text. |
| public final void | setFieldNameSymbol(SymbolToken
text of the field name name)Implements com. Sets the pending field name to the given token. |
| public final void | setSymbolTable(SymbolTable
base symbol table for encoding. Must not be null. symbols)Implements abstract com. Sets the symbol table to use for encoding to be the passed in symbol table. |
| public final void | setTypeAnnotations(String...
string array with the annotations.
If null or empty, any pending annotations are cleared. annotations)Implements com. Sets the full list of pending annotations to the given text symbols. |
| public final void | setTypeAnnotationSymbols(SymbolToken...
If null or empty, any pending annotations are cleared. annotations)Implements com. Sets the full list of pending annotations to the given symbols. |
| pack-priv boolean | |
| pack-priv void | |
| pack-priv final void | |
| public final void | writeIonVersionMarker()
Implements abstract com. Write an Ion version marker symbol to the output. |
| pack-priv abstract void | writeIonVersionMarkerAsIs(SymbolTable systemSymtab)
Writes an IVM without checking preconditions or
|
| pack-priv void | |
| pack-priv final void | writeSymbol(int
symbol table id to write symbolId)Implements abstract com. Write symbolId out as an IonSymbol value. |
| public final void | writeSymbol(String
may be null to represent value)null.symbol.Implements com. Writes the text of an Ion symbol value. |
| pack-priv abstract void | |
| pack-priv abstract void |
| _annotation_count | back to summary |
|---|---|
| private int _annotation_count | |
| _annotations | back to summary |
|---|---|
| private SymbolToken[] _annotations | |
| _anything_written | back to summary |
|---|---|
| private boolean _anything_written Indicates whether we've written anything at all. | |
| _default_system_symbol_table | back to summary |
|---|---|
| pack-priv final SymbolTable _default_system_symbol_table The system symtab used when resetting the stream. Must not be null. | |
| _field_name | back to summary |
|---|---|
| private String _field_name | |
| _field_name_sid | back to summary |
|---|---|
| private int _field_name_sid | |
| _field_name_type | back to summary |
|---|---|
| private IonType _field_name_type really ion type is only used for int, string or null (unknown) | |
| _initial_ivm_handling | back to summary |
|---|---|
| private IonWriterBuilder. What to do about IVMs at the start of the stream.
Becomes null as soon as we write anything.
After a | |
| _ivm_minimizing | back to summary |
|---|---|
| private final IonWriterBuilder. What to do about non-initial IVMs. | |
| _previous_value_was_ivm | back to summary |
|---|---|
| private boolean _previous_value_was_ivm Indicates whether the (immediately previous emitted value was an IVM.
This is cleared by | |
| _symbol_table | back to summary |
|---|---|
| private SymbolTable _symbol_table Must be either local or system table, and never null. May only be changed between top-level values. | |
| DEFAULT_ANNOTATION_COUNT | back to summary |
|---|---|
| private static final int DEFAULT_ANNOTATION_COUNT | |
| IonWriterSystem | back to summary |
|---|---|
pack-priv IonWriterSystem(SymbolTable defaultSystemSymbolTable, IonWriterBuilder.
| |
| add_symbol | back to summary |
|---|---|
| pack-priv final int add_symbol(String name) throws IOException | |
| addTypeAnnotation | back to summary |
|---|---|
| public final void addTypeAnnotation(String annotation) Implements com. Doc from com. Adds a given string to the list of pending annotations.
The list of pending annotations is cleared when the current value is
written via
| |
| annotationCount | back to summary |
|---|---|
| pack-priv final int annotationCount() | |
| asFacet | back to summary |
|---|---|
| public <T> T asFacet(Class<T> facetType) Overrides com. Implements com. Doc from com. Returns a facet of this subject if supported.
| |
| assumeFieldNameSymbol | back to summary |
|---|---|
| pack-priv final SymbolToken assumeFieldNameSymbol() | |
| assumeKnownSymbol | back to summary |
|---|---|
| pack-priv final String assumeKnownSymbol(int sid) Implements abstract com. Doc from com. Translates a symbol using the current symtab. | |
| clearAnnotations | back to summary |
|---|---|
| pack-priv final void clearAnnotations() | |
| clearFieldName | back to summary |
|---|---|
| pack-priv final void clearFieldName() | |
| endValue | back to summary |
|---|---|
| pack-priv void endValue() | |
| ensureAnnotationCapacity | back to summary |
|---|---|
| pack-priv final void ensureAnnotationCapacity(int length) Ensures that our | |
| findAnnotation | back to summary |
|---|---|
| pack-priv final int findAnnotation(String name) Implements abstract com. Doc from com. Returns the given annotation's index in the value's annotations list, or -1 if not present. | |
| finish | back to summary |
|---|---|
| public void finish() throws IOException Implements com. Doc from com. Indicates that writing is completed and all buffered data should be written and flushed as if this were the end of the Ion data stream. For example, an Ion binary writer will finalize any local symbol table, write all top-level values, and then flush. This method may only be called when all top-level values are completely written and stepped-out.
Implementations should allow the application to continue writing further
top-level values following the semantics for concatenating Ion data
streams. If another top-level value is written, the result must behave
as if it were preceded by an Ion version marker, resetting the stream
context as if this were a new stream. (Whether or not an IVM is written
may depend upon the writer's configuration; see
This feature can be used to flush buffered data and reset the local
symbol table before writing more values. Applications that produce long
streams of binary Ion may wish to finish occasionally to relieve memory
pressure, then continue writing data using a new local symbol table.
This is particularly useful for streams that contain an ever-growing
number of unique symbols to avoid unbounded growth of the symbol table,
which may degrade performance and bloat the encoding. Applications that
produce long streams with a limited number of unique symbols should
enable localSymbolTableAppend (see
| |
| getDefaultSystemSymtab | back to summary |
|---|---|
| pack-priv final SymbolTable getDefaultSystemSymtab() | |
| getFieldId | back to summary |
|---|---|
| pack-priv final int getFieldId() Returns the symbol id of the current field name, if the field name has been set. If the name has not been set, either as either a String or a symbol id value, this returns -1 (undefined symbol).
| |
| getSymbolTable | back to summary |
|---|---|
| public final SymbolTable getSymbolTable() Implements com. Doc from com. Gets the symbol table that is currently in use by the writer. While writing a number of values the symbol table will be populated with any added symbols. Note that the table may be replaced during processing. For example, the stream may start out with a system table that's later replaced by a local table in order to store newly-encountered symbols.
When this method returns a local table, it may be
mutable, meaning that additional
symbols may be interned until it is
made read-only. Note that
manually mutating local symbol tables is a deprecated feature;
please instead use
| |
| getTypeAnnotationIds | back to summary |
|---|---|
| pack-priv final int[] getTypeAnnotationIds() Implements abstract com. Doc from com. 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 final String[] getTypeAnnotations() Implements abstract com. Doc from com. 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.
| |
| getTypeAnnotationSymbols | back to summary |
|---|---|
| pack-priv final SymbolToken[] getTypeAnnotationSymbols() | |
| hasAnnotations | back to summary |
|---|---|
| pack-priv final boolean hasAnnotations() | |
| inject_local_symbol_table | back to summary |
|---|---|
| pack-priv SymbolTable inject_local_symbol_table() throws IOException Builds a new local symbol table from the current contextual symtab (a system symtab).
| |
| internAnnotationsAndGetSids | back to summary |
|---|---|
| pack-priv final int[] internAnnotationsAndGetSids() throws IOException | |
| isFieldNameSet | back to summary |
|---|---|
| public final boolean isFieldNameSet() Implements abstract com. Doc from com. 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.
| |
| setFieldName | back to summary |
|---|---|
| public final void setFieldName(String name) Implements com. Doc from com. Sets the pending field name to the given text.
The pending field name is cleared when the current value is
written via
| |
| setFieldNameSymbol | back to summary |
|---|---|
| public final void setFieldNameSymbol(SymbolToken name) Implements com. Doc from com. Sets the pending field name to the given token.
The pending field name is cleared when the current value is
written via
| |
| setSymbolTable | back to summary |
|---|---|
| public final void setSymbolTable(SymbolTable symbols) throws IOException Implements abstract com. Doc from com. 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.
This implementation simply validates that the argument is not a
shared symbol table, and assigns it to
| |
| setTypeAnnotations | back to summary |
|---|---|
| public final void setTypeAnnotations(String... annotations) Implements com. Doc from com. Sets the full list of pending annotations to the given text symbols.
Any pending annotations are cleared.
The contents of the
The list of pending annotations is cleared when the current value is
written via
| |
| setTypeAnnotationSymbols | back to summary |
|---|---|
| public final void setTypeAnnotationSymbols(SymbolToken... annotations) Implements com. Doc from com. Sets the full list of pending annotations to the given symbols.
Any pending annotations are cleared.
The contents of the
The list of pending annotations is cleared when the current value is
written via This is an "expert method": correct use requires deep understanding of the Ion binary format. You almost certainly don't want to use it.
| |
| shouldWriteIvm | back to summary |
|---|---|
| pack-priv boolean shouldWriteIvm() | |
| startValue | back to summary |
|---|---|
| pack-priv void startValue() throws IOException | |
| writeIonVersionMarker | back to summary |
|---|---|
| pack-priv final void writeIonVersionMarker(SymbolTable systemSymtab) throws IOException Sets | |
| writeIonVersionMarker | back to summary |
|---|---|
| public final void writeIonVersionMarker() throws IOException Implements abstract com. Doc from com. 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.
| |
| writeIonVersionMarkerAsIs | back to summary |
|---|---|
| pack-priv abstract void writeIonVersionMarkerAsIs(SymbolTable systemSymtab) throws IOException Writes an IVM without checking preconditions or
| |
| writeLocalSymtab | back to summary |
|---|---|
| pack-priv void writeLocalSymtab(SymbolTable symtab) throws IOException | |
| writeSymbol | back to summary |
|---|---|
| pack-priv final void writeSymbol(int symbolId) throws IOException Implements abstract com. Doc from com. Write symbolId out as an IonSymbol value. The value must be valid in the symbol table.
| |
| writeSymbol | back to summary |
|---|---|
| public final void writeSymbol(String value) throws IOException Implements com. Doc from com. Writes the text of an Ion symbol value.
| |
| writeSymbolAsIs | back to summary |
|---|---|
| pack-priv abstract void writeSymbolAsIs(int symbolId) throws IOException Writes a symbol without checking for system ID. | |
| writeSymbolAsIs | back to summary |
|---|---|
| pack-priv abstract void writeSymbolAsIs(String value) throws IOException Writes a symbol without checking for system ID. | |