pt.tumba.parser.rtf
Class RTF2HTML

java.lang.Object
  extended by pt.tumba.parser.rtf.RTF2HTML
All Implemented Interfaces:
DocFilter

public class RTF2HTML
extends java.lang.Object
implements DocFilter

Description of the Class

Author:
bmartins

Nested Class Summary
private  class RTF2HTML.HTMLStateMachine
          Description of the Class
 
Field Summary
private  int sizeCount
           
 
Constructor Summary
RTF2HTML()
          Constructor for the RTF2HTML object
 
Method Summary
 java.lang.String convertRTFStringToHTML(java.lang.String s)
          Description of the Method
private  java.lang.String convertRTFStringToHTML(java.lang.String s2, RTF2HTML.HTMLStateMachine htmlstatemachine)
          Description of the Method
 java.lang.String convertRTFToHTML(java.io.File input)
          Description of the Method
 java.lang.String convertRTFToHTML(java.io.InputStream input)
          Description of the Method
 java.lang.String convertRTFToHTML(java.io.Reader input)
          Description of the Method
 java.lang.String convertRTFToHTML(java.lang.String s4)
          Description of the Method
 java.lang.String convertRTFToHTML(java.net.URL input)
          Description of the Method
 int originalSize()
          Description of the Method
 java.io.InputStream parse(java.io.File in)
          Description of the Method
 java.io.InputStream parse(java.io.InputStream in)
          Arguments are: 0.
 java.io.InputStream parse(java.net.URL in)
          Description of the Method
private  void readString(java.lang.String s, javax.swing.text.Document document, javax.swing.text.rtf.RTFEditorKit rtfeditorkit)
          Description of the Method
private  void recurseElements(javax.swing.text.Element element, javax.swing.text.Document document, java.lang.StringBuffer stringbuffer, RTF2HTML.HTMLStateMachine htmlstatemachine)
          Description of the Method
private  void scanAttributes(javax.swing.text.Element element, javax.swing.text.Document document, java.lang.StringBuffer stringbuffer, RTF2HTML.HTMLStateMachine htmlstatemachine)
          Description of the Method
private  java.lang.String scanDocument(javax.swing.text.Document document, RTF2HTML.HTMLStateMachine htmlstatemachine)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sizeCount

private int sizeCount
Constructor Detail

RTF2HTML

public RTF2HTML()
Constructor for the RTF2HTML object

Method Detail

originalSize

public int originalSize()
Description of the Method

Specified by:
originalSize in interface DocFilter
Returns:
Description of the Return Value

convertRTFToHTML

public java.lang.String convertRTFToHTML(java.lang.String s4)
Description of the Method

Parameters:
s2 - Description of the Parameter
Returns:
Description of the Return Value

convertRTFToHTML

public java.lang.String convertRTFToHTML(java.io.Reader input)
                                  throws java.io.IOException
Description of the Method

Parameters:
input - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

convertRTFToHTML

public java.lang.String convertRTFToHTML(java.io.InputStream input)
                                  throws java.io.IOException
Description of the Method

Parameters:
input - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

convertRTFToHTML

public java.lang.String convertRTFToHTML(java.io.File input)
                                  throws java.io.IOException
Description of the Method

Parameters:
input - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

convertRTFToHTML

public java.lang.String convertRTFToHTML(java.net.URL input)
                                  throws java.io.IOException
Description of the Method

Parameters:
input - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

convertRTFStringToHTML

public java.lang.String convertRTFStringToHTML(java.lang.String s)
Description of the Method

Parameters:
s - Description of the Parameter
Returns:
Description of the Return Value

convertRTFStringToHTML

private java.lang.String convertRTFStringToHTML(java.lang.String s2,
                                                RTF2HTML.HTMLStateMachine htmlstatemachine)
Description of the Method

Parameters:
s - Description of the Parameter
htmlstatemachine - Description of the Parameter
Returns:
Description of the Return Value

readString

private void readString(java.lang.String s,
                        javax.swing.text.Document document,
                        javax.swing.text.rtf.RTFEditorKit rtfeditorkit)
Description of the Method

Parameters:
s - Description of the Parameter
document - Description of the Parameter
rtfeditorkit - Description of the Parameter

scanDocument

private java.lang.String scanDocument(javax.swing.text.Document document,
                                      RTF2HTML.HTMLStateMachine htmlstatemachine)
Description of the Method

Parameters:
document - Description of the Parameter
htmlstatemachine - Description of the Parameter
Returns:
Description of the Return Value

recurseElements

private void recurseElements(javax.swing.text.Element element,
                             javax.swing.text.Document document,
                             java.lang.StringBuffer stringbuffer,
                             RTF2HTML.HTMLStateMachine htmlstatemachine)
Description of the Method

Parameters:
element - Description of the Parameter
document - Description of the Parameter
stringbuffer - Description of the Parameter
htmlstatemachine - Description of the Parameter

scanAttributes

private void scanAttributes(javax.swing.text.Element element,
                            javax.swing.text.Document document,
                            java.lang.StringBuffer stringbuffer,
                            RTF2HTML.HTMLStateMachine htmlstatemachine)
Description of the Method

Parameters:
element - Description of the Parameter
document - Description of the Parameter
stringbuffer - Description of the Parameter
htmlstatemachine - Description of the Parameter

parse

public java.io.InputStream parse(java.io.File in)
                          throws java.lang.Exception
Description of the Method

Parameters:
in - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.lang.Exception - Description of the Exception

parse

public java.io.InputStream parse(java.net.URL in)
                          throws java.lang.Exception
Description of the Method

Parameters:
in - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.lang.Exception - Description of the Exception

parse

public java.io.InputStream parse(java.io.InputStream in)
                          throws java.lang.Exception
Arguments are: 0. Name of input SWF

Parameters:
in - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.lang.Exception - Description of the Exception