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

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

public class TbgContext
extends java.lang.Object

This class stores the context of the utility.

The variables that are needed to execute the TBG are storedin this class.


Field Summary
 java.lang.String actTab
          The actual tag tabulation.
 TbgData dataManager
          The data manager.
 java.util.Vector errorMessages
          The vector that contains the TBG messages.
 boolean errors
          Set to true if errors have ocurred during the parsing.
 java.lang.String expression
          The actual TBG expression to manage.
protected  java.util.Hashtable externalVariables
          The external variables.
 java.io.BufferedReader in
          Input Reader.
 int lineNumber
          The actual line number being treated.
 TbgWriter log
          Log file.
 java.lang.String logFile
          Log file name.
 TbgWriter out
          Output writer.
 TbgTags tagNames
          The TbgTags reconized by the TBG.
 java.lang.String thisTab
          The template tabulation.
 TbgVariables variables
          Template variables.
 boolean warnings
          Set to true if warnings have ocurred during the parsing.
 
Constructor Summary
TbgContext()
          This constructor creates a TbgContext object.
TbgContext(TbgContext aContext)
          This constructor creates a TbgContext object.
 
Method Summary
 java.lang.String getExternalVar(java.lang.String var)
          Returns the value of the specified external variable.
 java.util.Hashtable getExtVars()
          Returns the External Variables HashTable.
 void initialize()
          Initializes the required properties.
 void setError(java.lang.String error)
          Sets an error.
 void setExternalVar(java.lang.String var, java.lang.String value)
          Sets the relation between an external variable and its value.
 void setReader(java.io.Reader reader)
          Sets the reader class to the context.
 void setWarning(java.lang.String warning)
          Sets a warning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expression

public java.lang.String expression
The actual TBG expression to manage.

tagNames

public TbgTags tagNames
The TbgTags reconized by the TBG.

dataManager

public TbgData dataManager
The data manager.

variables

public TbgVariables variables
Template variables. The variables defined in the template.

externalVariables

protected java.util.Hashtable externalVariables
The external variables. The variables defined by the user.

log

public TbgWriter log
Log file. The log writer.

logFile

public java.lang.String logFile
Log file name.

in

public java.io.BufferedReader in
Input Reader.

out

public TbgWriter out
Output writer.

thisTab

public java.lang.String thisTab
The template tabulation. This property is set when the TBG is generating an include template. Contains the tabulation to write at the beginning of each line of the generation result.

actTab

public java.lang.String actTab
The actual tag tabulation. The tabulation placed before the tag.

errors

public boolean errors
Set to true if errors have ocurred during the parsing.

warnings

public boolean warnings
Set to true if warnings have ocurred during the parsing.

errorMessages

public java.util.Vector errorMessages
The vector that contains the TBG messages.

lineNumber

public int lineNumber
The actual line number being treated.
Constructor Detail

TbgContext

public TbgContext()
This constructor creates a TbgContext object.

The properties of TbgContext have no values .


TbgContext

public TbgContext(TbgContext aContext)
This constructor creates a TbgContext object.

Copies the attributes of the specified context to this new instance of TbgContext.

Parameters:
aContext - TbgContext
Method Detail

getExternalVar

public java.lang.String getExternalVar(java.lang.String var)
Returns the value of the specified external variable.
Parameters:
var - java.lang.String The variable to retrieve.
Returns:
java.lang.String The value of the variable, or null if the variables does not exists.

getExtVars

public java.util.Hashtable getExtVars()
Returns the External Variables HashTable.
Returns:
java.util.Hashtable The external variables.

initialize

public void initialize()
Initializes the required properties. Initializes the variables, the tabulators and the expression.

setError

public void setError(java.lang.String error)
              throws WBInputOutputException
Sets an error.
Parameters:
error - java.lang.String The error to display.
Throws:
WBInputOutputException - Thrown when errors have ocurred while writing in the TbgWriter.

setExternalVar

public void setExternalVar(java.lang.String var,
                           java.lang.String value)
Sets the relation between an external variable and its value.
Parameters:
var - java.lang.String The variable name.
value - java.lang.String The variable value.

setReader

public void setReader(java.io.Reader reader)
Sets the reader class to the context.
Parameters:
writer - java.io.Reader The reader to set.

setWarning

public void setWarning(java.lang.String warning)
                throws WBInputOutputException
Sets a warning.
Parameters:
warning - java.lang.String The warning to display.
Throws:
WBInputOutputException - Thrown when errors have ocurred while writing in the TbgWriter.