Class SimpleIndenter

  • All Implemented Interfaces:
    Indenter

    public class SimpleIndenter
    extends java.lang.Object
    implements Indenter
    A simple indenter that takes a String for before and after on the opening and closing tag.

    EXPERIMENTAL MAY CHANGE

    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleIndenter​(java.lang.String startTagNewLine, java.lang.String startTagIndent, java.lang.String endTagNewLine, java.lang.String endTagIndent)
      EXPERIMENTAL MAY CHANGE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void indentTag​(java.lang.Appendable a, int innerDepth, int outerDepth, Indenter.TagIndentSpot spot, java.lang.String tag, MarkupBuilder.TagClosingPolicy p, boolean empty)
      Called by the builder to provide whitespace decoration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • startTagNewLine

        private java.lang.String startTagNewLine
      • startTagIndent

        private java.lang.String startTagIndent
      • endTagNewLine

        private java.lang.String endTagNewLine
      • endTagIndent

        private java.lang.String endTagIndent
    • Constructor Detail

      • SimpleIndenter

        public SimpleIndenter​(java.lang.String startTagNewLine,
                              java.lang.String startTagIndent,
                              java.lang.String endTagNewLine,
                              java.lang.String endTagIndent)
        EXPERIMENTAL MAY CHANGE
        Parameters:
        startTagNewLine - null not recommended.
        startTagIndent - null not recommended.
        endTagNewLine - null not recommended.
        endTagIndent - null not recommended.
    • Method Detail

      • indentTag

        public void indentTag​(java.lang.Appendable a,
                              int innerDepth,
                              int outerDepth,
                              Indenter.TagIndentSpot spot,
                              java.lang.String tag,
                              MarkupBuilder.TagClosingPolicy p,
                              boolean empty)
                       throws java.io.IOException
        Called by the builder to provide whitespace decoration. The arguments provides context of what tag, kind of tag and closing policy etc.

        EXPERIMENTAL MAY CHANGE

        Specified by:
        indentTag in interface Indenter
        Parameters:
        a - writer like object where indenting decoration is to be applied.
        innerDepth - current indent depth inside the current builder.
        outerDepth - starting depth based on the outside builder if there is one. Usually this is zero.
        spot - current position that white space is to be applied.
        tag - the tag to be indented, not null.
        p - closing policy for the tag to be indented.
        empty - if the tag is empty.
        Throws:
        java.io.IOException
        See Also:
        MarkupBuilder.indent(Indenter)