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

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

public class TbgData
extends java.lang.Object

This class implements a TBG data manager.


Field Summary
static boolean duplicatedReferencesWarningShowed
          Aux var that indicates if the warning message due to duplicated references has been already shown
 
Constructor Summary
TbgData()
          This constructor creates a TbgData object.
 
Method Summary
 java.lang.String getAllowedValuesDescriptor(TableRow allowed_value, java.lang.String descriptor)
          Returns the descriptor value from the specified allowed_value.
 TableRow[] getAllowedValuesList(TableRow attribute, java.lang.String attributeName)
          Returns the allowed_values list that belong to the specified Attribute.
 java.lang.String getAttributeDescriptor(TableRow instance, java.lang.String instanceName, java.lang.String attrName, java.lang.String descriptor)
          Returns the descriptor value from the specified Attribute.
 int getElemChildCount(TableRow element, java.lang.String elementName)
          Returns the number of children instances that compose the specified instance or the number of entities that compose the specified entity
 TableRow getElement(TableRow elem, java.lang.String elementPath)
          Returns the instance or the entity required from the specified TableRow.
 java.lang.String getElementDescriptor(TableRow instance, java.lang.String instanceName, java.lang.String descriptor)
          Returns the descriptor value from the specified Instance or Entity or Allowed_value.
 java.lang.String getElementDescriptor(TableRow elem, TableRow parent, java.lang.String elemName, java.lang.String descriptor)
          Returns the descriptor value from the specified element (Instance or Entity or Allowed_value).
 TableRow[] getElementList(TableRow instance, java.lang.String instanceName)
          Returns the children Instances that compose the specified Instance or the entities that compose the specified Entity.
 TableRow[] getInheritanceElementList(TableRow entity, java.lang.String entityName)
          Returns the children entities that extends the specified entity.
 TableRow getParentElement(TableRow elem, java.lang.String elementPath)
          Returns the parent instance or the parent entity required from the specified TableRow.
 TableRow[] getPropertiesList(TableRow instance, java.lang.String instanceName)
          Returns the Properties that belong to the specified Instance or the Attributes that belong to the specified Entity.
 java.lang.String getPropertyDescriptor(TableRow property, java.lang.String descriptor)
          Returns the descriptor value from the specified Property or Attribute.
 TableRow getReferredInstance(TableRow instance, java.lang.String name)
          Returns the referred instance to the property of the specified instance.
 TableRow getReferredInstance(TableRow instance, TableRow property)
          Returns the referred instance to the property.
 void setRoot(TableRow aInstance)
          Sets the root instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

duplicatedReferencesWarningShowed

public static boolean duplicatedReferencesWarningShowed
Aux var that indicates if the warning message due to duplicated references has been already shown
Constructor Detail

TbgData

public TbgData()
This constructor creates a TbgData object.
Method Detail

getAllowedValuesDescriptor

public java.lang.String getAllowedValuesDescriptor(TableRow allowed_value,
                                                   java.lang.String descriptor)
                                            throws WorkbenchException
Returns the descriptor value from the specified allowed_value.
Parameters:
allowed_value - com.ibm.dse.tools.workbench.base.TableRow The allowed_value from where the search begins.
descriptor - java.lang.String The descriptor to retrieve.
Returns:
java.lang.String - If the element specified exists, returns its descriptor value, otherwise returns null.
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getAllowedValuesList

public TableRow[] getAllowedValuesList(TableRow attribute,
                                       java.lang.String attributeName)
                                throws WorkbenchException
Returns the allowed_values list that belong to the specified Attribute.
Parameters:
attribute - com.ibm.dse.tools.workbench.base.TableRow The Attribute from where the search begins.
attributeName - java.lang.String The Attribute name to search for.
Returns:
com.ibm.dse.tools.workbench.base.TableRow[] - If the specified Attribute exists returns the array of its allowed_values, otherwise returns null.
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getAttributeDescriptor

public java.lang.String getAttributeDescriptor(TableRow instance,
                                               java.lang.String instanceName,
                                               java.lang.String attrName,
                                               java.lang.String descriptor)
                                        throws WorkbenchException
Returns the descriptor value from the specified Attribute.
Parameters:
instance - com.ibm.dse.tools.workbench.base.TableRow The Instance from where the search begins.
instanceName - java.lang.String The instance to find.
attrName - java.lang.String The attribute to find.
descriptor - java.lang.String The descriptor to retrieve.
Returns:
java.lang.String - If the element specified exists, returns its descriptor value, otherwise returns null.
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getElemChildCount

public int getElemChildCount(TableRow element,
                             java.lang.String elementName)
                      throws WorkbenchException
Returns the number of children instances that compose the specified instance or the number of entities that compose the specified entity
Parameters:
element - com.ibm.dse.tools.workbench.base.TableRow The Instance or Entity from where the search will begin.
elementName - java.lang.String The name of the instance or entity to search.
Returns:
int - If the element exists, returns the number of instances or entities, otherwise returns 0.
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getElement

public TableRow getElement(TableRow elem,
                           java.lang.String elementPath)
                    throws WorkbenchException
Returns the instance or the entity required from the specified TableRow.

If the TableRow is null, the search begins from the root. Otherwise, the search begins from the specified table row.

