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.
IonWriter, IonTextWriterBuilder
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| public class | |
| public static class | Printer.
Deprecated
Use
IonValue#writeTo(IonWriter) instead.
|
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | _print(IonValue value, Printer.
References Deprecated
Printer.PrinterVisitor is deprecated or references (maybe indirectly) at least one deprecated element.
|
| public synchronized boolean | |
| public synchronized boolean | |
| public synchronized boolean | |
| public synchronized boolean | getPrintDecimalAsFloat()
Indicates whether this printer renders decimals as floats, thus using 'e' notation for all real values. |
| public synchronized boolean | |
| public synchronized boolean | |
| public synchronized boolean | |
| public synchronized boolean | |
| public synchronized boolean | |
| public synchronized boolean | getPrintUntypedNulls()
Indicates whether this printer renders all null values as |
| public synchronized boolean | |
| public synchronized boolean | getSkipSystemValues()
Indicates whether this printer skips (i.e., doesn't print) system IDs and local symbol tables. |
| protected Printer. | Returns: the visitor to invoke for printing.is a fresh copy of the Printer's options instance,
not options,null.is not out)null.
References Deprecated
Printer.PrinterVisitor is deprecated or references (maybe indirectly) at least one deprecated element.
Subclasses can override this if they wish to construct a specialization
of the |
| public void | |
| public synchronized void | |
| public synchronized void | setPrintBlobAsString(boolean blobAsString)
Sets whether this printer renders blobs as Base64 strings. |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | setPrintDecimalAsFloat(boolean decimalAsFloat)
Sets whether this printer renders decimals as floats, thus using 'e' notation for all real values. |
| public synchronized void | |
| public synchronized void | setPrintStringAsJson(boolean stringAsJson)
Sets whether this printer renders strings using JSON escapes. |
| public synchronized void | |
| public synchronized void | setPrintTimestampAsMillis(boolean timestampAsMillis)
Sets whether this printer renders timestamps as millisecond values. |
| public synchronized void | setPrintTimestampAsString(boolean timestampAsString)
Sets whether this printer renders timestamps as strings. |
| public synchronized void | setPrintUntypedNulls(boolean untypedNulls)
Sets whether this printer renders all null values as |
| public synchronized void | |
| public synchronized void | setSkipSystemValues(boolean skip)
Sets whether this printer skips (i.e., doesn't print) system IDs and local symbol tables. |
| myOptions | back to summary |
|---|---|
| protected Printer. | |
| Printer | back to summary |
|---|---|
| public Printer() | |
| Printer | back to summary |
|---|---|
| public Printer(Printer. | |
| _print | back to summary |
|---|---|
| private void _print(IonValue value, Printer. References Deprecated
See corresponding docs for further information. | |
| getPrintBlobAsString | back to summary |
|---|---|
| public synchronized boolean getPrintBlobAsString() Indicates whether this printer renders blobs as Base64 strings.
By default, this is | |
| getPrintClobAsString | back to summary |
|---|---|
| public synchronized boolean getPrintClobAsString() Indicates whether this printer renders clobs as ASCII strings.
By default, this is | |
| getPrintDatagramAsList | back to summary |
|---|---|
| public synchronized boolean getPrintDatagramAsList() Indicates whether this printer renders datagrams as lists.
By default, this property is | |
| getPrintDecimalAsFloat | back to summary |
|---|---|
| public synchronized boolean getPrintDecimalAsFloat() Indicates whether this printer renders decimals as floats, thus using 'e'
notation for all real values.
By default, this is | |
| getPrintSexpAsList | back to summary |
|---|---|
| public synchronized boolean getPrintSexpAsList() Indicates whether this printer renders sexps as lists.
By default, this is | |
| getPrintStringAsJson | back to summary |
|---|---|
| public synchronized boolean getPrintStringAsJson() Indicates whether this printer renders strings using JSON escapes.
By default, this is | |
| getPrintSymbolAsString | back to summary |
|---|---|
| public synchronized boolean getPrintSymbolAsString() Indicates whether this printer renders symbols as strings.
By default, this is | |
| getPrintTimestampAsMillis | back to summary |
|---|---|
| public synchronized boolean getPrintTimestampAsMillis() Indicates whether this printer renders timestamps as millisecond values.
By default, this is | |
| getPrintTimestampAsString | back to summary |
|---|---|
| public synchronized boolean getPrintTimestampAsString() Indicates whether this printer renders timestamps as strings.
By default, this is | |
| getPrintUntypedNulls | back to summary |
|---|---|
| public synchronized boolean getPrintUntypedNulls() Indicates whether this printer renders all null values as | |
| getSkipAnnotations | back to summary |
|---|---|
| public synchronized boolean getSkipAnnotations() Indicates whether this printer skips (i.e., doesn't print)
annotations.
By default, this property is | |
| getSkipSystemValues | back to summary |
|---|---|
| public synchronized boolean getSkipSystemValues() Indicates whether this printer skips (i.e., doesn't print)
system IDs and local symbol tables.
By default, this property is | |
| makeVisitor | back to summary |
|---|---|
| protected Printer. References Deprecated
See corresponding docs for further information. Subclasses can override this if they wish to construct a specialization
of the
| |
| back to summary | |
|---|---|
| public void print(IonValue value, Appendable out) throws IOException | |
| setJsonMode | back to summary |
|---|---|
| public synchronized void setJsonMode() Configures this printer's options to render legal JSON text. The following options are modified so that:
| |
| setPrintBlobAsString | back to summary |
|---|---|
| public synchronized void setPrintBlobAsString(boolean blobAsString) Sets whether this printer renders blobs as Base64 strings.
By default, this is | |
| setPrintClobAsString | back to summary |
|---|---|
| public synchronized void setPrintClobAsString(boolean clobAsString) Sets whether this printer renders clobs as ASCII strings.
By default, this is | |
| setPrintDatagramAsList | back to summary |
|---|---|
| public synchronized void setPrintDatagramAsList(boolean datagramAsList) Sets whether this printer renders datagrams as lists.
By default, this property is | |
| setPrintDecimalAsFloat | back to summary |
|---|---|
| public synchronized void setPrintDecimalAsFloat(boolean decimalAsFloat) Sets whether this printer renders decimals as floats, thus using 'e'
notation for all real values.
By default, this is | |
| setPrintSexpAsList | back to summary |
|---|---|
| public synchronized void setPrintSexpAsList(boolean sexpAsList) Sets whether this printer renders sexps as lists.
By default, this is | |
| setPrintStringAsJson | back to summary |
|---|---|
| public synchronized void setPrintStringAsJson(boolean stringAsJson) Sets whether this printer renders strings using JSON escapes.
By default, this is | |
| setPrintSymbolAsString | back to summary |
|---|---|
| public synchronized void setPrintSymbolAsString(boolean symbolAsString) Sets whether this printer renders symbols as strings.
By default, this is | |
| setPrintTimestampAsMillis | back to summary |
|---|---|
| public synchronized void setPrintTimestampAsMillis(boolean timestampAsMillis) Sets whether this printer renders timestamps as millisecond values.
By default, this is | |
| setPrintTimestampAsString | back to summary |
|---|---|
| public synchronized void setPrintTimestampAsString(boolean timestampAsString) Sets whether this printer renders timestamps as strings.
By default, this is | |
| setPrintUntypedNulls | back to summary |
|---|---|
| public synchronized void setPrintUntypedNulls(boolean untypedNulls) Sets whether this printer renders all null values as | |
| setSkipAnnotations | back to summary |
|---|---|
| public synchronized void setSkipAnnotations(boolean skip) Sets whether this printer skips (i.e., doesn't print)
annotations.
By default, this property is | |
| setSkipSystemValues | back to summary |
|---|---|
| public synchronized void setSkipSystemValues(boolean skip) Sets whether this printer skips (i.e., doesn't print)
system IDs and local symbol tables.
By default, this property is | |
| Modifier and Type | Field and Description |
|---|---|
| private final SymbolTable |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public SymbolTable |
| symbolTable | back to summary |
|---|---|
| private final SymbolTable symbolTable | |
| BasicSymbolTableProvider | back to summary |
|---|---|
| public BasicSymbolTableProvider(SymbolTable symbolTable) | |
| getSymbolTable | back to summary |
|---|---|
| public SymbolTable getSymbolTable() Implements com. | |
| Modifier and Type | Field and Description |
|---|---|
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean |
| Access | Constructor and Description |
|---|---|
| public |
| blobAsString | back to summary |
|---|---|
| public boolean blobAsString | |
| clobAsString | back to summary |
|---|---|
| public boolean clobAsString | |
| datagramAsList | back to summary |
|---|---|
| public boolean datagramAsList | |
| decimalAsFloat | back to summary |
|---|---|
| public boolean decimalAsFloat | |
| sexpAsList | back to summary |
|---|---|
| public boolean sexpAsList | |
| simplifySystemValues | back to summary |
|---|---|
| public boolean simplifySystemValues | |
| skipAnnotations | back to summary |
|---|---|
| public boolean skipAnnotations | |
| skipSystemValues | back to summary |
|---|---|
| public boolean skipSystemValues | |
| stringAsJson | back to summary |
|---|---|
| public boolean stringAsJson | |
| symbolAsString | back to summary |
|---|---|
| public boolean symbolAsString | |
| timestampAsMillis | back to summary |
|---|---|
| public boolean timestampAsMillis | |
| timestampAsString | back to summary |
|---|---|
| public boolean timestampAsString | |
| untypedNulls | back to summary |
|---|---|
| public boolean untypedNulls | |
| Options | back to summary |
|---|---|
| public Options() | |
| clone | back to summary |
|---|---|
| public Printer. Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by | |
Deprecated
Use IonValue#writeTo(IonWriter) instead.
| Modifier and Type | Field and Description |
|---|---|
| protected final Printer. | |
| protected final Appendable | |
| private boolean | myQuoteOperators
Should we quote operators at the current level of the hierarchy? |
| private _Private_IonValue. |
| Access | Constructor and Description |
|---|---|
| public |
| myOptions | back to summary |
|---|---|
| protected final Printer. | |
| myOut | back to summary |
|---|---|
| protected final Appendable myOut | |
| myQuoteOperators | back to summary |
|---|---|
| private boolean myQuoteOperators Should we quote operators at the current level of the hierarchy?
As we recurse down into containers, this value is pushed on the
stack by | |
| mySymbolTableProvider | back to summary |
|---|---|
| private _Private_IonValue. | |
| PrinterVisitor | back to summary |
|---|---|
| public PrinterVisitor(Printer. | |
| defaultVisit | back to summary |
|---|---|
| protected void defaultVisit(IonValue value) Overrides com. Doc from com. Default visitation behavior, called by all
This implementation always throws | |
| setSymbolTableProvider | back to summary |
|---|---|
| pack-priv void setSymbolTableProvider(_Private_IonValue. | |
| simplify | back to summary |
|---|---|
| private final IonValue simplify(IonValue child, SymbolTable previous_symbols) | |
| symbol_table_struct_has_imports | back to summary |
|---|---|
| private static final boolean symbol_table_struct_has_imports(IonValue child) | |
| visit | back to summary |
|---|---|
| public void visit(IonBlob value) throws IOException Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonBool value) throws IOException Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonClob value) throws IOException Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonDatagram value) throws IOException, Exception Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonDecimal value) throws IOException Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonFloat value) throws IOException Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonInt value) throws IOException Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonList value) throws IOException, Exception Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonNull value) throws IOException Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonSexp value) throws IOException, Exception Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonString value) throws IOException Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonStruct value) throws IOException, Exception Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonSymbol value) throws IOException Overrides com. Implements com.
| |
| visit | back to summary |
|---|---|
| public void visit(IonTimestamp value) throws IOException Overrides com. Implements com.
| |
| writeAnnotations | back to summary |
|---|---|
| public void writeAnnotations(IonValue value) throws IOException | |
| writeChild | back to summary |
|---|---|
| protected void writeChild(IonValue value, boolean quoteOperators) throws Exception Recurse down into a container, we push the current value of
| |
| writeNull | back to summary |
|---|---|
| public void writeNull(String type) throws IOException | |
| writeSequenceContent | back to summary |
|---|---|
| public void writeSequenceContent(IonSequence value, boolean quoteOperators, char open, char separator, char close) throws IOException, Exception | |
| writeString | back to summary |
|---|---|
public void writeString(String text) throws IOException
| |
| writeSymbol | back to summary |
|---|---|
| public void writeSymbol(String text) throws IOException | |
| writeSymbolToken | back to summary |
|---|---|
| public void writeSymbolToken(SymbolToken sym) throws IOException | |