Documentation of 'us.bpsm.edn.printer.Printers' Java class
Printers
us.bpsm.edn.printer

Class Printers



  • public class Printers
    extends java.lang.Object
    Factory for creating Printers and related Objects.
    • Method Detail

      • newPrinter

        public static Printer newPrinter(java.lang.Appendable out)
        Return a new Printer with the default printing protocol. Everything the printer prints will be appended to out. Printer.close() will close out, provided out implements Closeable.
        Parameters:
        out - to which values will be printed. Never null.
        Returns:
        a Printer with default configuration, never null.
      • printString

        public static java.lang.String printString(java.lang.Object ednValue)
        Print ednValue to a new String using the default printing protocol.
        Parameters:
        ednValue - the value to be returned as a String in edn syntax.
        Returns:
        A string in edn syntax. Not null, not empty.
      • printString

        public static java.lang.String printString(Protocol<Printer.Fn<?>> fns,
                                                   java.lang.Object ednValue)
        Print ednValue to a new String using the printing protocol given as fns.
        Parameters:
        fns - a Protocol which knows how to print all the classes of objects that we'll be asking our Printer to print. Never null. Never null.
        ednValue - the value to be returned as a String in edn syntax.
        Returns:
        A string in edn syntax. Not null, not empty.
      • newPrinter

        public static Printer newPrinter(Protocol<Printer.Fn<?>> fns,
                                         java.lang.Appendable out)
        Return a new Printer with the printing protocol given as fns. Everything the printer prints will be appended to writer. Printer.close() will close out, if out implements Closeable.
        Parameters:
        fns - a Protocol which knows how to print all the classes of objects that we'll be asking our Printer to print. Never null. Never null.
        out - to which values will be printed. Never null.
        Returns:
        a Printer, never null.
      • defaultProtocolBuilder

        public static Protocol.Builder<Printer.Fn<?>> defaultProtocolBuilder()
        Returns a Protocol.Builder preconfigured knowing how to print classes known to end-java:
        • BigDecimal
        • BigInteger
        • Boolean
        • Byte (as an integer)
        • CharSequence (as a string literal)
        • Character (as a character literal)
        • Date (as #inst)
        • Double
        • Float
        • GregorianCalendar (as #inst)
        • Integer
        • Keyword
        • List
        • Long
        • Map
        • Set
        • Short (as an integer)
        • Symbol
        • Tag
        • TaggedValue
        • Timestamp (as #inst)
        • UUID (as #uuid)
      • defaultPrinterProtocol

        public static Protocol<Printer.Fn<?>> defaultPrinterProtocol()
        Return the default printer Protocol. This is equivalent to defaultProtocolBuilder().build().
        Returns:
        the default printing Protocol, never null.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.