us.bpsm.edn.printer
Interface Printer
-
public interface PrinterA Printer knows how to print edn values in edn syntax to an underlying stream of characters. UsePrintersto create newPrinters.Printer is mutable, stateful and should only be used form a single thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static interfacePrinter.Fn<E>
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Printerappend(char c)Append the given character to the underlying character stream.Printerappend(java.lang.CharSequence csq)Append the given characters to the underlying character stream.voidclose()Close the underlying sequence of characters.PrinterprintValue(java.lang.Object ednValue)PrintednValuein edn syntax to the underlying character stream.Printersoftspace()Increment the internal softspace counter.
-
-
-
Method Detail
-
printValue
Printer printValue(java.lang.Object ednValue)
PrintednValuein edn syntax to the underlying character stream.- Parameters:
ednValue- some value to be printed.- Returns:
- this Printer (for method chaining)
- Throws:
EdnException- if the printer does not know how to print values of the type ofednValue.
-
append
Printer append(java.lang.CharSequence csq)
Append the given characters to the underlying character stream.- Parameters:
csq- characters to append to the underlying stream.- Returns:
- this Printer (for method chaining)
-
append
Printer append(char c)
Append the given character to the underlying character stream.- Parameters:
c- character to append to the underlying stream.- Returns:
- this Printer (for method chaining)
-
softspace
Printer softspace()
Increment the internal softspace counter. Appending viaappend()will check this counter and insert a space if the counter is greater than 1 before resetting the counter to zero.This is used by implementations of
Printer.Fnto assure that spaces are inserted where they are necessary to enable unambiguous parsing. For example: between two symbols.- Returns:
- this Printer (for method chaining)
-
close
void close()
Close the underlying sequence of characters.- Throws:
EdnIOException- if the underlying sequence of characters isCloseableand the attempt to close it fails.
-
-
DMelt 3.0 © DataMelt by jWork.ORG