public static class Printer.PrinterVisitor extends AbstractValueVisitor
Modifier and Type | Field and Description |
---|---|
protected Printer.Options |
myOptions |
protected Appendable |
myOut |
Constructor and Description |
---|
PrinterVisitor(Printer.Options options,
Appendable out) |
Modifier and Type | Method and Description |
---|---|
protected void |
defaultVisit(IonValue value)
Default visitation behavior, called by all
visit methods
in AbstractValueVisitor . |
void |
visit(IonBlob value) |
void |
visit(IonBool value) |
void |
visit(IonClob value) |
void |
visit(IonDatagram value) |
void |
visit(IonDecimal value) |
void |
visit(IonFloat value) |
void |
visit(IonInt value) |
void |
visit(IonList value) |
void |
visit(IonNull value) |
void |
visit(IonSexp value) |
void |
visit(IonString value) |
void |
visit(IonStruct value) |
void |
visit(IonSymbol value) |
void |
visit(IonTimestamp value) |
void |
writeAnnotations(IonValue value) |
protected void |
writeChild(IonValue value,
boolean quoteOperators)
Recurse down into a container, we push the current value of
myQuoteOperators onto the stack and replace it with
the given value. |
void |
writeNull(String type) |
void |
writeSequenceContent(IonSequence value,
boolean quoteOperators,
char open,
char separator,
char close) |
void |
writeString(String text) |
void |
writeSymbol(String text) |
void |
writeSymbolToken(SymbolToken sym) |
protected final Printer.Options myOptions
protected final Appendable myOut
public PrinterVisitor(Printer.Options options, Appendable out)
protected void writeChild(IonValue value, boolean quoteOperators) throws Exception
myQuoteOperators
onto the stack and replace it with
the given value.value
- quoteOperators
- replaces the current value of
myQuoteOperators
during the recursive visitation.Exception
- propagated from visitation of value
.NullPointerException
- if value
is null.public void writeAnnotations(IonValue value) throws IOException
IOException
public void writeNull(String type) throws IOException
IOException
public void writeSequenceContent(IonSequence value, boolean quoteOperators, char open, char separator, char close) throws IOException, Exception
IOException
Exception
public void writeSymbolToken(SymbolToken sym) throws IOException
IOException
public void writeSymbol(String text) throws IOException
IOException
public void writeString(String text) throws IOException
text
- may be nullIOException
protected void defaultVisit(IonValue value)
AbstractValueVisitor
visit
methods
in AbstractValueVisitor
. Subclasses should override this unless
they override all visit
methods.
This implementation always throws UnsupportedOperationException
.
defaultVisit
in class AbstractValueVisitor
value
- the value to visit.public void visit(IonBlob value) throws IOException
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
public void visit(IonBool value) throws IOException
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
public void visit(IonClob value) throws IOException
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
public void visit(IonDatagram value) throws IOException, Exception
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
Exception
public void visit(IonDecimal value) throws IOException
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
public void visit(IonFloat value) throws IOException
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
public void visit(IonInt value) throws IOException
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
public void visit(IonList value) throws IOException, Exception
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
Exception
public void visit(IonNull value) throws IOException
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
public void visit(IonSexp value) throws IOException, Exception
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
Exception
public void visit(IonString value) throws IOException
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
public void visit(IonStruct value) throws IOException, Exception
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
Exception
public void visit(IonSymbol value) throws IOException
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException
public void visit(IonTimestamp value) throws IOException
visit
in interface ValueVisitor
visit
in class AbstractValueVisitor
IOException