net.sourceforge.rtf.parser
Class AbstractDefaultRTFParser

java.lang.Object
  extended by net.sourceforge.rtf.parser.AbstractCoreRTFParser
      extended by net.sourceforge.rtf.parser.AbstractDefaultRTFParser
Direct Known Subclasses:
RTFDocumentHandler

public abstract class AbstractDefaultRTFParser
extends AbstractCoreRTFParser

Default RTF parser which is able to parse RTF Stream (Reader) character by character. It launch events on special RTF keywords :

To use this abstract class, you must implement events startGroup, endGroup, startRow, startRow, endRow, startField, startBookmark, endBookmark, startPage and handleText.

Version:
1.0.0
Author:
Angelo ZERR
See Also:
AbstractCoreRTFParser

Constructor Summary
AbstractDefaultRTFParser()
           
 
Method Summary
protected abstract  void endBookmark(java.lang.String content)
          Event end bookmark.
protected abstract  void endRow(java.lang.String content)
          Event end row.
protected abstract  void endUserProperty(java.lang.String content)
          Event end user property.
protected  void handleKeyword(java.lang.String content)
          Manage events RTF keyword (Row, Field, Bookmark, Page and other RTF content).
protected abstract  void handleText(java.lang.String content)
          Event other RTF content.
protected abstract  void inTable(java.lang.String content)
          Event current paragraph is in table.
protected abstract  void startBookmark(java.lang.String content)
          Event start bookmark.
protected abstract  void startField(java.lang.String content)
          Event start field.
protected abstract  void startPage(java.lang.String content)
          Event page break.
protected abstract  void startRow(java.lang.String content)
          Event start row.
protected abstract  void startUserProperty(java.lang.String content)
          Event start user property.
 
Methods inherited from class net.sourceforge.rtf.parser.AbstractCoreRTFParser
endGroup, getLevel, parse, parse, startGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDefaultRTFParser

public AbstractDefaultRTFParser()
Method Detail

handleKeyword

protected void handleKeyword(java.lang.String content)
                      throws java.io.IOException
Manage events RTF keyword (Row, Field, Bookmark, Page and other RTF content).

Specified by:
handleKeyword in class AbstractCoreRTFParser
Parameters:
content - RTF keyword.
Throws:
java.io.IOException

startRow

protected abstract void startRow(java.lang.String content)
                          throws java.io.IOException
Event start row. This event is launched when RTF keyword \trowd is found.

Parameters:
content - RTF start row keyword \trowd.
Throws:
java.io.IOException

endRow

protected abstract void endRow(java.lang.String content)
                        throws java.io.IOException
Event end row. This event is launched when RTF keyword \row is found.

Parameters:
content - RTF end row keyword \row.
Throws:
java.io.IOException

inTable

protected abstract void inTable(java.lang.String content)
                         throws java.io.IOException
Event current paragraph is in table. This event helps to locate start of rows, which does not begin with \trowd (it only appears at the end of row)

Parameters:
content - RTF in table keyword \intbl.
Throws:
java.io.IOException

startField

protected abstract void startField(java.lang.String content)
                            throws java.io.IOException
Event start field. This event is launched when RTF keyword \field is found.

Parameters:
content - RTF end row keyword \field.
Throws:
java.io.IOException

startBookmark

protected abstract void startBookmark(java.lang.String content)
                               throws java.io.IOException
Event start bookmark. This event is launched when RTF keyword \bkmkstart is found.

Parameters:
content - RTF start bookmark keyword \bkmkstart.
Throws:
java.io.IOException

endBookmark

protected abstract void endBookmark(java.lang.String content)
                             throws java.io.IOException
Event end bookmark. This event is launched when RTF keyword \bkmkend is found.

Parameters:
content - RTF end bookmark keyword \bkmkend.
Throws:
java.io.IOException

startPage

protected abstract void startPage(java.lang.String content)
                           throws java.io.IOException
Event page break. This event is launched when RTF keyword \page is found.

Parameters:
content - RTF start page keyword \page.
Throws:
java.io.IOException

handleText

protected abstract void handleText(java.lang.String content)
                            throws java.io.IOException
Event other RTF content. This event is launched when other RTF content is found (not a RTF keyword)

Parameters:
content - other RTF content.
Throws:
java.io.IOException

startUserProperty

protected abstract void startUserProperty(java.lang.String content)
                                   throws java.io.IOException
Event start user property. This event is launched when RTF keyword \propname is found.

Parameters:
content - RTF start user property keyword \propname.
Throws:
java.io.IOException

endUserProperty

protected abstract void endUserProperty(java.lang.String content)
                                 throws java.io.IOException
Event end user property. This event is launched when RTF keyword \staticval is found.

Parameters:
content - RTF end user property keyword \staticval.
Throws:
java.io.IOException


Copyright 2007 null. All Rights Reserved.