Parameters:
elem - com.ibm.dse.tools.workbench.base.TableRow The element to search from.
elementPath - java.lang.String The element to search.
Returns:
com.ibm.dse.tools.workbench.base.TableRow -The table row from the table Instances or Entities specified by the elementPath
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getElementDescriptor

public java.lang.String getElementDescriptor(TableRow elem,
                                             TableRow parent,
                                             java.lang.String elemName,
                                             java.lang.String descriptor)
                                      throws WorkbenchException
Returns the descriptor value from the specified element (Instance or Entity or Allowed_value).

This method is called from a loop operation.

Parameters:
elem - com.ibm.dse.tools.workbench.base.TableRow The element (Instance or Entity or Allowed_value) from which the search begins.
parent - com.ibm.dse.tools.workbench.base.TableRow The parent of the element, the iterateOver instance or element.
elemName - java.lang.String The instance or entity or allowed_value to find.
descriptor - java.lang.String The descriptor to retrieve.
Returns:
java.lang.String - If the element specified exists, returns its descriptor value, otherwise returns null.
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getElementDescriptor

public java.lang.String getElementDescriptor(TableRow instance,
                                             java.lang.String instanceName,
                                             java.lang.String descriptor)
                                      throws WorkbenchException
Returns the descriptor value from the specified Instance or Entity or Allowed_value.
Parameters:
instance - com.ibm.dse.tools.workbench.base.TableRow The element from where the search begins.
instanceName - java.lang.String The element to find.
descriptor - java.lang.String The descriptor to retrieve.
Returns:
java.lang.String - If the element specified exists, returns its descriptor value, otherwise returns null.
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getElementList

public TableRow[] getElementList(TableRow instance,
                                 java.lang.String instanceName)
                          throws WorkbenchException
Returns the children Instances that compose the specified Instance or the entities that compose the specified Entity.
Parameters:
instance - com.ibm.dse.tools.workbench.base.TableRow The Instance or Entity from where the search begins.
instanceName - java.lang.String The Instance name to search for.
Returns:
com.ibm.dse.tools.workbench.base.TableRow[] - If the specified Instance or Entity exists returns the array of Instances or Entities that compose it, otherwise returns null.
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getInheritanceElementList

public TableRow[] getInheritanceElementList(TableRow entity,
                                            java.lang.String entityName)
                                     throws WorkbenchException
Returns the children entities that extends the specified entity.
Parameters:
entity - com.ibm.dse.tools.workbench.base.TableRow The entity from where the search begins.
entityName - java.lang.String The Entity name to search for.
Returns:
com.ibm.dse.tools.workbench.base.TableRow[] - If the specified entity exists returns the array of entities that extends it, otherwise returns null.
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getParentElement

public TableRow getParentElement(TableRow elem,
                                 java.lang.String elementPath)
                          throws WorkbenchException
Returns the parent instance or the parent entity required from the specified TableRow.

If the TableRow is null, the search begins from the root. Otherwise, the search begins from the specified table row.

Parameters:
elem - com.ibm.dse.tools.workbench.base.TableRow The element to search from.
elementPath - java.lang.String The element to search.
Returns:
com.ibm.dse.tools.workbench.base.TableRow -The table row from the table Instances or Entities specified by the elementPath
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getPropertiesList

public TableRow[] getPropertiesList(TableRow instance,
                                    java.lang.String instanceName)
                             throws WorkbenchException
Returns the Properties that belong to the specified Instance or the Attributes that belong to the specified Entity.
Parameters:
instance - com.ibm.dse.tools.workbench.base.TableRow The Instance or Entity from where the search begins.
instanceName - java.lang.String The Instance or Entity name to search for.
Returns:
com.ibm.dse.tools.workbench.base.TableRow[] - If the specified Instance or Entity exists returns the array of its Properties or Attributes, otherwise returns null.
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getPropertyDescriptor

public java.lang.String getPropertyDescriptor(TableRow property,
                                              java.lang.String descriptor)
                                       throws WorkbenchException
Returns the descriptor value from the specified Property or Attribute.
Parameters:
property - com.ibm.dse.tools.workbench.base.TableRow. The property or attribute to query.
descriptor - java.lang.String The descriptor to retrieve.
Returns:
java.lang.String - If the property or attribute specified exists, returns its descriptor value, otherwise returns null.
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getReferredInstance

public TableRow getReferredInstance(TableRow instance,
                                    TableRow property)
                             throws WorkbenchException
Returns the referred instance to the property.
Parameters:
property - com.ibm.dse.tools.workbench.base.TableRow The Property.
Returns:
com.ibm.dse.tools.workbench.base.TableRow The referred instance
Throws:
WorkbenchException - Thrown when the reference can not be solved.

getReferredInstance

public TableRow getReferredInstance(TableRow instance,
                                    java.lang.String name)
                             throws WorkbenchException
Returns the referred instance to the property of the specified instance.
Parameters:
instance - com.ibm.dse.tools.workbench.base.TableRow The instance.
name - java.lang.String The property name.
Returns:
com.ibm.dse.tools.workbench.base.TableRow The referred instance
Throws:
WorkbenchException - Thrown when the reference can not be solved.

setRoot

public void setRoot(TableRow aInstance)
Sets the root instance.

This row will be the root Instance from where all the searches contained in the template will start from. If this parameter is specified as a null value, the object created has not access to the data base.

Parameters:
aInstance - com.ibm.dse.tools.workbench.base.TableRow