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 javax.swing.text.html.HTMLEditorKit.ParserCallbackParserCallback implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classGeneratorUtils.MojoParserCallback.CounterHolds the index of the current item in a numbered list.
-
Field Summary
Fields Modifier and Type Field Description private booleanbodyA flag whether the parser is currently in the body element.private intdepthThe current indentation depth for the output.private java.util.Stack<GeneratorUtils.MojoParserCallback.Counter>numberingA stack ofGeneratorUtils.MojoParserCallback.Counterobjects corresponding to the nesting of (un-)ordered lists.private booleanpendingNewlineA flag whether an implicit line break is pending in the output buffer.private intpreformattedA flag whether the parser is currently processing preformatted text, actually a counter to track nesting.private java.lang.StringBuildersbThe current buffer.private booleansimpleTagA flag whether we have just parsed a simple tag.
-
Constructor Summary
Constructors Constructor Description MojoParserCallback(java.lang.StringBuilder sb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()private voidflushPendingNewline()Flushes a pending newline (if any).voidhandleEndTag(javax.swing.text.html.HTML.Tag t, int pos)voidhandleSimpleTag(javax.swing.text.html.HTML.Tag t, javax.swing.text.MutableAttributeSet a, int pos)voidhandleStartTag(javax.swing.text.html.HTML.Tag t, javax.swing.text.MutableAttributeSet a, int pos)voidhandleText(char[] data, int pos)private voidnewline(boolean implicit)Writes a line break to the plain text output.private voidtext(java.lang.String data)Writes the specified character data to the plain text output.
-
-
-
Field Detail
-
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
private java.util.Stack<GeneratorUtils.MojoParserCallback.Counter> numbering
A stack ofGeneratorUtils.MojoParserCallback.Counterobjects corresponding to the nesting of (un-)ordered lists. Anullelement 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 java.lang.StringBuilder sb
The current buffer.
-
-
Method Detail
-
handleSimpleTag
public void handleSimpleTag(javax.swing.text.html.HTML.Tag t, javax.swing.text.MutableAttributeSet a, int pos)- Overrides:
handleSimpleTagin classjavax.swing.text.html.HTMLEditorKit.ParserCallback
-
handleStartTag
public void handleStartTag(javax.swing.text.html.HTML.Tag t, javax.swing.text.MutableAttributeSet a, int pos)- Overrides:
handleStartTagin classjavax.swing.text.html.HTMLEditorKit.ParserCallback
-
handleEndTag
public void handleEndTag(javax.swing.text.html.HTML.Tag t, int pos)- Overrides:
handleEndTagin classjavax.swing.text.html.HTMLEditorKit.ParserCallback
-
handleText
public void handleText(char[] data, int pos)- Overrides:
handleTextin classjavax.swing.text.html.HTMLEditorKit.ParserCallback
-
flush
public void flush()
- Overrides:
flushin classjavax.swing.text.html.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(java.lang.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 benull.
-
-