Class Printer

java.lang.Object
com.amazon.ion.util.Printer

@Deprecated public class Printer extends Object
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:
  • Field Details

  • Constructor Details

    • Printer

      public Printer()
      Deprecated.
    • Printer

      public Printer(Printer.Options options)
      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 is false.
    • 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 is false.
    • getSkipAnnotations

      public boolean getSkipAnnotations()
      Deprecated.
      Indicates whether this printer skips (i.e., doesn't print) annotations. By default, this property is false.
    • setSkipAnnotations

      public void setSkipAnnotations(boolean skip)
      Deprecated.
      Sets whether this printer skips (i.e., doesn't print) annotations. By default, this property is false.
    • getPrintBlobAsString

      public boolean getPrintBlobAsString()
      Deprecated.
      Indicates whether this printer renders blobs as Base64 strings. By default, this is false.
    • setPrintBlobAsString

      public void setPrintBlobAsString(boolean blobAsString)
      Deprecated.
      Sets whether this printer renders blobs as Base64 strings. By default, this is false.
    • getPrintClobAsString

      public boolean getPrintClobAsString()
      Deprecated.
      Indicates whether this printer renders clobs as ASCII strings. By default, this is false.
    • setPrintClobAsString

      public void setPrintClobAsString(boolean clobAsString)
      Deprecated.
      Sets whether this printer renders clobs as ASCII strings. By default, this is false.
    • getPrintDatagramAsList

      public boolean getPrintDatagramAsList()
      Deprecated.
      Indicates whether this printer renders datagrams as lists. By default, this property is false.
    • setPrintDatagramAsList

      public void setPrintDatagramAsList(boolean datagramAsList)
      Deprecated.
      Sets whether this printer renders datagrams as lists. By default, this property is false.
    • getPrintDecimalAsFloat

      public boolean getPrintDecimalAsFloat()
      Deprecated.
      Indicates whether this printer renders decimals as floats, thus using 'e' notation for all real values. By default, this is false.
    • 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 is false.
    • getPrintSexpAsList

      public boolean getPrintSexpAsList()
      Deprecated.
      Indicates whether this printer renders sexps as lists. By default, this is false.
    • setPrintSexpAsList

      public void setPrintSexpAsList(boolean sexpAsList)
      Deprecated.
      Sets whether this printer renders sexps as lists. By default, this is false.
    • getPrintStringAsJson

      public boolean getPrintStringAsJson()
      Deprecated.
      Indicates whether this printer renders strings using JSON escapes. By default, this is false.
    • setPrintStringAsJson

      public void setPrintStringAsJson(boolean stringAsJson)
      Deprecated.
      Sets whether this printer renders strings using JSON escapes. By default, this is false.
    • getPrintSymbolAsString

      public boolean getPrintSymbolAsString()
      Deprecated.
      Indicates whether this printer renders symbols as strings. By default, this is false.
    • setPrintSymbolAsString

      public void setPrintSymbolAsString(boolean symbolAsString)
      Deprecated.
      Sets whether this printer renders symbols as strings. By default, this is false.
    • getPrintTimestampAsMillis

      public boolean getPrintTimestampAsMillis()
      Deprecated.
      Indicates whether this printer renders timestamps as millisecond values. By default, this is false.
    • setPrintTimestampAsMillis

      public void setPrintTimestampAsMillis(boolean timestampAsMillis)
      Deprecated.
      Sets whether this printer renders timestamps as millisecond values. By default, this is false.
    • getPrintTimestampAsString

      public boolean getPrintTimestampAsString()
      Deprecated.
      Indicates whether this printer renders timestamps as strings. By default, this is false.
    • setPrintTimestampAsString

      public void setPrintTimestampAsString(boolean timestampAsString)
      Deprecated.
      Sets whether this printer renders timestamps as strings. By default, this is false.
    • getPrintUntypedNulls

      public boolean getPrintUntypedNulls()
      Deprecated.
      Indicates whether this printer renders all null values as null (i.e., the same as an IonNull). By default, this is false.
    • setPrintUntypedNulls

      public void setPrintUntypedNulls(boolean untypedNulls)
      Deprecated.
      Sets whether this printer renders all null values as null (i.e., the same as an IonNull). By default, this is false.
    • setJsonMode

      public void setJsonMode()
      Deprecated.
      Configures this printer's options to render legal JSON text. The following options are modified so that: All other options are left as is.
    • print

      public void print(IonValue value, Appendable out) throws IOException
      Deprecated.
      Throws:
      IOException
    • makeVisitor

      protected Printer.PrinterVisitor makeVisitor(Printer.Options options, Appendable out)
      Deprecated.
      Subclasses can override this if they wish to construct a specialization of the Printer.PrinterVisitor.
      Parameters:
      options - is a fresh copy of the Printer's options instance, not null.
      out - is not null.
      Returns:
      the visitor to invoke for printing.