com.ibm.dse.tools.workbench.tbg
Class Generator

java.lang.Object
  |
  +--com.ibm.dse.tools.workbench.tbg.Generator

public class Generator
extends java.lang.Object

This class implements the TBG API.


Field Summary
protected static java.lang.String READER_NAME
          The descriptor READER.NAME.
protected static java.lang.String WRITER_FOLDER
          The descriptor WRITER.FOLDER.
protected static java.lang.String WRITER_NAME
          The descriptor WRITER.NAME.
 
Constructor Summary
Generator()
          This constructor creates a com.ibm.dse.tools.workbench.tbg.Generator object.
 
Method Summary
 java.lang.String[] close()
          Closes the actual execution.
static java.util.Hashtable getDuplicatedReferences()
          Return the duplicatedReferences hashtable.
 java.lang.String getLogName()
          Returns the log file name.
 void open()
          Opens an exectution.
 void setDataReaderName(java.lang.String name)
          Sets the value of the readerName property.
 void setDataWriterFolder(java.lang.String folder)
          Sets the value of the writerFolder property.
 void setDataWriterName(java.lang.String name)
          Sets the value of the writerName property.
 void setLogName(java.lang.String name)
          Sets the name of the log file.
 void setTbgTags(TbgTags tags)
          Sets the value of the context variable TbgTags.
 void start(java.io.Reader sIn, java.io.Writer sOut, TableRow tr)
          Starts the execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WRITER_NAME

protected static final java.lang.String WRITER_NAME
The descriptor WRITER.NAME.

READER_NAME

protected static final java.lang.String READER_NAME
The descriptor READER.NAME.

WRITER_FOLDER

protected static final java.lang.String WRITER_FOLDER
The descriptor WRITER.FOLDER.
Constructor Detail

Generator

public Generator()
This constructor creates a com.ibm.dse.tools.workbench.tbg.Generator object.

Creates new instance of TbgContext to store the execution variables.

Method Detail

close

public java.lang.String[] close()
                         throws WBInputOutputException
Closes the actual execution.

Closes the tbg log. If errors or warnings have ocurred during the execution returns an array of messages.

Returns:
java.lang.String[] The messages of errors or warnings.
Throws:
WBInputOutputException - When working with the log file an Exception is thrown.

getDuplicatedReferences

public static java.util.Hashtable getDuplicatedReferences()
Return the duplicatedReferences hashtable.
Returns:
java.util.Hashtable

getLogName

public java.lang.String getLogName()
Returns the log file name.
Returns:
java.lang.String The log file.

open

public void open()
          throws WorkbenchException
Opens an exectution.

Opens the log file and initializes the required variables.

Throws:
WBInputOutputException - When an IOException has been thrown.

setDataReaderName

public void setDataReaderName(java.lang.String name)
Sets the value of the readerName property. Stores this value in the context of the execution.
Parameters:
name - java.lang.String The new value of the readerName.

setDataWriterFolder

public void setDataWriterFolder(java.lang.String folder)
Sets the value of the writerFolder property. Stores this value in the context of the execution.
Parameters:
name - java.lang.String The new value of the folderName.

setDataWriterName

public void setDataWriterName(java.lang.String name)
Sets the value of the writerName property. Stores this value in the context of the execution.
Parameters:
name - java.lang.String The new value of the writerName.

setLogName

public void setLogName(java.lang.String name)
Sets the name of the log file. Stores this value in the context of the execution.
Parameters:
name - java.lang.String The new name of the log file.

setTbgTags

public void setTbgTags(TbgTags tags)
Sets the value of the context variable TbgTags. Stores this value in the context of the execution.

TbgTags contains the tags to parse and the classes that implement theirs functionality.

Parameters:
tags - com.ibm.dse.tools.workbench.tbg.TbgTags The new value of the TbgTags.

start

public void start(java.io.Reader sIn,
                  java.io.Writer sOut,
                  TableRow tr)
           throws WorkbenchException
Starts the execution.

Creates a TbgParser object, sets the context, and calls its generate() method.

Parameters:
sIn - java.io.Reader The input source.
sOut - java.io.Writer The output writer, where the result is written.
tr - com.ibm.dse.tools.workbench.base.TableRow Table row from where all the required elements of the template begin from.
Throws:
WorkbenchException - Thrown by the TbgParser method generate.