org.pz.platypus.plugin.rtf
Class RtfOutfile

java.lang.Object
  extended by org.pz.platypus.plugin.rtf.RtfOutfile

public class RtfOutfile
extends java.lang.Object

Handles the output to the RTF file

Author:
alb

Field Summary
private  java.lang.String filename
           
private  java.io.FileWriter fwOut
           
private  GDD gdd
           
private  boolean isOpen
           
private  RtfData rtd
           
 
Constructor Summary
RtfOutfile(java.lang.String filename, RtfData rtd)
           
 
Method Summary
 void close(java.util.logging.Logger log)
          Close the file
private  void emitRtfEpilog()
          Writes the closing part of the RTF file.
private  void emitRtfProlog()
          Writes the required header parts of the RTF file.
 boolean isOpen()
           
 java.io.FileWriter open(java.lang.String filename, java.util.logging.Logger log)
          Get an instance of FileWriter, to which we will emit RTF output
 void writeCommand(java.lang.String command)
          Write a command string to the RTF file.
 void writeText(java.lang.String text)
          Write a String of text to the RTF file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isOpen

private boolean isOpen

filename

private java.lang.String filename

fwOut

private java.io.FileWriter fwOut

gdd

private GDD gdd

rtd

private RtfData rtd
Constructor Detail

RtfOutfile

public RtfOutfile(java.lang.String filename,
                  RtfData rtd)
Method Detail

open

public java.io.FileWriter open(java.lang.String filename,
                               java.util.logging.Logger log)
                        throws java.io.IOException
Get an instance of FileWriter, to which we will emit RTF output

Parameters:
filename - of file to open (obtained from the command line)
log - logger for error messages
Returns:
the open FileWriter
Throws:
java.io.IOException - in the event the file can't be opened

emitRtfProlog

private void emitRtfProlog()
                    throws java.io.IOException
Writes the required header parts of the RTF file. Called from the RTF-file open routine, so we know for sure the file exists and is writable.

Throws:
java.io.IOException - in the event of an I/O error

emitRtfEpilog

private void emitRtfEpilog()
                    throws java.io.IOException
Writes the closing part of the RTF file. Called from the RTF-file close routine, so we know for sure the file exists and is writable.

Throws:
java.io.IOException - in the event of an I/O error

writeText

public void writeText(java.lang.String text)
               throws java.io.IOException
Write a String of text to the RTF file.

Parameters:
text - text to write
Throws:
java.io.IOException - in the event of an I/O error

writeCommand

public void writeCommand(java.lang.String command)
                  throws java.io.IOException
Write a command string to the RTF file.

Parameters:
command - text to write
Throws:
java.io.IOException - in the event of an I/O error

close

public void close(java.util.logging.Logger log)
           throws java.io.IOException
Close the file

Parameters:
log - for literals
Throws:
java.io.IOException - in case of error

isOpen

public boolean isOpen()


Copyright © 2008-10 Pacific Data Works LLC