org.writersforge.catalan
Class GenericGenerator

java.lang.Object
  |
  +--org.writersforge.catalan.GenericGenerator

public class GenericGenerator
extends java.lang.Object

Content generator for creating PDFs, HTML, and ASCII text files from arbitrary XML data formats, using a layout-template XML file to filter and position the data in the output medium. Uses the BellowsLoader and GenericTemplate classes to handle the loading and layout. The Renderer must be set before invoking the rendering process.

Author:
jsheets

Constructor Summary
GenericGenerator()
           
 
Method Summary
static void main(java.lang.String[] args)
          Invokes the rendering process using the generic XML processing tools.
 void parseArgs(java.lang.String[] args)
          Parses and processes the command-line arguments.
 void run()
          Fires off the document generator, given the current input and output file settings and output format.
 void setFormat(java.lang.String format)
          Sets the rendering format: "PDF", "TEXT", or "HTML".
 void setInputFiles(java.lang.String[] inputFiles)
          Sets the array of input file paths.
 void setOutputFile(java.lang.String outputFile)
          Sets the output file path.
 void setRenderer(Renderer renderer)
          Assigns the Renderer to use for creating the final output.
 void setTemplateFile(java.lang.String templateFile)
          Sets the file path for the template file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericGenerator

public GenericGenerator()
Method Detail

setRenderer

public void setRenderer(Renderer renderer)
Assigns the Renderer to use for creating the final output. There is no default renderer, so this method must be called.

Parameters:
renderer - the Renderer to use for output

setFormat

public void setFormat(java.lang.String format)
Sets the rendering format: "PDF", "TEXT", or "HTML".

Parameters:
format - the rendering format

setTemplateFile

public void setTemplateFile(java.lang.String templateFile)
Sets the file path for the template file.

Parameters:
templateFile - a path to the template file

setInputFiles

public void setInputFiles(java.lang.String[] inputFiles)
Sets the array of input file paths.

Parameters:
inputFiles - an array of input file paths

setOutputFile

public void setOutputFile(java.lang.String outputFile)
Sets the output file path.

Parameters:
outputFile - the output file path

parseArgs

public void parseArgs(java.lang.String[] args)
Parses and processes the command-line arguments.

Parameters:
args - an array of command-line arguments, e.g., from main()

run

public void run()
         throws java.io.IOException
Fires off the document generator, given the current input and output file settings and output format.

Throws:
java.io.IOException - if an error occurs while reading or writing files

main

public static void main(java.lang.String[] args)
Invokes the rendering process using the generic XML processing tools.

Parameters:
args - the command line arguments