Package com.rtfparserkit.utils
Class RtfDumpListener
- java.lang.Object
-
- com.rtfparserkit.utils.RtfDumpListener
-
- All Implemented Interfaces:
IRtfListener
public class RtfDumpListener extends java.lang.Object implements IRtfListener
Trivial class used to convert events generated by an RTF parser into an XML document. The primary purpose of this code is to debug the parser output, and provide a convenient method for comparing expected and actual parser behaviour in test cases.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.xml.stream.XMLStreamWriterwriter
-
Constructor Summary
Constructors Constructor Description RtfDumpListener(java.io.OutputStream stream)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprocessBinaryBytes(byte[] data)Write binary data as hex.voidprocessCharacterBytes(byte[] data)Write character bytes - note that we cheat, we just convert them directly to a string for output with no regard to the encoding.voidprocessCommand(Command command, int parameter, boolean hasParameter, boolean optional)Write a command tag.voidprocessDocumentEnd()Create the document trailer.voidprocessDocumentStart()Create the document header.voidprocessGroupEnd()Write a group end tag.voidprocessGroupStart()Write a group start tag.voidprocessString(java.lang.String string)Write string data.
-
-
-
Method Detail
-
processDocumentStart
public void processDocumentStart()
Create the document header.- Specified by:
processDocumentStartin interfaceIRtfListener
-
processDocumentEnd
public void processDocumentEnd()
Create the document trailer.- Specified by:
processDocumentEndin interfaceIRtfListener
-
processCharacterBytes
public void processCharacterBytes(byte[] data)
Write character bytes - note that we cheat, we just convert them directly to a string for output with no regard to the encoding.- Specified by:
processCharacterBytesin interfaceIRtfListener
-
processBinaryBytes
public void processBinaryBytes(byte[] data)
Write binary data as hex.- Specified by:
processBinaryBytesin interfaceIRtfListener
-
processGroupStart
public void processGroupStart()
Write a group start tag.- Specified by:
processGroupStartin interfaceIRtfListener
-
processGroupEnd
public void processGroupEnd()
Write a group end tag.- Specified by:
processGroupEndin interfaceIRtfListener
-
processCommand
public void processCommand(Command command, int parameter, boolean hasParameter, boolean optional)
Write a command tag.- Specified by:
processCommandin interfaceIRtfListener
-
processString
public void processString(java.lang.String string)
Write string data.- Specified by:
processStringin interfaceIRtfListener
-
-