Package com.itextpdf.tool.xml.parser.io
Class ParserListenerWriter
- java.lang.Object
-
- com.itextpdf.tool.xml.parser.io.ParserListenerWriter
-
- All Implemented Interfaces:
XMLParserListener
public class ParserListenerWriter extends java.lang.Object implements XMLParserListener
Debugging util.
-
-
Constructor Summary
Constructors Constructor Description ParserListenerWriter(Appender writer)
Construct a new ParserListenerWriter with the given appender and default formatted to true;ParserListenerWriter(Appender writer, boolean formatted)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Triggered when parsing is finished and the stream will be closed.void
comment(java.lang.String comment)
Triggered for comments that are found.void
endElement(java.lang.String curentTag, java.lang.String ns)
Triggered on a closing tag.void
init()
Triggered when parsing has started.void
startElement(java.lang.String currentTag, java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String ns)
Triggered on an opening tag.void
text(java.lang.String text)
Called when text is encountered.void
unknownText(java.lang.String string)
Triggered for text found outside root tag.
-
-
-
Field Detail
-
writer
private final Appender writer
-
formatted
private final boolean formatted
-
-
Constructor Detail
-
ParserListenerWriter
public ParserListenerWriter(Appender writer, boolean formatted)
- Parameters:
writer
- the appenderformatted
- true if output should be formatted
-
ParserListenerWriter
public ParserListenerWriter(Appender writer)
Construct a new ParserListenerWriter with the given appender and default formatted to true;- Parameters:
writer
- the appender
-
-
Method Detail
-
unknownText
public void unknownText(java.lang.String string)
Description copied from interface:XMLParserListener
Triggered for text found outside root tag.- Specified by:
unknownText
in interfaceXMLParserListener
- Parameters:
string
- the text
-
startElement
public void startElement(java.lang.String currentTag, java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String ns)
Description copied from interface:XMLParserListener
Triggered on an opening tag.- Specified by:
startElement
in interfaceXMLParserListener
- Parameters:
currentTag
- the tag of the elementattributes
- the attributes found on the tagns
- the namespace or empty String
-
endElement
public void endElement(java.lang.String curentTag, java.lang.String ns)
Description copied from interface:XMLParserListener
Triggered on a closing tag.- Specified by:
endElement
in interfaceXMLParserListener
- Parameters:
curentTag
- the tagns
- the namespace or empty String
-
comment
public void comment(java.lang.String comment)
Description copied from interface:XMLParserListener
Triggered for comments that are found.- Specified by:
comment
in interfaceXMLParserListener
- Parameters:
comment
- the comment
-
init
public void init()
Description copied from interface:XMLParserListener
Triggered when parsing has started.- Specified by:
init
in interfaceXMLParserListener
-
close
public void close()
Description copied from interface:XMLParserListener
Triggered when parsing is finished and the stream will be closed.- Specified by:
close
in interfaceXMLParserListener
-
text
public void text(java.lang.String text)
Description copied from interface:XMLParserListener
Called when text is encountered.- Specified by:
text
in interfaceXMLParserListener
- Parameters:
text
- the text
-
-