Class GeneratorUtils.MojoParserCallback

java.lang.Object
javax.swing.text.html.HTMLEditorKit.ParserCallback
org.apache.maven.tools.plugin.generator.GeneratorUtils.MojoParserCallback
Enclosing class:
GeneratorUtils

private static class GeneratorUtils.MojoParserCallback extends HTMLEditorKit.ParserCallback
ParserCallback implementation.
  • Field Details

    • body

      private boolean body
      A flag whether the parser is currently in the body element.
    • preformatted

      private int preformatted
      A flag whether the parser is currently processing preformatted text, actually a counter to track nesting.
    • depth

      private int depth
      The current indentation depth for the output.
    • numbering

      A stack of GeneratorUtils.MojoParserCallback.Counter objects corresponding to the nesting of (un-)ordered lists. A null element denotes an unordered list.
    • pendingNewline

      private boolean pendingNewline
      A flag whether an implicit line break is pending in the output buffer. This flag is used to postpone the output of implicit line breaks until we are sure that are not to be merged with other implicit line breaks.
    • simpleTag

      private boolean simpleTag
      A flag whether we have just parsed a simple tag.
    • sb

      private final StringBuilder sb
      The current buffer.
  • Constructor Details

    • MojoParserCallback

      MojoParserCallback(StringBuilder sb)
      Parameters:
      sb - not null
  • Method Details

    • handleSimpleTag

      public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos)
      Overrides:
      handleSimpleTag in class HTMLEditorKit.ParserCallback
    • handleStartTag

      public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos)
      Overrides:
      handleStartTag in class HTMLEditorKit.ParserCallback
    • handleEndTag

      public void handleEndTag(HTML.Tag t, int pos)
      Overrides:
      handleEndTag in class HTMLEditorKit.ParserCallback
    • handleText

      public void handleText(char[] data, int pos)
      Overrides:
      handleText in class HTMLEditorKit.ParserCallback
    • flush

      public void flush()
      Overrides:
      flush in class HTMLEditorKit.ParserCallback
    • newline

      private void newline(boolean implicit)
      Writes a line break to the plain text output.
      Parameters:
      implicit - A flag whether this is an explicit or implicit line break. Explicit line breaks are always written to the output whereas consecutive implicit line breaks are merged into a single line break.
    • flushPendingNewline

      private void flushPendingNewline()
      Flushes a pending newline (if any).
    • text

      private void text(String data)
      Writes the specified character data to the plain text output. If the last output was a line break, the character data will automatically be prefixed with the current indent.
      Parameters:
      data - The character data, must not be null.