private static class GeneratorUtils.MojoParserCallback
extends javax.swing.text.html.HTMLEditorKit.ParserCallback
Modifier and Type | Class and Description |
---|---|
(package private) class |
GeneratorUtils.MojoParserCallback.Counter
Holds the index of the current item in a numbered list.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
body
A flag whether the parser is currently in the body element.
|
private int |
depth
The current indentation depth for the output.
|
private java.util.Stack<GeneratorUtils.MojoParserCallback.Counter> |
numbering
A stack of
GeneratorUtils.MojoParserCallback.Counter objects corresponding to the nesting of (un-)ordered lists. |
private boolean |
pendingNewline
A flag whether an implicit line break is pending in the output buffer.
|
private int |
preformatted
A flag whether the parser is currently processing preformatted text, actually a counter to track nesting.
|
private java.lang.StringBuilder |
sb
The current buffer.
|
private boolean |
simpleTag
A flag whether we have just parsed a simple tag.
|
Constructor and Description |
---|
MojoParserCallback(java.lang.StringBuilder sb) |
Modifier and Type | Method and Description |
---|---|
void |
flush() |
private void |
flushPendingNewline()
Flushes a pending newline (if any).
|
void |
handleEndTag(javax.swing.text.html.HTML.Tag t,
int pos) |
void |
handleSimpleTag(javax.swing.text.html.HTML.Tag t,
javax.swing.text.MutableAttributeSet a,
int pos) |
void |
handleStartTag(javax.swing.text.html.HTML.Tag t,
javax.swing.text.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 |
text(java.lang.String data)
Writes the specified character data to the plain text output.
|
private boolean body
private int preformatted
private int depth
private java.util.Stack<GeneratorUtils.MojoParserCallback.Counter> numbering
GeneratorUtils.MojoParserCallback.Counter
objects corresponding to the nesting of (un-)ordered lists. A
null
element denotes an unordered list.private boolean pendingNewline
private boolean simpleTag
private final java.lang.StringBuilder sb
public MojoParserCallback(java.lang.StringBuilder sb)
sb
- not nullpublic void handleSimpleTag(javax.swing.text.html.HTML.Tag t, javax.swing.text.MutableAttributeSet a, int pos)
handleSimpleTag
in class javax.swing.text.html.HTMLEditorKit.ParserCallback
public void handleStartTag(javax.swing.text.html.HTML.Tag t, javax.swing.text.MutableAttributeSet a, int pos)
handleStartTag
in class javax.swing.text.html.HTMLEditorKit.ParserCallback
public void handleEndTag(javax.swing.text.html.HTML.Tag t, int pos)
handleEndTag
in class javax.swing.text.html.HTMLEditorKit.ParserCallback
public void handleText(char[] data, int pos)
handleText
in class javax.swing.text.html.HTMLEditorKit.ParserCallback
public void flush()
flush
in class javax.swing.text.html.HTMLEditorKit.ParserCallback
private void newline(boolean implicit)
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.private void flushPendingNewline()
private void text(java.lang.String data)
data
- The character data, must not be null
.