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

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

public class TbgLoop
extends java.lang.Object

This class implements a TBG loop operation.


Constructor Summary
TbgLoop(TbgData aData)
          This constructor creates a TbgLoop object.
 
Method Summary
 void endAllowedValuesLoop()
          When a allowed_values loop ends, removes its variable from the collection of variables.
 void endElemLoop()
          When a Instances loop ends, removes its variable from the collection of variables.
 void endPropLoop()
          When a Properties loop ends, removes its variable from the collection of variables.
 TableRow getActElement()
          Returns the value of the actElem property.
 java.lang.String getAllowedValue(java.lang.String descriptor)
          Returns the specified descriptor from the actual allowed_value.
 java.lang.String getAttribute(java.lang.String descriptor, java.lang.String elemName, java.lang.String attrName)
          Returns the required descriptor attribute from the specified element.
 java.lang.String getAttributeProperty(java.lang.String descriptor)
          Returns the specified descriptor from the actual property.
 int getCount(java.lang.String elementName)
          Returns the children number of the specified element
 java.lang.String getElement(java.lang.String descriptor, java.lang.String elementName)
          Returns the descriptor of the specified element.
 int getIter()
          Returns the value of the iter property.
 void iniAllowedValues(TbgContext aContext, java.lang.String name, java.lang.String elemName, TableRow element)
          Initializes a TbgLoop object with the nedded attributes.
 void iniElem(TbgContext aContext, java.lang.String name, java.lang.String elemName, TableRow element)
          Initializes a TbgLoop object with the nedded attributes.
 void iniInhe(TbgContext aContext, java.lang.String name, java.lang.String elemName, TableRow element)
          Initializes a TbgLoop object with the nedded attributes.
 void iniProp(TbgContext aContext, java.lang.String name, java.lang.String elemName, TableRow element)
          Initializes a TbgLoop object with the nedded attributes.
 void loop(char[] txt)
          Implements a loop operation, creates a new instance of Generator and parses the loop text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TbgLoop

public TbgLoop(TbgData aData)
This constructor creates a TbgLoop object.
Parameters:
aData - TbgData The repository manager.
Method Detail

endAllowedValuesLoop

public void endAllowedValuesLoop()
When a allowed_values loop ends, removes its variable from the collection of variables.

endElemLoop

public void endElemLoop()
When a Instances loop ends, removes its variable from the collection of variables.

endPropLoop

public void endPropLoop()
When a Properties loop ends, removes its variable from the collection of variables.

getActElement

public TableRow getActElement()
Returns the value of the actElem property.
Returns:
com.ibm.dse.tools.workbench.base.TableRow - The actual element being treated.

getAllowedValue

public java.lang.String getAllowedValue(java.lang.String descriptor)
                                 throws WorkbenchException
Returns the specified descriptor from the actual allowed_value.
Parameters:
descriptor - java.lang.String The descriptor to retrieve.
Returns:
java.lang.String The value of the descriptor.
Throws:
WorkbenchException - Thrown by the dataManager.

getAttribute

public java.lang.String getAttribute(java.lang.String descriptor,
                                     java.lang.String elemName,
                                     java.lang.String attrName)
                              throws WorkbenchException
Returns the required descriptor attribute from the specified element.

The search begins from the actual element.

Parameters:
descriptor - java.lang.String The descriptor to look for.
elemName - java.lang.String The element name to search.
attrName - java.lang.String The attribute name to search.
Returns:
java.lang.String - The specified descriptor if it is valid, otherwise returns null.
Throws:
TbgException - Thrown by the dataManager.

getAttributeProperty

public java.lang.String getAttributeProperty(java.lang.String descriptor)
                                      throws WorkbenchException
Returns the specified descriptor from the actual property.
Parameters:
descriptor - java.lang.String The descriptor to retrieve.
Returns:
java.lang.String The value of the descriptor.
Throws:
WorkbenchException - Thrown by the dataManager.

getCount

public int getCount(java.lang.String elementName)
             throws WorkbenchException
Returns the children number of the specified element
Parameters:
elementName - java.lang.String The element to look for.
Returns:
int - The children number.
Throws:
WorkbenchException - Thrown by the dataManager.

getElement

public java.lang.String getElement(java.lang.String descriptor,
                                   java.lang.String elementName)
                            throws WorkbenchException
Returns the descriptor of the specified element.

The search begins from the actual element.

Parameters:
descriptor - java.lang.String The descriptor to return.
elementName - java.lang.String The element to look for.
Returns:
java.lang.String - The descriptor if the element exists, null otherwise.
Throws:
WorkbenchException - Thrown by the dataManager.

getIter

public int getIter()
Returns the value of the iter property.
Returns:
int - The actual iteration.

iniAllowedValues

public void iniAllowedValues(TbgContext aContext,
                             java.lang.String name,
                             java.lang.String elemName,
                             TableRow element)
                      throws WorkbenchException
Initializes a TbgLoop object with the nedded attributes. The loop is over the allowed_values of an attribute
Parameters:
aContext - TbgContext Contains the actual context.
name - java.lang.String The loop's variable name.
elemName - java.lang.String The element to loop.
element - TableRow The TableRow from where the loop starts.
Throws:
WorkbenchException - Thrown by the dataManager.

iniElem

public void iniElem(TbgContext aContext,
                    java.lang.String name,
                    java.lang.String elemName,
                    TableRow element)
             throws WorkbenchException
Initializes a TbgLoop object with the nedded attributes. The loop is over the children of an instance or the components of an entity
Parameters:
aContext - TbgContext Contains the actual context .
name - java.lang.String The loop's variable name.
elemName - java.lang.String The element to loop.
element - TableRow The TableRow from where the loop starts.
Throws:
WorkbenchException - Thrown by the dataManager.

iniInhe

public void iniInhe(TbgContext aContext,
                    java.lang.String name,
                    java.lang.String elemName,
                    TableRow element)
             throws WorkbenchException
Initializes a TbgLoop object with the nedded attributes. The loop is over the inheritance of an entity
Parameters:
aContext - TbgContext Contains the actual context .
name - java.lang.String The loop's variable name.
elemName - java.lang.String The element to loop.
element - TableRow The TableRow from where the loop starts.
Throws:
WorkbenchException - Thrown by the dataManager.

iniProp

public void iniProp(TbgContext aContext,
                    java.lang.String name,
                    java.lang.String elemName,
                    TableRow element)
             throws WorkbenchException
Initializes a TbgLoop object with the nedded attributes. The loop is over the properties of an instance or the attributes of an entity
Parameters:
aContext - TbgContext Contains the actual context.
name - java.lang.String The loop's variable name.
elemName - java.lang.String The element to loop.
element - TableRow The TableRow from where the loop starts.
Throws:
WorkbenchException - Thrown by the dataManager.

loop

public void loop(char[] txt)
          throws TbgException,
                 WorkbenchException
Implements a loop operation, creates a new instance of Generator and parses the loop text.
Parameters:
char[] - txt The loop text to parse.
Throws:
TbgException - When some error or warning have been ocurred during the loop generation.
WorkbenchException - When errors have ocurred during the access to the DB.