net.sourceforge.rtf.handler
Class RTFIndentHandler

java.lang.Object
  extended by net.sourceforge.rtf.parser.AbstractCoreRTFParser
      extended by net.sourceforge.rtf.handler.RTFIndentHandler

public class RTFIndentHandler
extends AbstractCoreRTFParser

RTF handler which implement AbstractCoreRTFParser to indent RTF stream on start/end group (on { and } characters)

Version:
1.0.0
Author:
Angelo ZERR

Constructor Summary
RTFIndentHandler(java.io.Writer writer)
           
 
Method Summary
protected  void endGroup(char endGroupCharacter, int level)
          Indent end group.
protected  void handleKeyword(java.lang.String content)
          Event RTF keyword.
static void main(java.lang.String[] args)
          Indent RTF source filename (arg[0]) and save RTF indented content into RTF file target indent_filename
protected  void startGroup(char startGroupCharacter, int level)
          Indent start group.
 
Methods inherited from class net.sourceforge.rtf.parser.AbstractCoreRTFParser
getLevel, parse, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTFIndentHandler

public RTFIndentHandler(java.io.Writer writer)
Method Detail

handleKeyword

protected void handleKeyword(java.lang.String content)
                      throws java.io.IOException
Description copied from class: AbstractCoreRTFParser
Event RTF keyword. This event is launched when RTF content (current string parsed) end by character \.

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

startGroup

protected void startGroup(char startGroupCharacter,
                          int level)
                   throws java.io.IOException
Indent start group.

Specified by:
startGroup in class AbstractCoreRTFParser
Parameters:
startGroupCharacter - start group character {.
level - of current group.
Throws:
java.io.IOException

endGroup

protected void endGroup(char endGroupCharacter,
                        int level)
                 throws java.io.IOException
Indent end group.

Specified by:
endGroup in class AbstractCoreRTFParser
Parameters:
endGroupCharacter - end group character }.
level - of current group.
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
Indent RTF source filename (arg[0]) and save RTF indented content into RTF file target indent_filename

Parameters:
args[0] - rtf filename to indent.


Copyright 2007 null. All Rights Reserved.