public class ParserListenerWriter extends Object implements XMLParserListener
Constructor and Description |
---|
ParserListenerWriter(Appender writer)
Construct a new ParserListenerWriter with the given appender and default formatted to true;
|
ParserListenerWriter(Appender writer, boolean formatted) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Triggered when parsing is finished and the stream will be closed.
|
void |
comment(String comment)
Triggered for comments that are found.
|
void |
endElement(String curentTag, String ns)
Triggered on a closing tag.
|
void |
init()
Triggered when parsing has started.
|
void |
startElement(String currentTag, Map<String,String> attributes, String ns)
Triggered on an opening tag.
|
void |
text(String text)
Called when text is encountered.
|
void |
unknownText(String string)
Triggered for text found outside root tag.
|
public ParserListenerWriter(Appender writer, boolean formatted)
writer
- the appender
formatted
- true if output should be formatted
public ParserListenerWriter(Appender writer)
writer
- the appender
public void unknownText(String string)
XMLParserListener
unknownText
in interface XMLParserListener
string
- the text
public void startElement(String currentTag, Map<String,String> attributes, String ns)
XMLParserListener
startElement
in interface XMLParserListener
currentTag
- the tag of the element
attributes
- the attributes found on the tag
ns
- the namespace or empty String
public void endElement(String curentTag, String ns)
XMLParserListener
endElement
in interface XMLParserListener
curentTag
- the tag
ns
- the namespace or empty String
public void comment(String comment)
XMLParserListener
comment
in interface XMLParserListener
comment
- the comment
public void init()
XMLParserListener
init
in interface XMLParserListener
public void close()
XMLParserListener
close
in interface XMLParserListener
public void text(String text)
XMLParserListener
text
in interface XMLParserListener
text
- the text
Copyright © 1998–2017. All rights reserved.