Class GeneratorUtils.MojoParserCallback
java.lang.Object
javax.swing.text.html.HTMLEditorKit.ParserCallback
org.apache.maven.tools.plugin.generator.GeneratorUtils.MojoParserCallback
- Enclosing class:
GeneratorUtils
ParserCallback implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
Holds the index of the current item in a numbered list. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
A flag whether the parser is currently in the body element.private int
The current indentation depth for the output.A stack ofGeneratorUtils.MojoParserCallback.Counter
objects corresponding to the nesting of (un-)ordered lists.private boolean
A flag whether an implicit line break is pending in the output buffer.private int
A flag whether the parser is currently processing preformatted text, actually a counter to track nesting.private final StringBuilder
The current buffer.private boolean
A flag whether we have just parsed a simple tag.Fields inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
IMPLIED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
private void
Flushes a pending newline (if any).void
handleEndTag
(HTML.Tag t, int pos) void
handleSimpleTag
(HTML.Tag t, MutableAttributeSet a, int pos) void
handleStartTag
(HTML.Tag t, MutableAttributeSet a, int pos) void
handleText
(char[] data, int pos) private void
newline
(boolean implicit) Writes a line break to the plain text output.private void
Writes the specified character data to the plain text output.Methods inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
handleComment, handleEndOfLineString, handleError
-
Field Details
-
body
private boolean bodyA flag whether the parser is currently in the body element. -
preformatted
private int preformattedA flag whether the parser is currently processing preformatted text, actually a counter to track nesting. -
depth
private int depthThe current indentation depth for the output. -
numbering
A stack ofGeneratorUtils.MojoParserCallback.Counter
objects corresponding to the nesting of (un-)ordered lists. Anull
element denotes an unordered list. -
pendingNewline
private boolean pendingNewlineA 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 simpleTagA flag whether we have just parsed a simple tag. -
sb
The current buffer.
-
-
Constructor Details
-
MojoParserCallback
MojoParserCallback(StringBuilder sb) - Parameters:
sb
- not null
-
-
Method Details
-
handleSimpleTag
- Overrides:
handleSimpleTag
in classHTMLEditorKit.ParserCallback
-
handleStartTag
- Overrides:
handleStartTag
in classHTMLEditorKit.ParserCallback
-
handleEndTag
- Overrides:
handleEndTag
in classHTMLEditorKit.ParserCallback
-
handleText
public void handleText(char[] data, int pos) - Overrides:
handleText
in classHTMLEditorKit.ParserCallback
-
flush
public void flush()- Overrides:
flush
in classHTMLEditorKit.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
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
.
-