Package com.amazon.ion.util
Class Printer
java.lang.Object
com.amazon.ion.util.Printer
Deprecated.
DEPRECATED: use
IonValue.writeTo(IonWriter) instead.
Renders IonValues to text.
By default, output is in a compact format with minimal whitespace. For example:
annot::{f1:["hello","goodbye"],'another field':long::0}
The format can be tuned through various properties on the Printer instance,
as well as through the Printer.Options structure.
Instances of this class are safe for use by multiple threads.
While printers are inexpensive to create, their configuration facilities
make them useful as shared resources. Changes to configuration settings
(e.g., setJsonMode()) do not affect concurrently-running
calls to print(com.amazon.ion.IonValue, java.lang.Appendable).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassDeprecated.static classDeprecated.UseIonValue.writeTo(IonWriter)instead. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Indicates whether this printer renders blobs as Base64 strings.booleanDeprecated.Indicates whether this printer renders clobs as ASCII strings.booleanDeprecated.Indicates whether this printer renders datagrams as lists.booleanDeprecated.Indicates whether this printer renders decimals as floats, thus using 'e' notation for all real values.booleanDeprecated.Indicates whether this printer renders sexps as lists.booleanDeprecated.Indicates whether this printer renders strings using JSON escapes.booleanDeprecated.Indicates whether this printer renders symbols as strings.booleanDeprecated.Indicates whether this printer renders timestamps as millisecond values.booleanDeprecated.Indicates whether this printer renders timestamps as strings.booleanDeprecated.Indicates whether this printer renders all null values asnull(i.e., the same as anIonNull).booleanDeprecated.Indicates whether this printer skips (i.e., doesn't print) annotations.booleanDeprecated.Indicates whether this printer skips (i.e., doesn't print) system IDs and local symbol tables.protected Printer.PrinterVisitormakeVisitor(Printer.Options options, Appendable out) Deprecated.Subclasses can override this if they wish to construct a specialization of thePrinter.PrinterVisitor.voidprint(IonValue value, Appendable out) Deprecated.voidDeprecated.Configures this printer's options to render legal JSON text.voidsetPrintBlobAsString(boolean blobAsString) Deprecated.Sets whether this printer renders blobs as Base64 strings.voidsetPrintClobAsString(boolean clobAsString) Deprecated.Sets whether this printer renders clobs as ASCII strings.voidsetPrintDatagramAsList(boolean datagramAsList) Deprecated.Sets whether this printer renders datagrams as lists.voidsetPrintDecimalAsFloat(boolean decimalAsFloat) Deprecated.Sets whether this printer renders decimals as floats, thus using 'e' notation for all real values.voidsetPrintSexpAsList(boolean sexpAsList) Deprecated.Sets whether this printer renders sexps as lists.voidsetPrintStringAsJson(boolean stringAsJson) Deprecated.Sets whether this printer renders strings using JSON escapes.voidsetPrintSymbolAsString(boolean symbolAsString) Deprecated.Sets whether this printer renders symbols as strings.voidsetPrintTimestampAsMillis(boolean timestampAsMillis) Deprecated.Sets whether this printer renders timestamps as millisecond values.voidsetPrintTimestampAsString(boolean timestampAsString) Deprecated.Sets whether this printer renders timestamps as strings.voidsetPrintUntypedNulls(boolean untypedNulls) Deprecated.Sets whether this printer renders all null values asnull(i.e., the same as anIonNull).voidsetSkipAnnotations(boolean skip) Deprecated.Sets whether this printer skips (i.e., doesn't print) annotations.voidsetSkipSystemValues(boolean skip) Deprecated.Sets whether this printer skips (i.e., doesn't print) system IDs and local symbol tables.
-
Field Details
-
myOptions
Deprecated.
-
-
Constructor Details
-
Printer
public Printer()Deprecated. -
Printer
Deprecated.
-
-
Method Details
-
getSkipSystemValues
public boolean getSkipSystemValues()Deprecated.Indicates whether this printer skips (i.e., doesn't print) system IDs and local symbol tables. By default, this property isfalse. -
setSkipSystemValues
public void setSkipSystemValues(boolean skip) Deprecated.Sets whether this printer skips (i.e., doesn't print) system IDs and local symbol tables. By default, this property isfalse. -
getSkipAnnotations
public boolean getSkipAnnotations()Deprecated.Indicates whether this printer skips (i.e., doesn't print) annotations. By default, this property isfalse. -
setSkipAnnotations
public void setSkipAnnotations(boolean skip) Deprecated.Sets whether this printer skips (i.e., doesn't print) annotations. By default, this property isfalse. -
getPrintBlobAsString
public boolean getPrintBlobAsString()Deprecated.Indicates whether this printer renders blobs as Base64 strings. By default, this isfalse. -
setPrintBlobAsString
public void setPrintBlobAsString(boolean blobAsString) Deprecated.Sets whether this printer renders blobs as Base64 strings. By default, this isfalse. -
getPrintClobAsString
public boolean getPrintClobAsString()Deprecated.Indicates whether this printer renders clobs as ASCII strings. By default, this isfalse. -
setPrintClobAsString
public void setPrintClobAsString(boolean clobAsString) Deprecated.Sets whether this printer renders clobs as ASCII strings. By default, this isfalse. -
getPrintDatagramAsList
public boolean getPrintDatagramAsList()Deprecated.Indicates whether this printer renders datagrams as lists. By default, this property isfalse. -
setPrintDatagramAsList
public void setPrintDatagramAsList(boolean datagramAsList) Deprecated.Sets whether this printer renders datagrams as lists. By default, this property isfalse. -
getPrintDecimalAsFloat
public boolean getPrintDecimalAsFloat()Deprecated.Indicates whether this printer renders decimals as floats, thus using 'e' notation for all real values. By default, this isfalse. -
setPrintDecimalAsFloat
public void setPrintDecimalAsFloat(boolean decimalAsFloat) Deprecated.Sets whether this printer renders decimals as floats, thus using 'e' notation for all real values. By default, this isfalse. -
getPrintSexpAsList
public boolean getPrintSexpAsList()Deprecated.Indicates whether this printer renders sexps as lists. By default, this isfalse. -
setPrintSexpAsList
public void setPrintSexpAsList(boolean sexpAsList) Deprecated.Sets whether this printer renders sexps as lists. By default, this isfalse. -
getPrintStringAsJson
public boolean getPrintStringAsJson()Deprecated.Indicates whether this printer renders strings using JSON escapes. By default, this isfalse. -
setPrintStringAsJson
public void setPrintStringAsJson(boolean stringAsJson) Deprecated.Sets whether this printer renders strings using JSON escapes. By default, this isfalse. -
getPrintSymbolAsString
public boolean getPrintSymbolAsString()Deprecated.Indicates whether this printer renders symbols as strings. By default, this isfalse. -
setPrintSymbolAsString
public void setPrintSymbolAsString(boolean symbolAsString) Deprecated.Sets whether this printer renders symbols as strings. By default, this isfalse. -
getPrintTimestampAsMillis
public boolean getPrintTimestampAsMillis()Deprecated.Indicates whether this printer renders timestamps as millisecond values. By default, this isfalse. -
setPrintTimestampAsMillis
public void setPrintTimestampAsMillis(boolean timestampAsMillis) Deprecated.Sets whether this printer renders timestamps as millisecond values. By default, this isfalse. -
getPrintTimestampAsString
public boolean getPrintTimestampAsString()Deprecated.Indicates whether this printer renders timestamps as strings. By default, this isfalse. -
setPrintTimestampAsString
public void setPrintTimestampAsString(boolean timestampAsString) Deprecated.Sets whether this printer renders timestamps as strings. By default, this isfalse. -
getPrintUntypedNulls
public boolean getPrintUntypedNulls()Deprecated.Indicates whether this printer renders all null values asnull(i.e., the same as anIonNull). By default, this isfalse. -
setPrintUntypedNulls
public void setPrintUntypedNulls(boolean untypedNulls) Deprecated.Sets whether this printer renders all null values asnull(i.e., the same as anIonNull). By default, this isfalse. -
setJsonMode
public void setJsonMode()Deprecated.Configures this printer's options to render legal JSON text. The following options are modified so that:Printer.Options.blobAsStringistruePrinter.Options.clobAsStringistruePrinter.Options.datagramAsLististruePrinter.Options.decimalAsFloatistruePrinter.Options.sexpAsLististruePrinter.Options.skipAnnotationsistruePrinter.Options.skipSystemValuesistruePrinter.Options.stringAsJsonistruePrinter.Options.symbolAsStringistruePrinter.Options.timestampAsStringisfalsePrinter.Options.timestampAsMillisistruePrinter.Options.untypedNullsistrue
-
print
Deprecated.- Throws:
IOException
-
makeVisitor
Deprecated.Subclasses can override this if they wish to construct a specialization of thePrinter.PrinterVisitor.- Parameters:
options- is a fresh copy of the Printer's options instance, notnull.out- is notnull.- Returns:
- the visitor to invoke for printing.
-
IonValue.writeTo(IonWriter)instead.