Package gnu.lists

Class PrintConsumer

    • Field Detail

      • skipping

        protected boolean skipping
    • Constructor Detail

      • PrintConsumer

        public PrintConsumer​(Writer out)
      • PrintConsumer

        public PrintConsumer​(Writer out,
                             boolean autoFlush)
      • PrintConsumer

        public PrintConsumer​(Consumer out,
                             boolean autoFlush)
      • PrintConsumer

        public PrintConsumer​(OutputStream out,
                             boolean autoFlush)
    • Method Detail

      • getPrettyWriter

        public gnu.kawa.io.PrettyWriter getPrettyWriter()
      • startNumber

        protected void startNumber()
      • endNumber

        protected void endNumber()
      • freshLine

        public void freshLine()
      • writeSpace

        public void writeSpace​(int kind)
      • writeBreak

        public void writeBreak​(int kind)
      • writeBreakFill

        public static void writeBreakFill​(Consumer out)
      • writeBreakFill

        public void writeBreakFill()
      • writeSpaceFill

        public static void writeSpaceFill​(Consumer out)
      • writeSpaceFill

        public void writeSpaceFill()
      • writeSpaceLinear

        public void writeSpaceLinear()
      • writeBreakLinear

        public void writeBreakLinear()
        Write a new-line iff the containing section cannot be printed on one line. Either all linear-style newlines in a logical block becomes spaces (if it all fits in a line), or none of them do.
      • setIndentation

        public void setIndentation​(int amount,
                                   boolean current)
      • isDomTerm

        public boolean isDomTerm()
      • writeShowHideButton

        public void writeShowHideButton​(boolean show)
        If supported (i.e. on DomTerm), "print" a show/hide button.
      • startHiderSection

        public void startHiderSection​(boolean show)
        Start section controled by a show/hide button. Must be properly nested within/around logical blocks. Current only supported on DomTerm.
      • endHiderSection

        public void endHiderSection()
        End section controled by a show/hide button
      • startLogicalBlock

        public static void startLogicalBlock​(String prefix,
                                             boolean perLine,
                                             String suffix,
                                             Consumer out)
      • startLogicalBlock

        public void startLogicalBlock​(String prefix,
                                      boolean perLine,
                                      String suffix)
      • startLogicalBlock

        public void startLogicalBlock​(String prefix,
                                      String suffix,
                                      int indent)
      • endLogicalBlock

        public static void endLogicalBlock​(String suffix,
                                           Consumer out)
      • endLogicalBlock

        public void endLogicalBlock​(String suffix)
      • beforeContent

        protected void beforeContent()
      • beforeNode

        protected void beforeNode()
      • writeWordStart

        public void writeWordStart()
      • writeWordEnd

        public void writeWordEnd()
      • clearWordEnd

        protected void clearWordEnd()
      • writeBoolean

        public void writeBoolean​(boolean v)
        Specified by:
        writeBoolean in interface Consumer
      • writeFloat

        public void writeFloat​(float v)
        Specified by:
        writeFloat in interface Consumer
      • writeDouble

        public void writeDouble​(double v)
        Specified by:
        writeDouble in interface Consumer
      • writeInt

        public void writeInt​(int v)
        Specified by:
        writeInt in interface Consumer
      • writeLong

        public void writeLong​(long v)
        Specified by:
        writeLong in interface Consumer
      • startAttribute

        public void startAttribute​(Object attrType)
        Description copied from interface: Consumer
        Write a attribute for the current element. This is only allowed immediately after a startElement.
        Specified by:
        startAttribute in interface Consumer
      • endAttribute

        public void endAttribute()
        Description copied from interface: Consumer
        End of an attribute or end of an actual parameter. The former use matches a startAttribute; the latter may not, and can be used to separate parameters in a parameter list. This double duty suggsts the method should at least be re-named.
        Specified by:
        endAttribute in interface Consumer
      • writeComment

        public void writeComment​(char[] chars,
                                 int offset,
                                 int length)
        Specified by:
        writeComment in interface XConsumer
      • writeCDATA

        public void writeCDATA​(char[] chars,
                               int offset,
                               int length)
        Specified by:
        writeCDATA in interface XConsumer
      • writeRaw

        protected void writeRaw​(int v)
      • writeRaw

        protected void writeRaw​(String str)
      • writeRaw

        protected void writeRaw​(String str,
                                int start,
                                int length)
      • writeRaw

        protected void writeRaw​(char[] chars,
                                int start,
                                int length)
      • ignoring

        public boolean ignoring()
        Description copied from interface: Consumer
        True if consumer is ignoring rest of element. The producer can use this information to skip ahead.
        Specified by:
        ignoring in interface Consumer