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 voidclose()Triggered when parsing is finished and the stream will be closed.voidcomment(java.lang.String comment)Triggered for comments that are found.voidendElement(java.lang.String curentTag, java.lang.String ns)Triggered on a closing tag.voidinit()Triggered when parsing has started.voidstartElement(java.lang.String currentTag, java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String ns)Triggered on an opening tag.voidtext(java.lang.String text)Called when text is encountered.voidunknownText(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:XMLParserListenerTriggered for text found outside root tag.- Specified by:
unknownTextin 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:XMLParserListenerTriggered on an opening tag.- Specified by:
startElementin 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:XMLParserListenerTriggered on a closing tag.- Specified by:
endElementin interfaceXMLParserListener- Parameters:
curentTag- the tagns- the namespace or empty String
-
comment
public void comment(java.lang.String comment)
Description copied from interface:XMLParserListenerTriggered for comments that are found.- Specified by:
commentin interfaceXMLParserListener- Parameters:
comment- the comment
-
init
public void init()
Description copied from interface:XMLParserListenerTriggered when parsing has started.- Specified by:
initin interfaceXMLParserListener
-
close
public void close()
Description copied from interface:XMLParserListenerTriggered when parsing is finished and the stream will be closed.- Specified by:
closein interfaceXMLParserListener
-
text
public void text(java.lang.String text)
Description copied from interface:XMLParserListenerCalled when text is encountered.- Specified by:
textin interfaceXMLParserListener- Parameters:
text- the text
-
-