Package com.amazon.ion.impl
Class _Private_IonTextWriterBuilder
- java.lang.Object
-
- com.amazon.ion.system.IonWriterBuilder
-
- com.amazon.ion.system.IonTextWriterBuilder
-
- com.amazon.ion.impl._Private_IonTextWriterBuilder
-
public class _Private_IonTextWriterBuilder extends IonTextWriterBuilder
NOT FOR APPLICATION USE!
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.amazon.ion.system.IonTextWriterBuilder
IonTextWriterBuilder.LstMinimizing, IonTextWriterBuilder.NewLineType
-
Nested classes/interfaces inherited from class com.amazon.ion.system.IonWriterBuilder
IonWriterBuilder.InitialIvmHandling, IonWriterBuilder.IvmMinimizing
-
-
Field Summary
Fields Modifier and Type Field Description boolean_allow_invalid_sidsboolean_blob_as_stringboolean_clob_as_stringboolean_decimal_as_floatboolean_float_nan_and_inf_as_nullboolean_sexp_as_listboolean_skip_annotationsboolean_string_as_jsonboolean_symbol_as_stringboolean_timestamp_as_millisboolean_timestamp_as_stringboolean_untyped_nullsstatic _Private_IonTextWriterBuilderSTANDARD-
Fields inherited from class com.amazon.ion.system.IonTextWriterBuilder
ASCII, UTF8
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IonWriterbuild(java.io.OutputStream out)Builds a new writer based on this builder's configuration properties.IonWriterbuild(java.lang.Appendable out)Creates a new writer that will write text to the given output stream._Private_IonTextWriterBuildercopy()_Private_CallbackBuildergetCallbackBuilder()Gets the_Private_CallbackBuilderthat will be used to create a_Private_MarkupCallbackwhen a new writer is built.IonCataloggetCatalog()Gets the catalog to use when building anIonWriter.SymbolTable[]getImports()Gets the imports that will be used to construct the initial local symbol table._Private_IonTextWriterBuilderimmutable()_Private_IonTextWriterBuildermutable()protected voidmutationCheck()NOT FOR APPLICATION USE!voidsetCallbackBuilder(_Private_CallbackBuilder builder)Sets the_Private_CallbackBuilderthat will be used to create a_Private_MarkupCallbackwhen a new writer is built.voidsetCatalog(IonCatalog catalog)Sets the catalog to use when building anIonWriter.voidsetImports(SymbolTable... imports)Sets the shared symbol tables that will be used to construct the initial local symbol table.static _Private_IonTextWriterBuilderstandard()_Private_IonTextWriterBuilderwithCallbackBuilder(_Private_CallbackBuilder builder)Declares the_Private_CallbackBuilderto use when building._Private_IonTextWriterBuilderwithInvalidSidsAllowed(boolean allowInvalidSids)Determines whether this builder should allow invalid SIDs (i.e.IonTextWriterBuilderwithJsonDowngrade()Declares that this builder should downgrade the writers' output to JSON compatibility.IonTextWriterBuilderwithPrettyPrinting()Declares that this builder should use basic pretty-printing.-
Methods inherited from class com.amazon.ion.system.IonTextWriterBuilder
getCharset, getInitialIvmHandling, getIvmMinimizing, getLongStringThreshold, getLstMinimizing, getNewLineType, getWriteTopLevelValuesOnNewLines, json, minimal, pretty, setCharset, setInitialIvmHandling, setIvmMinimizing, setLongStringThreshold, setLstMinimizing, setNewLineType, setWriteTopLevelValuesOnNewLines, withCatalog, withCharset, withCharsetAscii, withImports, withInitialIvmHandling, withIvmMinimizing, withLongStringThreshold, withLstMinimizing, withMinimalSystemData, withNewLineType, withWriteTopLevelValuesOnNewLines
-
-
-
-
Field Detail
-
STANDARD
public static _Private_IonTextWriterBuilder STANDARD
-
_blob_as_string
public boolean _blob_as_string
-
_clob_as_string
public boolean _clob_as_string
-
_decimal_as_float
public boolean _decimal_as_float
-
_float_nan_and_inf_as_null
public boolean _float_nan_and_inf_as_null
-
_sexp_as_list
public boolean _sexp_as_list
-
_skip_annotations
public boolean _skip_annotations
-
_string_as_json
public boolean _string_as_json
-
_symbol_as_string
public boolean _symbol_as_string
-
_timestamp_as_millis
public boolean _timestamp_as_millis
-
_timestamp_as_string
public boolean _timestamp_as_string
-
_untyped_nulls
public boolean _untyped_nulls
-
_allow_invalid_sids
public boolean _allow_invalid_sids
-
-
Method Detail
-
standard
public static _Private_IonTextWriterBuilder standard()
-
copy
public final _Private_IonTextWriterBuilder copy()
- Specified by:
copyin classIonTextWriterBuilder
-
immutable
public _Private_IonTextWriterBuilder immutable()
- Specified by:
immutablein classIonTextWriterBuilder
-
mutable
public _Private_IonTextWriterBuilder mutable()
- Specified by:
mutablein classIonTextWriterBuilder
-
withPrettyPrinting
public final IonTextWriterBuilder withPrettyPrinting()
Description copied from class:IonTextWriterBuilderDeclares that this builder should use basic pretty-printing. Does not alter the handling of system data. Calling this method alters several other configuration properties, so code should call it first, then make any necessary overrides.The specifics of this configuration may change between releases of this library, so automated processes should not depend on the exact output formatting.
- Specified by:
withPrettyPrintingin classIonTextWriterBuilder- Returns:
- this instance, if mutable; otherwise a mutable copy of this instance.
-
withJsonDowngrade
public final IonTextWriterBuilder withJsonDowngrade()
Description copied from class:IonTextWriterBuilderDeclares that this builder should downgrade the writers' output to JSON compatibility. This format cannot round-trip back to Ion with full fidelity.The specific conversions are as follows:
- System data is suppressed per
IonTextWriterBuilder.withMinimalSystemData(). - All annotations are suppressed.
- Nulls of any type are printed as JSON
null. - Blobs are printed as strings, containing Base64.
- Clobs are printed as strings, containing only Unicode code points U+00 through U+FF.
- Sexps are printed as lists.
- Symbols are printed as strings.
- Timestamps are printed as strings, using Ion timestamp format.
- Specified by:
withJsonDowngradein classIonTextWriterBuilder- Returns:
- this instance, if mutable; otherwise a mutable copy of this instance.
- System data is suppressed per
-
withInvalidSidsAllowed
public final _Private_IonTextWriterBuilder withInvalidSidsAllowed(boolean allowInvalidSids)
Determines whether this builder should allow invalid SIDs (i.e. SIDs out of range of the current symbol table or SIDs with unknown text). This is disabled by default, because enabling this option can result in writing invalid Ion data. This option should only be enabled when writing text Ion data primarily for debugging by humans.- Parameters:
allowInvalidSids- whether to allow invalid SIDs.- Returns:
- the builder.
-
build
public final IonWriter build(java.lang.Appendable out)
Description copied from class:IonTextWriterBuilderCreates a new writer that will write text to the given output stream.If you have an
OutputStream, you'll get better performance usingIonWriterBuilder.build(OutputStream)as opposed to wrapping your stream in anAppendableand calling this method.- Specified by:
buildin classIonTextWriterBuilder- Parameters:
out- the stream that will receive Ion text data. Must not be null.- Returns:
- a new
IonWriterinstance; notnull.
-
build
public final IonWriter build(java.io.OutputStream out)
Description copied from class:IonWriterBuilderBuilds a new writer based on this builder's configuration properties.- Specified by:
buildin classIonWriterBuilder- Parameters:
out- the stream that will receive Ion data. Must not be null.- Returns:
- a new
IonWriterinstance; notnull.
-
getCallbackBuilder
public final _Private_CallbackBuilder getCallbackBuilder()
Gets the_Private_CallbackBuilderthat will be used to create a_Private_MarkupCallbackwhen a new writer is built.- Returns:
- The builder that will be used to build a new MarkupCallback.
- See Also:
setCallbackBuilder(_Private_CallbackBuilder),withCallbackBuilder(_Private_CallbackBuilder)
-
setCallbackBuilder
public void setCallbackBuilder(_Private_CallbackBuilder builder)
Sets the_Private_CallbackBuilderthat will be used to create a_Private_MarkupCallbackwhen a new writer is built.- Parameters:
builder- The builder that will be used to build a new MarkupCallback.- Throws:
java.lang.UnsupportedOperationException- if this is immutable.- See Also:
getCallbackBuilder(),withCallbackBuilder(_Private_CallbackBuilder)
-
withCallbackBuilder
public final _Private_IonTextWriterBuilder withCallbackBuilder(_Private_CallbackBuilder builder)
Declares the_Private_CallbackBuilderto use when building.- Parameters:
builder- The builder that will be used to build a new MarkupCallback.- Returns:
- this instance, if mutable; otherwise a mutable copy of this instance.
- See Also:
getCallbackBuilder(),setCallbackBuilder(_Private_CallbackBuilder)
-
mutationCheck
protected void mutationCheck()
NOT FOR APPLICATION USE!
-
getCatalog
public final IonCatalog getCatalog()
Gets the catalog to use when building anIonWriter. The catalog is needed to resolve manually-written imports (not common). By default, this property is null.- See Also:
setCatalog(IonCatalog),withCatalog(IonCatalog)
-
setCatalog
public void setCatalog(IonCatalog catalog)
Sets the catalog to use when building anIonWriter.- Parameters:
catalog- the catalog to use in built writers. If null, the writer will be unable to resolve manually-written imports and may throw an exception.- Throws:
java.lang.UnsupportedOperationException- if this is immutable.- See Also:
getCatalog(),withCatalog(IonCatalog)
-
getImports
public final SymbolTable[] getImports()
Gets the imports that will be used to construct the initial local symbol table.- Returns:
- may be null or empty.
- See Also:
setImports(SymbolTable...),withImports(SymbolTable...)
-
setImports
public void setImports(SymbolTable... imports)
Sets the shared symbol tables that will be used to construct the initial local symbol table.If the imports sequence is not null and not empty, the output stream will be bootstrapped with a local symbol table that uses the given
imports.- Parameters:
imports- a sequence of shared symbol tables. The first (and only the first) may be a system table.- Throws:
java.lang.UnsupportedOperationException- if this is immutable.- See Also:
getImports(),withImports(SymbolTable...)
-
-