dochelper.FileRenderer Class Reference

The class File Renderer is an implementation of the renderer interface. More...

Inheritance diagram for dochelper.FileRenderer:

Inheritance graph
[legend]
Collaboration diagram for dochelper.FileRenderer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 FileRenderer ()
 Creates a new instance of FileRenderer.
void setParam (String paramName, Object value) throws IllegalParamterTypeException
 Add an initialization parameter to the File Renderer.
void checkParams () throws InvalidValueException, MissingArgumentException, ResourceUnavailableException
 Checks that the parameters are correct for this File Record Set.
void init () throws InitializationException, ResourceUnavailableException
 File Renderer needs no initialization.
void execute (ResultNode doc) throws ResourceUnavailableException
 Main method of the File Renderer.
void addDocumentSection (DocumentSection docsection, String key)
 Add a document section for this Renderer.

Protected Attributes

String OUTPUT_FILE = "outputfile"
HashMap< String, Object > params = new HashMap<String,Object>()
Hashtable< String,
DocumentSection
docsections

Private Member Functions

String render (ResultNode node)
 Recursive method to create a String based on the passed in tree.


Detailed Description

The class File Renderer is an implementation of the renderer interface.

It is responsible for converting a result tree into a flat file for output. It will write the file to the path given in its parameter. The same params mechanism is used to set the renderer options.

Author:
: Guillermo Christen <guillermo.christen@is.online.nl>

Definition at line 33 of file FileRenderer.java.


Constructor & Destructor Documentation

dochelper.FileRenderer.FileRenderer (  ) 

Creates a new instance of FileRenderer.

Definition at line 56 of file FileRenderer.java.


Member Function Documentation

void dochelper.FileRenderer.setParam ( String  paramName,
Object  value 
) throws IllegalParamterTypeException

Add an initialization parameter to the File Renderer.

These parameters are used during the call to init to Establish - Initialize the Renderer. In this specific case, this call is used to set the output file parameter.

Parameters:
paramName String Name of the paramter to be stored
value String value of the named param
Exceptions:
IllegalParamterTypeException 

Implements dochelper.Configurable.

Definition at line 72 of file FileRenderer.java.

void dochelper.FileRenderer.checkParams (  )  throws InvalidValueException, MissingArgumentException, ResourceUnavailableException

Checks that the parameters are correct for this File Record Set.

Validate required parameters and semantic and format rules.

This method will not return a boolean indicating success, rather, it will fire an Exception indicating error type

Exceptions:
InvalidValueException 
ResourceUnavailableException 
MissingArgumentException 

Implements dochelper.Configurable.

Definition at line 92 of file FileRenderer.java.

void dochelper.FileRenderer.init (  )  throws InitializationException, ResourceUnavailableException

File Renderer needs no initialization.

Exceptions:
InitializationException 
ResourceUnavailableException 

Implements dochelper.Configurable.

Definition at line 107 of file FileRenderer.java.

void dochelper.FileRenderer.execute ( ResultNode  doc  )  throws ResourceUnavailableException

Main method of the File Renderer.

This method will convert the input ResultNode</code node into a flat file as output. The node passed in as input represents the root of the tree to convert.

Parameters:
doc The node that represent the root of the tree to process.
Exceptions:
ResourceUnavailableException 
Exception 

Implements dochelper.Renderer.

Definition at line 120 of file FileRenderer.java.

Here is the call graph for this function:

void dochelper.FileRenderer.addDocumentSection ( DocumentSection  docsection,
String  key 
)

Add a document section for this Renderer.

Key it according to the name of the object this Docsection should be applied to.

Parameters:
docsection DocSection to add.

Implements dochelper.Renderer.

Definition at line 150 of file FileRenderer.java.

String dochelper.FileRenderer.render ( ResultNode  node  )  [private]

Recursive method to create a String based on the passed in tree.

This method will fetch the correct document section. Append the getSTART() result, then recurse to children if any, or get the value if no children.

Parameters:
node Result Node to process.
Returns:
String representing the tree passed in.

Definition at line 164 of file FileRenderer.java.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

String dochelper.FileRenderer.OUTPUT_FILE = "outputfile" [protected]

Definition at line 41 of file FileRenderer.java.

HashMap<String,Object> dochelper.FileRenderer.params = new HashMap<String,Object>() [protected]

Definition at line 47 of file FileRenderer.java.

Hashtable<String,DocumentSection> dochelper.FileRenderer.docsections [protected]

Definition at line 53 of file FileRenderer.java.


The documentation for this class was generated from the following file:

Generated on Wed Jun 17 14:22:05 2009 for DocHelper by  doxygen 1.5.6